Announcement

Collapse

NextGen (Mirth) Connect 3.9.1 Released!

NextGen (Mirth) Connect 3.9.1 is now available as an appliance update and on our GitHub page. This release contains bug fixes and adds support for eHealth Exchange UDDI providers in the Interoperability plugin. See the release notes for the list of fixes and updates.

Download | See What's New | Upgrade Guide | Release Notes

For discussion on this release, see this thread.
See more
See less

how to do XML to HL7?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to do XML to HL7?

    I am trying to do XML to HL7 unsuccessfully. Need some help here. this is my channel I created. I tried to put xsd or dtd or xml for the source, but still did not work. Thank you!

    -------------------------------------------------------
    <com.webreach.mirth.model.Channel>
    <id>523b3e66-fcd0-46b3-8ff1-1d7f1bd7984a</id>
    <name>XML_HL7</name>
    <description></description>
    <enabled>true</enabled>
    <version>1.3.2</version>
    <revision>8</revision>
    <direction>INBOUND</direction>
    <protocol>HL7</protocol>
    <mode>BROADCAST</mode>
    <sourceConnector>
    <name>sourceConnector</name>
    <properties>
    <property name="sortAttribute">date</property>
    <property name="pollingFrequency">1000</property>
    <property name="DataType">File Reader</property>
    <property name="fileAge">0</property>
    <property name="moveToPattern">${ORIGINALNAME}</property>
    <property name="charsetEncoding">DEFAULT_ENCODING</property>
    <property name="checkFileAge">0</property>
    <property name="autoDelete">0</property>
    <property name="host">C:/ADT/XMLSRC</property>
    <property name="fileFilter">*.*</property>
    <property name="moveToDirectory"></property>
    </properties>
    <transformer>
    <steps/>
    </transformer>
    <filter>
    <rules/>
    </filter>
    <transportName>File Reader</transportName>
    </sourceConnector>
    <destinationConnectors>
    <com.webreach.mirth.model.Connector>
    <name>Destination 1</name>
    <properties>
    <property name="charsetEncoding">DEFAULT_ENCODING</property>
    <property name="outputAppend">1</property>
    <property name="DataType">File Writer</property>
    <property name="outputPattern">${message.type}${date.get(&ap os;yyyy-M-d H:m:s&apos}.hl7</property>
    <property name="template">${message.rawData}${message.transf ormedData}${message.encodedData}${message.source}$ {message.type}${message.version}${date.get(&apos;y yyy-M-d H:m:s&apos}${SYSTIME}${ORIGINALNAME}${COUNT}</property>
    <property name="host">C:/ADT/HL7TEST</property>
    </properties>
    <transformer>
    <steps/>
    </transformer>
    <filter>
    <rules/>
    </filter>
    <transportName>File Writer</transportName>
    </com.webreach.mirth.model.Connector>
    </destinationConnectors>
    <properties>
    <property name="initialState">started</property>
    <property name="synchronous">true</property>
    <property name="store_messages">true</property>
    <property name="recv_xml_encoded">true</property>
    <property name="encryptData">false</property>
    <property name="transactional">false</property>
    <property name="max_message_age">-1</property>
    <property name="error_messages_only">false</property>
    </properties>
    <preprocessingScript>// Modify the message variable below to pre process data&#x0D;
    return message;</preprocessingScript>
    </com.webreach.mirth.model.Channel>

    -----------------------
    this is the error I got:
    java.lang.NumberFormatException: For input string: "3.LST"
    at java.lang.NumberFormatException.forInputString(Unk nown Source)
    at java.lang.Integer.parseInt(Unknown Source)
    at java.lang.Integer.parseInt(Unknown Source)
    at ca.uhn.hl7v2.parser.XMLParser.parse(XMLParser.java :307)
    at ca.uhn.hl7v2.parser.DefaultXMLParser.parseRep(Defa ultXMLParser.java:195)
    at ca.uhn.hl7v2.parser.DefaultXMLParser.parseReps(Def aultXMLParser.java:174)
    at ca.uhn.hl7v2.parser.DefaultXMLParser.parse(Default XMLParser.java:160)
    at ca.uhn.hl7v2.parser.DefaultXMLParser.parseDocument (DefaultXMLParser.java:129)
    at ca.uhn.hl7v2.parser.XMLParser.doParse(XMLParser.ja va:215)
    at ca.uhn.hl7v2.parser.Parser.parse(Parser.java:151)
    at com.webreach.mirth.model.converters.ER7Serializer. fromXML(ER7Serializer.java:77)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateInboundTransformerScript(J avaScriptTransformer.java:266)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.doTransform(JavaScriptTransformer. java:170)
    at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:197)
    at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:200)
    at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:200)
    at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:200)
    at org.mule.impl.MuleEvent.getTransformedMessage(Mule Event.java:251)
    at org.mule.routing.inbound.SelectiveConsumer.isMatch (SelectiveConsumer.java:61)
    at org.mule.routing.inbound.InboundMessageRouter.rout e(InboundMessageRouter.java:79)
    at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR eceiver.java:492)
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:271)
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:230)
    at org.mule.providers.file.FileMessageReceiver.proces sFile(FileMessageReceiver.java:183)
    at org.mule.providers.file.FileMessageReceiver.poll(F ileMessageReceiver.java:111)
    at org.mule.providers.PollingMessageReceiver.run(Poll ingMessageReceiver.java:73)
    at org.mule.impl.work.WorkerContext.run(WorkerContext .java:290)
    at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.runTask(ThreadPoolExecutor. java:650)
    at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.run(ThreadPoolExecutor.java :675)
    at java.lang.Thread.run(Unknown Source)

  • #2
    Re: how to do XML to HL7?

    Humb.

    Could you post the XML file yo&#039;re trying to convert ?

    Comment


    • #3
      Re: how to do XML to HL7?

      I tried several files, here are 2 of them:
      1. first one is xsd file
      <?xml version = "1.0" ?>
      <!--
      v2.xml Message Definitions Version v24 - ADT_A01
      Copyright (c) 1999-2004, Health Level Seven. All rights reserved.
      -->
      <xsd:schema
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns="urn:hl7-org:v2xml"
      targetNamespace="urn:hl7-org:v2xml">


      <!-- include segment definitions for version v24 -->
      <xsd:include schemaLocation="segments.xsd"/>

      <!--
      MESSAGE ADT_A01
      -->
      <!-- .. groups used in message ADT_A01 -->
      <xsd:complexType name="ADT_A01.PROCEDURE.CONTENT">
      <xsd:sequence>
      <xsd:element ref="PR1" minOccurs="1" maxOccurs="1" />
      <xsd:element ref="ROL" minOccurs="0" maxOccurs="unbounded" />
      </xsd:sequence>
      </xsd:complexType>
      <xsd:element name="ADT_A01.PROCEDURE" type="ADT_A01.PROCEDURE.CONTENT"/>
      <xsd:complexType name="ADT_A01.INSURANCE.CONTENT">
      <xsd:sequence>
      <xsd:element ref="IN1" minOccurs="1" maxOccurs="1" />
      <xsd:element ref="IN2" minOccurs="0" maxOccurs="1" />
      <xsd:element ref="IN3" minOccurs="0" maxOccurs="unbounded" />
      <xsd:element ref="ROL" minOccurs="0" maxOccurs="unbounded" />
      </xsd:sequence>
      </xsd:complexType>
      <xsd:element name="ADT_A01.INSURANCE" type="ADT_A01.INSURANCE.CONTENT"/>

      <!-- .. message definition ADT_A01 -->
      <xsd:complexType name="ADT_A01.CONTENT">
      <xsd:sequence>
      <xsd:element ref="MSH" minOccurs="1" maxOccurs="1" />
      <xsd:element ref="EVN" minOccurs="1" maxOccurs="1" />
      <xsd:element ref="PID" minOccurs="1" maxOccurs="1" />
      <xsd:element ref="PD1" minOccurs="0" maxOccurs="1" />
      <xsd:element ref="ROL" minOccurs="0" maxOccurs="unbounded" />
      <xsd:element ref="NK1" minOccurs="0" maxOccurs="unbounded" />
      <xsd:element ref="PV1" minOccurs="1" maxOccurs="1" />
      <xsd:element ref="PV2" minOccurs="0" maxOccurs="1" />
      <xsd:element ref="ROL" minOccurs="0" maxOccurs="unbounded" />
      <xsd:element ref="DB1" minOccurs="0" maxOccurs="unbounded" />
      <xsd:element ref="OBX" minOccurs="0" maxOccurs="unbounded" />
      <xsd:element ref="AL1" minOccurs="0" maxOccurs="unbounded" />
      <xsd:element ref="DG1" minOccurs="0" maxOccurs="unbounded" />
      <xsd:element ref="DRG" minOccurs="0" maxOccurs="1" />
      <xsd:element ref="ADT_A01.PROCEDURE" minOccurs="0" maxOccurs="unbounded" />
      <xsd:element ref="GT1" minOccurs="0" maxOccurs="unbounded" />
      <xsd:element ref="ADT_A01.INSURANCE" minOccurs="0" maxOccurs="unbounded" />
      <xsd:element ref="ACC" minOccurs="0" maxOccurs="1" />
      <xsd:element ref="UB1" minOccurs="0" maxOccurs="1" />
      <xsd:element ref="UB2" minOccurs="0" maxOccurs="1" />
      <xsd:element ref="PDA" minOccurs="0" maxOccurs="1" />
      </xsd:sequence>
      </xsd:complexType>
      <xsd:element name="ADT_A01" type="ADT_A01.CONTENT"/>

      </xsd:schema>


      2. second one is xml file
      <ADT_A04>
      <MSH>
      <MSH.1>|</MSH.1>
      <MSH.2>^~\&amp;</MSH.2>
      <MSH.3>
      <HD.1>REGADT</HD.1>
      </MSH.3>
      <MSH.4>
      <HD.1>MCM</HD.1>
      </MSH.4>
      <MSH.5>
      <HD.1>IFENG</HD.1>
      </MSH.5>
      <MSH.7>
      <TS.1>199112311501</TS.1>
      </MSH.7>
      <MSH.9>
      <MSG.1>ADT</MSG.1>
      <MSG.2>A04</MSG.2>
      <MSG.3>ADT_A01</MSG.3>
      </MSH.9>
      <MSH.10>000001</MSH.10>
      <MSH.11>
      <PT.1>P</PT.1>
      </MSH.11>
      <MSH.12>
      <VID.1>2.4</VID.1>
      </MSH.12>
      </MSH>
      <EVN>
      <EVN.1>A04</EVN.1>
      <EVN.2>
      <TS.1>199901011000</TS.1>
      </EVN.2>
      <EVN.3>
      <TS.1>199901011000</TS.1>
      </EVN.3>
      <EVN.4>01</EVN.4>
      <EVN.6>
      <TS.1>199901011010</TS.1>
      </EVN.6>
      </EVN>
      <PID>
      <PID.3.LST>
      <PID.3>
      <CX.1>191919</CX.1>
      <CX.4>
      <HD.1>GENHOS</HD.1>
      </CX.4>
      <CX.5>MR</CX.5>
      </PID.3>
      <PID.3>
      <CX.1>333-66-8888</CX.1>
      <CX.4>
      <HD.1>USSSA</HD.1>
      </CX.4>
      <CX.5>SS</CX.5>
      </PID.3>
      </PID.3.LST>
      <PID.4.LST>
      <PID.4>
      <CX.1>255777</CX.1>
      </PID.4>
      </PID.4.LST>
      <PID.5.LST>
      <PID.5>
      <XPN.1>
      <FN.1>BOND</FN.1>
      </XPN.1>
      <XPN.2>JAMES</XPN.2>
      <XPN.3>J</XPN.3>
      </PID.5>
      </PID.5.LST>
      <PID.7>
      <TS.1>19880808</TS.1>
      </PID.7>
      <PID.8>M</PID.8>
      <PID.11.LST>
      <PID.11>
      <XAD.1>
      <SAD.1>171 ZOO</SAD.1>
      </XAD.1>
      <XAD.3>DURHAM</XAD.3>
      <XAD.4>NC</XAD.4>
      <XAD.5>66688</XAD.5>
      <XAD.6>&quot;&quot;</XAD.6>
      </PID.11>
      </PID.11.LST>
      <PID.13.LST>
      <PID.13>
      <XTN.1>(800)888-1234</XTN.1>
      </PID.13>
      </PID.13.LST>
      <PID.14.LST>
      <PID.14>
      <XTN.1>(800)888-3333</XTN.1>
      </PID.14>
      </PID.14.LST>
      <PID.16>
      <CE.1>S</CE.1>
      <CE.3>HL70002</CE.3>
      </PID.16>
      <PID.17>
      <CE.1>C</CE.1>
      <CE.3>HL70006</CE.3>
      </PID.17>
      <PID.18>
      <CX.1>10111122</CX.1>
      <CX.4>
      <HD.1>GENHOS</HD.1>
      </CX.4>
      <CX.5>AN</CX.5>
      </PID.18>
      <PID.19>333-66-8888</PID.19>
      </PID>
      <ADT_A04.LST.2>
      <NK1>
      <NK1.1>1</NK1.1>
      <NK1.2.LST>
      <NK1.2>
      <XPN.1>
      <FN.1>BOND</FN.1>
      </XPN.1>
      <XPN.2>JENNY</XPN.2>
      </NK1.2>
      </NK1.2.LST>
      <NK1.3>
      <CE.1>SPOUSE</CE.1>
      <CE.3>HL70063</CE.3>
      </NK1.3>
      <NK1.4.LST>
      <NK1.4>
      <XAD.1>
      <SAD.1>171 ZOO</SAD.1>
      </XAD.1>
      <XAD.3>DURHAM</XAD.3>
      <XAD.4>NC</XAD.4>
      <XAD.5>56789</XAD.5>
      <XAD.6>&quot;&quot;</XAD.6>
      </NK1.4>
      </NK1.4.LST>
      <NK1.5.LST>
      <NK1.5>
      <XTN.1>(800)888-8888</XTN.1>
      </NK1.5>
      </NK1.5.LST>
      <NK1.6.LST>
      <NK1.6>
      <XTN.1>(800)888-1234</XTN.1>
      </NK1.6>
      <NK1.6>
      <XTN.1>(800)888-8899</XTN.1>
      </NK1.6>
      </NK1.6.LST>
      <NK1.7>
      <CE.1>EC1</CE.1>
      <CE.2>FIRST EMERGENCY CONTACT</CE.2>
      <CE.4>HL70131</CE.4>
      </NK1.7>
      </NK1>
      <NK1>
      <NK1.1>2</NK1.1>
      <NK1.2.LST>
      <NK1.2>
      <XPN.1>
      <FN.1>BOND</FN.1>
      </XPN.1>
      <XPN.2>RUSSEL</XPN.2>
      </NK1.2>
      </NK1.2.LST>
      <NK1.3>
      <CE.1>FATHER</CE.1>
      <CE.3>HL70008</CE.3>
      </NK1.3>
      <NK1.4.LST>
      <NK1.4>
      <XAD.1>
      <SAD.1>300 ZOO</SAD.1>
      </XAD.1>
      <XAD.3>DURHAM</XAD.3>
      <XAD.4>NC</XAD.4>
      <XAD.5>55666</XAD.5>
      <XAD.6>&quot;&quot;</XAD.6>
      </NK1.4>
      </NK1.4.LST>
      <NK1.5.LST>
      <NK1.5>
      <XTN.1>(800)888-8888</XTN.1>
      </NK1.5>
      </NK1.5.LST>
      <NK1.6.LST>
      <NK1.6>
      <XTN.1>(888)666-1234</XTN.1>
      </NK1.6>
      <NK1.6>
      <XTN.1>(800)666-6600</XTN.1>
      </NK1.6>
      </NK1.6.LST>
      <NK1.7>
      <CE.1>EC2</CE.1>
      <CE.2>SECOND EMERGENCY CONTACT</CE.2>
      <CE.4>HL70111</CE.4>
      </NK1.7>
      </NK1>
      <NK1>
      <NK1.1>3</NK1.1>
      </NK1>
      <NK1>
      <NK1.1>4</NK1.1>
      <NK1.4.LST>
      <NK1.4>
      <XAD.1>
      <SAD.1>123 ZOOGICAL WAY</SAD.1>
      </XAD.1>
      <XAD.3>DURHAM</XAD.3>
      <XAD.4>NC</XAD.4>
      <XAD.5>56777</XAD.5>
      <XAD.6>&quot;&quot;</XAD.6>
      </NK1.4>
      </NK1.4.LST>
      <NK1.6.LST>
      <NK1.6>
      <XTN.1>(800)888-8888</XTN.1>
      </NK1.6>
      </NK1.6.LST>
      <NK1.7>
      <CE.1>EM</CE.1>
      <CE.2>EMPLOYER</CE.2>
      <CE.3>HL70131</CE.3>
      </NK1.7>
      <NK1.8>19990101</NK1.8>
      <NK1.10>PROGRAMMER</NK1.10>
      <NK1.13.LST>
      <NK1.13>
      <XON.1>ACME SOFTWARE COMPANY</XON.1>
      </NK1.13>
      </NK1.13.LST>
      </NK1>
      </ADT_A04.LST.2>
      <PV1>
      <PV1.2>O</PV1.2>
      <PV1.3>
      <PL.1>O/R</PL.1>
      </PV1.3>
      <PV1.7.LST>
      <PV1.7>
      <XCN.1>0555</XCN.1>
      <XCN.2>
      <FN.1>SIMPSON,HOMER</FN.1>
      </XCN.2>
      </PV1.7>
      </PV1.7.LST>
      <PV1.8.LST>
      <PV1.8>
      <XCN.1>0555</XCN.1>
      <XCN.2>
      <FN.1>SIMPSON,HOMER</FN.1>
      </XCN.2>
      </PV1.8>
      </PV1.8.LST>
      <PV1.10>AMB</PV1.10>
      <PV1.17.LST>
      <PV1.17>
      <XCN.1>0148</XCN.1>
      <XCN.2>
      <FN.1>SIMPSON,HOMER</FN.1>
      </XCN.2>
      </PV1.17>
      </PV1.17.LST>
      <PV1.18>S</PV1.18>
      <PV1.19>
      <CX.1>1400</CX.1>
      </PV1.19>
      <PV1.20.LST>
      <PV1.20>
      <FC.1>A</FC.1>
      </PV1.20>
      </PV1.20.LST>
      <PV1.39>GENHOS</PV1.39>
      <PV1.44>
      <TS.1>199901011410</TS.1>
      </PV1.44>
      </PV1>
      <PV2>
      <PV2.8>
      <TS.1>199901011400</TS.1>
      </PV2.8>
      <PV2.33>
      <TS.1>199901011400</TS.1>
      </PV2.33>
      </PV2>
      <ADT_A04.LST.3>
      <ROL>
      <ROL.2>AD</ROL.2>
      <ROL.3>
      <CE.1>CP</CE.1>
      <CE.3>HL70443</CE.3>
      </ROL.3>
      <ROL.4.LST>
      <ROL.4>
      <XCN.1>0148</XCN.1>
      <XCN.2>
      <FN.1>SIMPSON,HOMER</FN.1>
      </XCN.2>
      </ROL.4>
      </ROL.4.LST>
      </ROL>
      </ADT_A04.LST.3>
      <ADT_A04.LST.5>
      <OBX>
      <OBX.2>NM</OBX.2>
      <OBX.3>
      <CE.1>3111-1</CE.1>
      <CE.2>BODY WEIGHT</CE.2>
      <CE.3>LN</CE.3>
      </OBX.3>
      <OBX.5.LST>
      <OBX.5>62</OBX.5>
      </OBX.5.LST>
      <OBX.6>
      <CE.1>KG</CE.1>
      </OBX.6>
      <OBX.11>F</OBX.11>
      </OBX>
      <OBX>
      <OBX.2>NM</OBX.2>
      <OBX.3>
      <CE.1>3137-7</CE.1>
      <CE.2>HEIGHT</CE.2>
      <CE.3>LN</CE.3>
      </OBX.3>
      <OBX.5.LST>
      <OBX.5>190</OBX.5>
      </OBX.5.LST>
      <OBX.6>
      <CE.1>CM</CE.1>
      </OBX.6>
      <OBX.11>F</OBX.11>
      </OBX>
      </ADT_A04.LST.5>
      <ADT_A04.LST.7>
      <DG1>
      <DG1.1>1</DG1.1>
      <DG1.2>19</DG1.2>
      <DG1.4>0815^BIOPSY^ACODE</DG1.4>
      <DG1.6>00</DG1.6>
      </DG1>
      </ADT_A04.LST.7>
      <ADT_A04.LST.10>
      <GT1>
      <GT1.1>1</GT1.1>
      <GT1.3.LST>
      <GT1.3>
      <XPN.1>
      <FN.1>BOND</FN.1>
      </XPN.1>
      <XPN.2>JAMES</XPN.2>
      <XPN.3>&quot;&quot;</XPN.3>
      <XPN.4>&quot;&quot;</XPN.4>
      <XPN.5>&quot;&quot;</XPN.5>
      <XPN.6>&quot;&quot;</XPN.6>
      </GT1.3>
      </GT1.3.LST>
      <GT1.5.LST>
      <GT1.5>
      <XAD.1>
      <SAD.1>171 ZOO</SAD.1>
      </XAD.1>
      <XAD.3>DURHAM</XAD.3>
      <XAD.4>NC</XAD.4>
      <XAD.5>56777</XAD.5>
      <XAD.6>&quot;&quot;</XAD.6>
      </GT1.5>
      </GT1.5.LST>
      <GT1.6.LST>
      <GT1.6>
      <XTN.1>(800)888-8888</XTN.1>
      </GT1.6>
      </GT1.6.LST>
      <GT1.7.LST>
      <GT1.7>
      <XTN.1>(800)888-8888</XTN.1>
      </GT1.7>
      </GT1.7.LST>
      <GT1.11>
      <CE.1>SE</CE.1>
      <CE.2>SELF</CE.2>
      <CE.3>HL70063</CE.3>
      </GT1.11>
      <GT1.12>333-66-8888</GT1.12>
      <GT1.16.LST>
      <GT1.16>
      <XPN.1>
      <FN.1>MOOSES AUTO&#x9;CLINIC</FN.1>
      </XPN.1>
      </GT1.16>
      </GT1.16.LST>
      <GT1.17.LST>
      <GT1.17>
      <XAD.1>
      <SAD.1>171 ZOO</SAD.1>
      </XAD.1>
      <XAD.3>DURHAM</XAD.3>
      <XAD.4>MI</XAD.4>
      <XAD.5>56777</XAD.5>
      <XAD.6>&quot;&quot;</XAD.6>
      </GT1.17>
      </GT1.17.LST>
      <GT1.18.LST>
      <GT1.18>
      <XTN.1>(800)888-8888</XTN.1>
      </GT1.18>
      </GT1.18.LST>
      </GT1>
      </ADT_A04.LST.10>
      <ADT_A04.LST.13>
      <ADT_A04.GRP.2>
      <IN1>
      <IN1.1>0</IN1.1>
      <IN1.2>
      <CE.1>0</CE.1>
      <CE.2>HL70072</CE.2>
      </IN1.2>
      <IN1.3.LST>
      <IN1.3>
      <CX.1>BC1</CX.1>
      </IN1.3>
      </IN1.3.LST>
      <IN1.4.LST>
      <IN1.4>
      <XON.1>BLUE CROSS</XON.1>
      </IN1.4>
      </IN1.4.LST>
      <IN1.5.LST>
      <IN1.5>
      <XAD.1>
      <SAD.1>171 ZOO</SAD.1>
      </XAD.1>
      <XAD.3>DURHAM</XAD.3>
      <XAD.4>M156777</XAD.4>
      <XAD.5>&quot;&quot;</XAD.5>
      </IN1.5>
      </IN1.5.LST>
      <IN1.7.LST>
      <IN1.7>
      <XTN.1>(800)888-8888</XTN.1>
      </IN1.7>
      </IN1.7.LST>
      <IN1.8>90</IN1.8>
      <IN1.14>
      <AUI.1>50 OK</AUI.1>
      </IN1.14>
      </IN1>
      </ADT_A04.GRP.2>
      </ADT_A04.LST.13>
      </ADT_A04>

      Comment


      • #4
        Re: how to do XML to HL7?

        Hello again Julia.

        The problem is that you&#039;re not using HL7/XML valid documents.

        HL7/XML v2.x has their own XSD, defined by HL7 int. which can be found at the next link:

        http://www.hl7.org/Special/Committee...fts/v2xml.html

        Mirth expects a valid HL7/XML, and you can&#039;t post any own-schema.

        Comment


        • #5
          Re: how to do XML to HL7?

          hi, Albert:
          I downloaded the hl7 files from hl7 web site and put in my input file directory.
          What kind of format should I put in the template?
          thanks for your help
          ---------------------------
          this is the error:
          ---------------------------
          org.mozilla.javascript.EcmaError: TypeError: error: Unexpected character encountered (lex state 9): &#039;!&#039; (9e9221fa-8402-4006-ba9f-328659f03dc8#2)
          at org.mozilla.javascript.ScriptRuntime.constructErro r(ScriptRuntime.java:3226)
          at org.mozilla.javascript.ScriptRuntime.constructErro r(ScriptRuntime.java:3216)
          at org.mozilla.javascript.ScriptRuntime.typeError(Scr iptRuntime.java:3232)
          at org.mozilla.javascript.xmlimpl.XML.createFromJS(XM L.java:378)
          at org.mozilla.javascript.xmlimpl.XML.jsConstructor(X ML.java:3050)
          at org.mozilla.javascript.xmlimpl.XMLObjectImpl.execI dCall(XMLObjectImpl.java:546)
          at org.mozilla.javascript.IdFunctionObject.call(IdFun ctionObject.java:124)
          at org.mozilla.javascript.BaseFunction.construct(Base Function.java:310)
          at org.mozilla.javascript.ScriptRuntime.newObject(Scr iptRuntime.java:2067)
          at org.mozilla.javascript.gen.c8._c1(9e9221fa-8402-4006-ba9f-328659f03dc8:2)
          at org.mozilla.javascript.gen.c8.call(9e9221fa-8402-4006-ba9f-328659f03dc8)
          at org.mozilla.javascript.optimizer.OptRuntime.callNa me0(OptRuntime.java:106)
          at org.mozilla.javascript.gen.c8._c0(9e9221fa-8402-4006-ba9f-328659f03dc8:4)
          at org.mozilla.javascript.gen.c8.call(9e9221fa-8402-4006-ba9f-328659f03dc8)
          at org.mozilla.javascript.ContextFactory.doTopCall(Co ntextFactory.java:337)
          at org.mozilla.javascript.ScriptRuntime.doTopCall(Scr iptRuntime.java:2755)
          at org.mozilla.javascript.gen.c8.call(9e9221fa-8402-4006-ba9f-328659f03dc8)
          at org.mozilla.javascript.gen.c8.exec(9e9221fa-8402-4006-ba9f-328659f03dc8)
          at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateFilterScript(JavaScriptTra nsformer.java:210)
          at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.doTransform(JavaScriptTransformer. java:169)
          at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:197)
          at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:200)
          at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:200)
          at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:200)
          at org.mule.impl.MuleEvent.getTransformedMessage(Mule Event.java:251)
          at org.mule.routing.inbound.SelectiveConsumer.isMatch (SelectiveConsumer.java:61)
          at org.mule.routing.inbound.InboundMessageRouter.rout e(InboundMessageRouter.java:79)
          at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR eceiver.java:492)
          at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:271)
          at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:230)
          at org.mule.providers.file.FileMessageReceiver.proces sFile(FileMessageReceiver.java:183)
          at org.mule.providers.file.FileMessageReceiver.poll(F ileMessageReceiver.java:111)
          at org.mule.providers.PollingMessageReceiver.run(Poll ingMessageReceiver.java:73)
          at org.mule.impl.work.WorkerContext.run(WorkerContext .java:290)
          at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.runTask(ThreadPoolExecutor. java:650)
          at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.run(ThreadPoolExecutor.java :675)
          at java.lang.Thread.run(Unknown Source)
          -------------------------
          this is my channel:
          -------------------------
          <com.webreach.mirth.model.Channel>
          <id>523b3e66-fcd0-46b3-8ff1-1d7f1bd7984a</id>
          <name>XML_HL7</name>
          <description></description>
          <enabled>true</enabled>
          <version>1.3.2</version>
          <revision>8</revision>
          <direction>INBOUND</direction>
          <protocol>HL7</protocol>
          <mode>BROADCAST</mode>
          <sourceConnector>
          <name>sourceConnector</name>
          <properties>
          <property name="sortAttribute">date</property>
          <property name="pollingFrequency">1000</property>
          <property name="DataType">File Reader</property>
          <property name="fileAge">0</property>
          <property name="moveToPattern">${ORIGINALNAME}</property>
          <property name="charsetEncoding">DEFAULT_ENCODING</property>
          <property name="checkFileAge">0</property>
          <property name="autoDelete">0</property>
          <property name="host">C:/ADT/XMLSRC</property>
          <property name="fileFilter">*.*</property>
          <property name="moveToDirectory"></property>
          </properties>
          <transformer>
          <steps/>
          </transformer>
          <filter>
          <rules/>
          </filter>
          <transportName>File Reader</transportName>
          </sourceConnector>
          <destinationConnectors>
          <com.webreach.mirth.model.Connector>
          <name>Destination 1</name>
          <properties>
          <property name="charsetEncoding">DEFAULT_ENCODING</property>
          <property name="outputAppend">1</property>
          <property name="DataType">File Writer</property>
          <property name="outputPattern">${message.type}${date.get(&ap os;yyyy-M-d H:m:s&apos}.hl7</property>
          <property name="template">${message.rawData}${message.transf ormedData}${message.encodedData}${message.source}$ {message.type}${message.version}${date.get(&apos;y yyy-M-d H:m:s&apos}${SYSTIME}${ORIGINALNAME}${COUNT}</property>
          <property name="host">C:/ADT/HL7TEST</property>
          </properties>
          <transformer>
          <steps/>
          </transformer>
          <filter>
          <rules/>
          </filter>
          <transportName>File Writer</transportName>
          </com.webreach.mirth.model.Connector>
          </destinationConnectors>
          <properties>
          <property name="initialState">started</property>
          <property name="synchronous">true</property>
          <property name="store_messages">true</property>
          <property name="recv_xml_encoded">true</property>
          <property name="encryptData">false</property>
          <property name="transactional">false</property>
          <property name="max_message_age">-1</property>
          <property name="error_messages_only">false</property>
          </properties>
          <preprocessingScript>// Modify the message variable below to pre process data&#x0D;
          return message;</preprocessingScript>
          </com.webreach.mirth.model.Channel>

          Comment


          • #6
            Re: how to do XML to HL7?

            You might want to wait for 1.4 - it will make this process much easier.
            Chris Lang

            Comment


            • #7
              Re: how to do XML to HL7?

              You&#039;re close Julia:

              1. Define an inbound channel:
              - Source endpont: File Reader
              - Destination endpoint: File Writer (in other directory than the reader)
              2. Mark the "pre-encoded" option for the channel. No transformer is needed
              3. Put an XML/HL7 document into the file reader directory. This document should be valid AGAINST THE XSD from HL7. The XML you posted me was very close, but lacks the namespace and the name of some elements was wrong.
              4. An ER7-HL7 will appear at the file writer directory

              Comment


              • #8
                Re: how to do XML to HL7?

                This is the xml I downloaded from hl7 site and I don&#039;t know how to fix the namespace and element problem.
                Do you have a sample xml that works?
                thanks,
                ---------------------------------------------------------------
                <?xml version = "1.0" ?>
                <!--
                v2.xml Message Definitions Version v24 - ADT_A01
                Copyright (c) 1999-2004, Health Level Seven. All rights reserved.
                -->
                <xsd:schema
                xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns="urn:hl7-org:v2xml"
                targetNamespace="urn:hl7-org:v2xml">


                <!-- include segment definitions for version v24 -->
                <xsd:include schemaLocation="segments.xsd"/>

                <!--
                MESSAGE ADT_A01
                -->
                <!-- .. groups used in message ADT_A01 -->
                <xsd:complexType name="ADT_A01.PROCEDURE.CONTENT">
                <xsd:sequence>
                <xsd:element ref="PR1" minOccurs="1" maxOccurs="1" />
                <xsd:element ref="ROL" minOccurs="0" maxOccurs="unbounded" />
                </xsd:sequence>
                </xsd:complexType>
                <xsd:element name="ADT_A01.PROCEDURE" type="ADT_A01.PROCEDURE.CONTENT"/>
                <xsd:complexType name="ADT_A01.INSURANCE.CONTENT">
                <xsd:sequence>
                <xsd:element ref="IN1" minOccurs="1" maxOccurs="1" />
                <xsd:element ref="IN2" minOccurs="0" maxOccurs="1" />
                <xsd:element ref="IN3" minOccurs="0" maxOccurs="unbounded" />
                <xsd:element ref="ROL" minOccurs="0" maxOccurs="unbounded" />
                </xsd:sequence>
                </xsd:complexType>
                <xsd:element name="ADT_A01.INSURANCE" type="ADT_A01.INSURANCE.CONTENT"/>

                <!-- .. message definition ADT_A01 -->
                <xsd:complexType name="ADT_A01.CONTENT">
                <xsd:sequence>
                <xsd:element ref="MSH" minOccurs="1" maxOccurs="1" />
                <xsd:element ref="EVN" minOccurs="1" maxOccurs="1" />
                <xsd:element ref="PID" minOccurs="1" maxOccurs="1" />
                <xsd:element ref="PD1" minOccurs="0" maxOccurs="1" />
                <xsd:element ref="ROL" minOccurs="0" maxOccurs="unbounded" />
                <xsd:element ref="NK1" minOccurs="0" maxOccurs="unbounded" />
                <xsd:element ref="PV1" minOccurs="1" maxOccurs="1" />
                <xsd:element ref="PV2" minOccurs="0" maxOccurs="1" />
                <xsd:element ref="ROL" minOccurs="0" maxOccurs="unbounded" />
                <xsd:element ref="DB1" minOccurs="0" maxOccurs="unbounded" />
                <xsd:element ref="OBX" minOccurs="0" maxOccurs="unbounded" />
                <xsd:element ref="AL1" minOccurs="0" maxOccurs="unbounded" />
                <xsd:element ref="DG1" minOccurs="0" maxOccurs="unbounded" />
                <xsd:element ref="DRG" minOccurs="0" maxOccurs="1" />
                <xsd:element ref="ADT_A01.PROCEDURE" minOccurs="0" maxOccurs="unbounded" />
                <xsd:element ref="GT1" minOccurs="0" maxOccurs="unbounded" />
                <xsd:element ref="ADT_A01.INSURANCE" minOccurs="0" maxOccurs="unbounded" />
                <xsd:element ref="ACC" minOccurs="0" maxOccurs="1" />
                <xsd:element ref="UB1" minOccurs="0" maxOccurs="1" />
                <xsd:element ref="UB2" minOccurs="0" maxOccurs="1" />
                <xsd:element ref="PDA" minOccurs="0" maxOccurs="1" />
                </xsd:sequence>
                </xsd:complexType>
                <xsd:element name="ADT_A01" type="ADT_A01.CONTENT"/>

                </xsd:schema>

                Comment


                • #9
                  Re: how to do XML to HL7?

                  Julia, the file you&#039;re posting is an XSD: an XSD defines how to build a VALID XML. You can&#039;t input a XSD into Mirth.

                  To build a VALID HL7 XML, I can suggest some steps:

                  1. Use an XML editor (Oxygen, XMLSpy, Etc....)
                  2. Create, into the XML Editor a new XML, using one of the XSD from XML. The file should be valid.
                  3. The XML generated should be valid.

                  Another way for getting a XML/HL7 valid:

                  1. Create a new channel: reader endpoint: File Reader. Writer endpoint: file writer.
                  2. At the file writter telplate use the tranformed message.
                  3. Put aN ER7 message in the file reder, you should get an ER7 as an output.

                  Comment


                  • #10
                    Re: how to do XML to HL7?

                    Mirth 1.4 should fix this problem for you if you send in the XML file (not XSD). Set the source as XML, and turn off Strict Parsing in the transformers. Good Luck!

                    Jacob
                    Jacob Brauer
                    Director, Software Development
                    NextGen Healthcare

                    sigpic

                    Comment


                    • #11
                      Re: how to do XML to HL7?

                      Thank you, all!
                      I used oxygen to create my xml file.
                      mirth 1.4 does work to make "xml to hl7".

                      Julia

                      Comment


                      • #12
                        Re: how to do XML to HL7?

                        Hi julia,
                        I&#039;m Anthonette. We almost had the same problem in converting XML to HL7 message. How did you finally make it? Can you please give me some hints.. ? I did several mappings but I really cannot have an HL7 output... Can you please please send to me a sample xml of your channel so I could have a clue on how you did it?? The truth is: I&#039;m assigned to evaluate Mirth 1.4 for my requirements in OJT. I cannot do this unless I can make Mirth work. I will really appreciate it much if you could help me. Thank you! I&#039;ll wait..


                        Tonet
                        Tonet

                        Comment

                        Working...
                        X