-
Notifications
You must be signed in to change notification settings - Fork 2
Getting Started
Alberto Fuentes edited this page Mar 2, 2020
·
9 revisions
Conversions between ER7 and XML format can be made using ITB.HL7.Util.Convert
class.
TEST>set er7=##class(EnsLib.HL7.Message).ImportFromFile("/app/unittest/hl7/2.5_ORMO01.hl7", .sc)
TEST>set er7.DocType = er7.chooseDocType(.desc)
TEST>set xml = ##class(ITB.HL7.Util.Convert).ER7ToXML(er7,.sc)
TEST>write sc
1
TEST>write xml.Read()
<ORM_O01 xmlns="urn:hl7-org:v2xml"><MSH><MSH.1>|</MSH.1><MSH.2>^~\&</MSH.2><MSH.3><HD.1>hphis</HD.1></MSH.3><MSH.4><HD.1>192.168.2.203</HD.1></MSH.4><MSH.5><HD.1>EPIC</HD.1></MSH.5><MSH.7><TS.1>20131011093851</TS.1></MSH.7><MSH.9><MSG.1>ORM</MSG.1><MSG.2>O01</MSG.2></MSH.9><MSH.10>14AAACVDD</MSH.10><MSH.11><PT.1>P</PT.1></MSH.11><MSH.12><VID.1>2.5</VID.1></MSH.12><MSH.15>AL</MSH.15><MSH.16>NE</MSH.16></MSH><ORM_O01.PATIENT><PID><PID.2><CX.1>241900</CX.1></PID.2><PID.4><CX.1>MAPO0371545477</CX.1></PID.4><PID.5><XPN.1><FN.1>MEDIANO</FN.1></XPN.1><XPN.2>FOUAZ</XPN.2><XPN.3>TEST</XPN.3></PID.5><PID.7><TS.1>19740602</TS.1></PID.7><PID.8>M</PID.8><PID.11><XAD.1><SAD.1>CARRETERA ENTORNO DE PRUEBAS</SAD.1></XAD.1><XAD.3>SANT VICENT DELS HORTS</XAD.3><XAD.4>8</XAD.4><XAD.5>08620</XAD.5><XAD.6>724</XAD.6><XAD.8>1</XAD.8></PID.11><PID.13><XTN.1>123456789</XTN.1></PID.13><PID.14><XTN.1>123456789</XTN.1></PID.14><PID.19>08/03072889-52</PID.19><PID.20><DLN.1>52912868B</DLN.1></PID.20><PID.28><CE.1>724</CE.1></PID.28><PID.30>no</PID.30></PID><ORM_O01.PATIENT_VISIT><PV1><PV1.1>1</PV1.1><PV1.4>O</PV1.4><PV1.7><XCN.1>1105</XCN.1><XCN.2><FN.1>TORRA</FN.1></XCN.2><XCN.3>SANZ</XCN.3><XCN.4>JOAN</XCN.4></PV1.7><PV1.7><XCN.1>1105</XCN.1></PV1.7><PV1.8><XCN.1>1105</XCN.1><XCN.2><FN.1>TORRA</FN.1></XCN.2><XCN.3>SANZ</XCN.3><XCN.4>JOAN</XCN.4></PV1.8><PV1.8><XCN.1>1105</XCN.1></PV1.8><PV1.10>DIGC</PV1.10><PV1.17><XCN.1>1105</XCN.1><XCN.2><FN.1>TORRA</FN.1></XCN.2><XCN.3>SANZ</XCN.3><XCN.4>JOAN</XCN.4></PV1.17><PV1.17><XCN.1>1105</XCN.1></PV1.17><PV1.19><CX.1>302141984</CX.1></PV1.19><PV1.44><TS.1>20131011104000</TS.1></PV1.44></PV1></ORM_O01.PATIENT_VISIT></ORM_O01.PATIENT><ORM_O01.ORDER><ORC><ORC.1>NW</ORC.1><ORC.2><EI.1>2089258</EI.1></ORC.2><ORC.4><EI.1>1760391</EI.1></ORC.4><ORC.5>HD</ORC.5><ORC.7><TQ.6>1</TQ.6></ORC.7><ORC.9><TS.1>20131011093800000</TS.1></ORC.9><ORC.12><XCN.1>2214</XCN.1><XCN.2><FN.1>SERRANO</FN.1></XCN.2><XCN.3>LAIA</XCN.3></ORC.12><ORC.13><PL.1>CIRC</PL.1></ORC.13><ORC.16><CE.2>Motivo 1</CE.2></ORC.16></ORC><ORM_O01.ORDER_DETAIL><ORM_O01.ORDER_CHOICE><OBR><OBR.2><EI.1>2089258</EI.1></OBR.2><OBR.4><CE.1>1</CE.1><CE.2>Interconsulta</CE.2></OBR.4><OBR.10><XCN.2><FN.1>S/I</FN.1></XCN.2><XCN.3>S/I</XCN.3></OBR.10><OBR.16><XCN.1>2214</XCN.1><XCN.2><FN.1>SERRANO</FN.1></XCN.2><XCN.3>LAIA</XCN.3></OBR.16><OBR.19>CIRC</OBR.19><OBR.21>DIGH</OBR.21><OBR.27><TQ.6>1</TQ.6></OBR.27><OBR.31><CE.1>Motivo 2</CE.1></OBR.31></OBR></ORM_O01.ORDER_CHOICE><NTE><NTE.3>Notas de prueba.</NTE.3></NTE></ORM_O01.ORDER_DETAIL></ORM_O01.ORDER></ORM_O01>
TEST>set xml = ##class(%Stream.FileCharacter).%New()
TEST>set xml.Filename="C:\Test\ITB\files\2.5_OBX5-ST.hl7.xml"
TEST>set er7=##class(ITB.HL7.Util.Convert).XMLToER7(xml,.sc,"2.5")
TEST>write sc
1
TEST>write er7.OutputToString()
MSH|^~\&|hphis|192.168.2.203|EPIC||20131011093851||ORM^O01|ITM14AAACVDD|P|2.5|||
PID||241900||MAPO0370403001|TEST^TEST^TEST||19740602|M|||BARCELONA^^BARCELONA^8^
PV1|1|||O|||1105^TEST^TEST^TEST~1105|1105^TEST^TEST^TEST~1105||DIGC|||||||1105^T
ORC|NW|2089258||1760391|HD||^^^^^1||20131011093800000|||2214^TEST^LAIA|CIRC|||^R
OBR||2089258||1^INTERTEST||||||^S/I^S/I||||||2214^SERRANO^LAIA|||CIRC||DIGH|||||
OBX|1|ST|4|7|ABCD1234
Healthcare HL7 XML includes different productions in ITB.Production.*
package which can be used to test HL7 XML components in an Interoperability production.
- Reads HL7 XML file, converts to EnsLib.HL7.Message and writes an HL7 ER7 files.
- Reads HL7 ER7 file, converts to EnsLib.HL7.Message and writes an HL7 XML files.
- It's recommended to have this production working correctly before implementing more complex scenarios.
- Shows how to use a WebService (Business Service) that receives an HL7 XML message as an incoming string.
- Reads HL7 XML file, converts to EnsLib.HL7.Message and send it in XML format using HTTP.
- Receives (loopback) the HL7 in XML format through HTTP.
- Reads HL7 XML file, converts to EnsLib.HL7.Message and send it in XML format using TCP.
- Receives HL7 XML messages through TCP.
- Reads HL7 XML file, converts to EnsLib.HL7.Message and send it in XML format using TCP to a service in production.
- Receives HL7 XML messages through TCP (loopback).
This package is an add-on for InterSystems products and does not form part of the official release. InterSystems standard technical assistance will not attend issues related with this package.