hapi

Hapi/Joi Validation For Number Fails

梦想与她 提交于 2019-12-11 17:09:01
问题 I am trying to validate number value which will include integer as well as float values. Following is my implementation for the same. Joi Schema. const numcheckschema = Joi.object().keys({ v1:Joi.number().empty("").allow(null).default(99999), v2:Joi.number().empty("").allow(null).default(99999), v3:Joi.number().empty("").allow(null).default(99999) }) Object objnum={ v1:"15", v2:"13.", v3:"15" } objValidated = Joi.validate(objnum, numcheckschema); console.log(objValidated); When i execute the

Getting double quotes when returning html

我怕爱的太早我们不能终老 提交于 2019-12-11 15:54:23
问题 I have below route to return privacy policy for my app. const html = `<html><body><div>dsfdsfsfdsfsfsdfdsf</div></body></html>` const handler = (request, reply) => { try { return reply(html) } catch (err) { return reply({ success: false, message: err.message, data: [] }) } } const routeConfig = { method: 'GET', path: '/privacy-policy', config: { description: 'Creates a task.', notes: ['On success, returns { "data": [ { "tasks" } ]}'], handler } } However when I am returning the html content I

POSTGRES check if a provided value is present in the column of type array

删除回忆录丶 提交于 2019-12-11 06:59:18
问题 I am trying to check whether a value if present in the column, which is of type array(column_name text[]). As a server i am using hapi and trying to check the same from hapi through query. Query which i have written is(query is not working): where: { column_name: { $in: { provided_value} }} The column contains the values as: {1234, 3456} The values are of type text. Can someone please help me to identify the issue. Thanks in advance. 回答1: Sequelize does not support this use of ANY , they seem

Why NACK message misses to create the Fields 3,4 and 5 in Hapi

和自甴很熟 提交于 2019-12-08 10:19:22
问题 The NACK message generated by HAPI missed to add 3, 4, 5 fields I'm generating the NACK message as follows; Message msg= hl7Msg.generateACK(HL7Constants.HL7_MSA_ERROR_FIELD_VALUE, new HL7Exception(errorMsg)); This returns; following message; MSH|^~\&|||||20130604165513.576+0100||ACK|108|P|2.5 MSA|AE|HL7Gtw01361605B49500 ERR|^^^207&ERROR&hl70357&&errmsg If you notice the ERR segment, it doesn't have 3,4,5 fields Any idea why hapi missed to add field 3,4 and 5? I checked with Hapi testpanel,

How to parse the Multiple OBR Segment in HL7 using HAPI TERSER

元气小坏坏 提交于 2019-12-07 08:55:29
问题 How to parse the Multiple OBR Segment in HL7 using HAPI using terser I have sample hl7 message like this MSH|^~\&|SENDERAPP|SENDERFAC|COVCDR|COVCDR|20130212221503||ORU^R01|1676326503009050|P|2.5 PID|1||MRN101||DOE^JOHN^A||20000101|M||W|1 Campus Martius^^Detroit^MI^48226||(313)227-7300||EN|S|||111-11-1111|||H PV1|1|U| 12E^1211^01||||1689885733^ORANGE TEAM, OMNI|||Med||||Tra|||99999999^SMITH^KEVIN^^^^MD|I|000000000000|YY|P||||||||||||||||||||Ac|||20130224080500 ORC|RE|F78520223|000000000^LA||CM

Need to parse HL7 message

六眼飞鱼酱① 提交于 2019-12-06 04:25:39
问题 I need to parse HL7 message ,firstly ,validate the message and then parse. XMLParser xmlParser = new DefaultXMLParser(); //encode message in XML String hl7MessageInXML = null; try { hl7MessageInXML = xmlParser.encode(message); } catch (HL7Exception e) { e.printStackTrace(); } 回答1: Example code: import ca.uhn.hl7v2.parser.*; import ca.uhn.hl7v2.model.Message; import ca.uhn.hl7v2.model.v24.message.ACK; public class ParserDemo { public static void main(String args[]) { //for demo purposes, we

How to parse the Multiple OBR Segment in HL7 using HAPI TERSER

霸气de小男生 提交于 2019-12-05 16:23:48
How to parse the Multiple OBR Segment in HL7 using HAPI using terser I have sample hl7 message like this MSH|^~\&|SENDERAPP|SENDERFAC|COVCDR|COVCDR|20130212221503||ORU^R01|1676326503009050|P|2.5 PID|1||MRN101||DOE^JOHN^A||20000101|M||W|1 Campus Martius^^Detroit^MI^48226||(313)227-7300||EN|S|||111-11-1111|||H PV1|1|U| 12E^1211^01||||1689885733^ORANGE TEAM, OMNI|||Med||||Tra|||99999999^SMITH^KEVIN^^^^MD|I|000000000000|YY|P||||||||||||||||||||Ac|||20130224080500 ORC|RE|F78520223|000000000^LA||CM||||20130226020200|||| PICU|||^RESULT PERFORMED|||RES OBR|1|F78520223|1305611705^LA|0101301^COMPLETE

Need to parse HL7 message

◇◆丶佛笑我妖孽 提交于 2019-12-04 12:50:53
I need to parse HL7 message ,firstly ,validate the message and then parse. XMLParser xmlParser = new DefaultXMLParser(); //encode message in XML String hl7MessageInXML = null; try { hl7MessageInXML = xmlParser.encode(message); } catch (HL7Exception e) { e.printStackTrace(); } Example code: import ca.uhn.hl7v2.parser.*; import ca.uhn.hl7v2.model.Message; import ca.uhn.hl7v2.model.v24.message.ACK; public class ParserDemo { public static void main(String args[]) { //for demo purposes, we just declare a literal message string String ackMessageString = "MSH|^~\\&|foo|foo||foo|200108151718||ACK^A01

Android - Java parsing HL7 Message with HAPI v 2.2 with DefaultHapiContext

夙愿已清 提交于 2019-12-01 11:23:14
I get this error when trying to parsing a HL7 message. I dont know why and how to fix it. I'm using hapi v2.2 . SO please help me. Thanks in advance!. Here is catlog!!! 08-28 15:03:28.552: E/dalvikvm(642): Could not find class 'ca.uhn.hl7v2.DefaultHapiContext', referenced from method com.example.hl7demo.MainActivity.onCreate 08-28 15:03:28.673: E/AndroidRuntime(642): java.lang.NoClassDefFoundError: ca.uhn.hl7v2.DefaultHapiContext 08-28 15:03:28.673: E/AndroidRuntime(642): at com.example.hl7demo.MainActivity.onCreate(MainActivity.java:38) bases on this tutorial http://hl7api.sourceforge.net