I'm trying to generate HL7 message containing multiple segments (ORC and OBR in ORM-O01). I put ORM-O01 message to outbound template and I'm trying to modify it using JavaScript.
TEMPLATE:
My destination transformer JavaScript:
Until default parser (non-strict) is used everything is OK. My outbound mesage contains modified template.
When I activate strict parser('use strict parser') outbound message contains untransformed template. I've also tried to use real (good) segments for orc variable. Result was the same.
The question is: How to validate HL7 message generated using JavaScript. Is it possible to use some method that will return true when message is correct or false if not.
TEMPLATE:
MSH|^~\&|CLININET|NONE|Modu.||20020603121707||ORM^ O01|CLININET20020603121707|P|2.3|||AL|NE|POL||PL|
PID||73051213886^^^^PESEL|17741||FIN^FRANCESCA||19 730512|F|||REDA&34^^CITY^^20-457|||||||||
PV1|1|O||||||||||||||||||||||||||||||||||||||||||| ||||||||
IN1|||134&HIS|KH&07R
PID||73051213886^^^^PESEL|17741||FIN^FRANCESCA||19 730512|F|||REDA&34^^CITY^^20-457|||||||||
PV1|1|O||||||||||||||||||||||||||||||||||||||||||| ||||||||
IN1|||134&HIS|KH&07R
Code:
var orc = <ORC> <ORC.2> <ORC.2.1>17741</ORC.2.1> </ORC.2> </ORC>; var obr = <OBR> <OBR.2> <OBR.2.1>obrTest</OBR.2.1> </OBR.2> </OBR>; for (var i = 0; i < 4; i++){ tmp['ORC'][i] = orc; tmp['OBR'][i] = obr; }
MSH|^~\&|CLININET|NONE|Modu.||20020603121707||ORM^ O01|CLININET20020603121707|P|2.3|||AL|NE|POL||PL|
PID||73051213886^^^^PESEL|17741||FIN^FRANCESCA||19 730512|F|||REDA&34^^CITY^^20-457|||||||||
PV1|1|O||||||||||||||||||||||||||||||||||||||||||| ||||||||
IN1|||134&HIS|KH&07R
ORC|17741
OBR|obrTest
ORC|17741
OBR|obrTest
ORC|17741
OBR|obrTest
ORC|17741
OBR|obrTest
ORC|17741
OBR|obrTest
ORC|17741
OBR|obrTest
ORC|17741
OBR|obrTest
ORC|17741
OBR|obrTest
ORC|17741
OBR|obrTest
ORC|17741
OBR|obrTest
PID||73051213886^^^^PESEL|17741||FIN^FRANCESCA||19 730512|F|||REDA&34^^CITY^^20-457|||||||||
PV1|1|O||||||||||||||||||||||||||||||||||||||||||| ||||||||
IN1|||134&HIS|KH&07R
ORC|17741
OBR|obrTest
ORC|17741
OBR|obrTest
ORC|17741
OBR|obrTest
ORC|17741
OBR|obrTest
ORC|17741
OBR|obrTest
ORC|17741
OBR|obrTest
ORC|17741
OBR|obrTest
ORC|17741
OBR|obrTest
ORC|17741
OBR|obrTest
ORC|17741
OBR|obrTest
The question is: How to validate HL7 message generated using JavaScript. Is it possible to use some method that will return true when message is correct or false if not.
Comment