Announcement

Collapse

Mirth Connect 4.3.0 Released!

Mirth Connect 4.3.0 is now available as an appliance update and on our GitHub page.

This is a major release containing new features like adding new functionality to the Mirth Connect Setup Wizard, adding the ability for resource and channel-specific classloaders to load child-first or parent-first, and added a default implementation of the getObjectsForSwaggerExamples() method in the ServicePlugin class. This release also contains enhancements for the Mirth Connect Administrator Launcher, the Mirth Connect Docker images, and several bug fixes and security improvements.

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

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

Retrieve HL7 XML messages from DB and send over MLLP Problem

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

  • Retrieve HL7 XML messages from DB and send over MLLP Problem

    Hi,

    I am using Mirth v1.2 on Windows environment.

    The scenario is:
    4 HL7 messages stored in DB for replay purpose.

    I setup a DB reader to read those records.

    The MLLP sender shall deliver the HL7 messages in sequence.

    Problem:
    The first message got delivered for all four messages.

    I checked the Channel status in the admin client and found:
    (1) the 'Raw Messages' are correct.
    (2) the 'Transformed Messages' are wrong. The first message was associated with the 2nd, 3rd and 4th messages.

    I guesses the 1st 'Transformed message' is cached somehow and got reused for later coming messages.

    Please help.

    Thanks,

    Charles

  • #2
    Re: Retrieve HL7 XML messages from DB and send over MLLP Problem

    Here is the channel xml file.

    <com.webreach.mirth.model.Channel>
    <id>6b5ec6e8-c1dd-472a-a69a-c7840da8486c</id>
    <name>AffinityReplay</name>
    <description></description>
    <enabled>true</enabled>
    <version>1.2.0</version>
    <revision>0</revision>
    <direction>OUTBOUND</direction>
    <protocol>HL7</protocol>
    <mode>ROUTER</mode>
    <sourceConnector>
    <name>sourceConnector</name>
    <properties>
    <property name="pollingFrequency">5000</property>
    <property name="username">root</property>
    <property name="DataType">Database Reader</property>
    <property name="useAck">1</property>
    <property name="URL">jdbc:mysql://localhost:3306/msgrpt</property>
    <property name="query">SELECT msgid,HL7XML FROM inbound where sendstatus = &apos;N&apos; and interface = &apos;Affinity&apos; and buildnum = &apos;111&apos; order by msgid limit 1;</property>
    <property name="password">h0557ee</property>
    <property name="host">query</property>
    <property name="driver">com.mysql.jdbc.Driver</property>
    <property name="ack">update inbound set sendstatus = &apos;sent&apos; where msgid = ${msgid};</property>
    </properties>
    <transformer>
    <steps/>
    </transformer>
    <filter>
    <rules/>
    </filter>
    <transportName>Database Reader</transportName>
    </sourceConnector>
    <destinationConnectors>
    <com.webreach.mirth.model.Connector>
    <name>AffinityReplay</name>
    <properties>
    <property name="tcpProtocolClassName">org.mule.providers.tcp .protocols.LlpProtocol</property>
    <property name="segmentEnd">0x0D</property>
    <property name="messageEnd">0x1C</property>
    <property name="keepSendSocketOpen">1</property>
    <property name="bufferSize">65536</property>
    <property name="port">6663</property>
    <property name="sendTimeout">5000</property>
    <property name="messageStart">0x0B</property>
    <property name="maxRetryCount">50</property>
    <property name="charEncoding">hex</property>
    <property name="DataType">LLP Sender</property>
    <property name="recordSeparator">0x0D</property>
    <property name="host">127.0.0.1</property>
    </properties>
    <transformer>
    <steps/>
    <template>MSH|^~\&amp;|REG|CH||CWHC|20060326152615 ||ADT^A01|9328990|P|2.2&#x0D;EVN|A01|2006032615261 5|||IB&#x0D;PID|||1167185|00645433|LASTNAME1^FIRST NAME1||19000101|M|||1 1ST ST^^DUNCAN^BC^A1A 1A1||(555)555-5555||ENGL|S||3646137|1111 111 111&#x0D;NK1|1|LASTNAME1^FIRSTNAME2|MO|1 1ST ST^^DUNCAN^BC^A1A 1A1|(555)555-5555&#x0D;NK1|2|LASTNAME1^FIRSTNAME3|FA|1 1ST ST^^DUNCAN^BC^A1A 1A1|(555)555-5555&#x0D;PV1||I|3F^11^A|2||||19760^LASTNAME4^FIRS TNAME4^M.||GII||||1|||22609^LASTNAME5^FIRSTNAME5|M ED|4058608|PRO|||||||||N||||||||||||A|||2000010101 0101&#x0D;PV2||1|COMMENT 1, COMMENT 2, COMMENT 3&#x0D;DG1|000|I9|&quot;&quot;|||AD&#x0D;IN1|1||BC HP|BC HOSPITAL PROGRAMS||||||||||||LASTNAME1^FIRSTNAME2|03||1 1ST ST^^DUNCAN^BC^A1A 1A1||||||||Y||||||||||||||||F&#x0D;IN1|2||SELF|SEL F PAY||||||||||||LASTNAME1^FIRSTNAME1|01|19000101||| ||||||Y||||||||||||||||M&#x0D;IN2||1111 111 111&#x0D;ZIB|1|M|LASTNAME1^FIRSTNAME1^M|19000101|| |||||||||||||||||BCHP&#x0D;ZIB|2|SP||||||||||||||| ||||||SELF&#x0D;Z01||||||||||||3:24 PM|COMMENT 1, COMMENT 2, COMMENT 3|||000000||||N&#x0D;ZTM||||N|||||YES|NO||||NO|N|1 9760^LASTNAME4^FIRSTNAME4^M.|NO|N|N||NO</template>
    </transformer>
    <filter>
    <rules/>
    </filter>
    <transportName>LLP Sender</transportName>
    </com.webreach.mirth.model.Connector>
    </destinationConnectors>
    <properties>
    <property name="initialState">started</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


    • #3
      Re: Retrieve HL7 XML messages from DB and send over MLLP Problem

      Outbound uses the template you specify as the outgoing message. It is designed so that you can apply transformations to the template based on the data you read in.

      In your scenario you&#039;d like to override this functionality. You can achieve this by including the following Javascript transformer step:

      Code:
      tmp = msg;
      That will set the template variable to whatever is read in from the database. Now you might run into issues if the HL7 XML format doesn&#039;t match the format HAPI expects. Is it possible to have ER7 formatted HL7 database rather than XML? Give the XML way a try but let us know if you get errors, there are a few things we can try.

      -Chris
      Chris Lang

      Comment


      • #4
        Re: Retrieve HL7 XML messages from DB and send over MLLP Problem

        Chris,

        It is one step further then the previous result. The &#039;TransformedData&#039; reflected the actual data now. However, I got errors as following.

        com.webreach.mirth.model.converters.SerializerExce ption: ca.uhn.hl7v2.HL7Exception: Can&#039;t encode message: MSH-1 (field separator) is missing
        at com.webreach.mirth.model.converters.ER7Serializer. fromXML(ER7Serializer.java:79)
        at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateOutboundTransformerScript( JavaScriptTransformer.java:359)
        at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.doTransform(JavaScriptTransformer. java:178)
        at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:197)
        at org.mule.impl.MuleEvent.getTransformedMessage(Mule Event.java:251)
        at org.mule.providers.tcp.TcpMessageDispatcher.doDisp atch(TcpMessageDispatcher.java:87)
        at org.mule.providers.AbstractMessageDispatcher$Worke r.run(AbstractMessageDispatcher.java:257)
        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)
        Caused by: ca.uhn.hl7v2.HL7Exception: Can&#039;t encode message: MSH-1 (field separator) is missing
        at ca.uhn.hl7v2.parser.PipeParser.doEncode(PipeParser .java:483)
        at ca.uhn.hl7v2.parser.Parser.encode(Parser.java:221)
        at com.webreach.mirth.model.converters.ER7Serializer. fromXML(ER7Serializer.java:77)
        ... 10 more



        Here is the data in TransformedData:

        <result xmlns="urn:hl7-org:v2xml">
        <hl7xml><![CDATA[<ADT_A02 xmlns="urn:hl7-org:v2xml"><MSH><MSH.1>|</MSH.1><MSH.2>^~\&amp;</MSH.2><MSH.3>REG</MSH.3><MSH.4>WH</MSH.4><MSH.6>CWHC</MSH.6><MSH.7><TS.1>20060201000926</TS.1></MSH.7><MSH.9><CM_MSG.1>ADT</CM_MSG.1><CM_MSG.2>A02</CM_MSG.2></MSH.9><MSH.10>9061506</MSH.10><MSH.11>P</MSH.11><MSH.12>2.2</MSH.12></MSH><EVN><EVN.1>A02</EVN.1><EVN.2><TS.1>20060201000926</TS.1></EVN.2><EVN.5>CCX</EVN.5></EVN><PID><PID.3><CM_PAT_ID.1>1333999</CM_PAT_ID.1></PID.3><PID.5><PN.1>LASTNAME15</PN.1><PN.2>FIRSTNAME15</PN.2></PID.5><PID.7><TS.1>19000101</TS.1></PID.7><PID.8>F</PID.8><PID.11><AD.1>3 1ST ST</AD.1><AD.3>PORT COQUITLAM</AD.3><AD.4>BC</AD.4><AD.5>A1A 1A1</AD.5></PID.11><PID.13>(555)555-5555</PID.13><PID.16>M</PID.16><PID.18><CK.1>3603977</CK.1></PID.18><PID.19>3333 111 111</PID.19></PID><PV1><PV1.2>I</PV1.2><PV1.3><CM_INTERNAL_LOCATION.1>DS</CM_INTERNAL_LOCATION.1><CM_INTERNAL_LOCATION.2>DS1 0</CM_INTERNAL_LOCATION.2><CM_INTERNAL_LOCATION.3>10</CM_INTERNAL_LOCATION.3></PV1.3><PV1.4>E</PV1.4><PV1.6><CM_INTERNAL_LOCATION.1>DSO</CM_INTERNAL_LOCATION.1><CM_INTERNAL_LOCATION.2>LD0 3</CM_INTERNAL_LOCATION.2><CM_INTERNAL_LOCATION.3>03</CM_INTERNAL_LOCATION.3></PV1.6><PV1.10>OBS</PV1.10><PV1.14>1</PV1.14><PV1.17><CN.1>10236</CN.1><CN.2>LASTNAME16</CN.2><CN.3>FIRSTNAME16</CN.3><CN.4>M</CN.4></PV1.17><PV1.18>OB</PV1.18><PV1.19><CM_PAT_ID.1>4007467</CM_PAT_ID.1></PV1.19><PV1.20><CM_FINANCE.1>PRO</CM_FINANCE.1></PV1.20><PV1.29>N</PV1.29><PV1.41>A</PV1.41><PV1.44><TS.1>20000101010101</TS.1></PV1.44></PV1><PV2><PV2.2><CE.1>LDR</CE.1></PV2.2><PV2.3><CE.1>WALKING</CE.1></PV2.3></PV2><OBX/><ZIB><ZIB.1>1</ZIB.1><ZIB.2>M</ZIB.2><ZIB.23>BCHP</ZIB.23></ZIB><ZIB><ZIB.1>2</ZIB.1><ZIB.2>SP</ZIB.2><ZIB.23>SELF</ZIB.23></ZIB><Z01><Z01.10>1</Z01.10><Z01.12>4:28 PM</Z01.12><Z01.13>WALKING</Z01.13><Z01.16>000000</Z01.16><Z01.20>N</Z01.20></Z01><ZTM><ZTM.2>1</ZTM.2><ZTM.4>N</ZTM.4><ZTM.9>YES</ZTM.9><ZTM.10>NO</ZTM.10><ZTM.14>YES</ZTM.14><ZTM.15>N</ZTM.15><ZTM.17>NO</ZTM.17><ZTM.18>D</ZTM.18><ZTM.19>D</ZTM.19><ZTM.20>NO</ZTM.20><ZTM.21>NO</ZTM.21></ZTM></ADT_A02>]]></hl7xml>
        </result>

        #################################

        Here is the Raw Data:

        <?xml version="1.0" encoding="UTF-8"?>
        <result>
        <hl7xml>&lt;ADT_A02 xmlns="urn:hl7-org:v2xml"&gt;&#xd;
        &lt;MSH&gt;&#xd;
        &lt;MSH.1&gt;|&lt;/MSH.1&gt;&#xd;
        &lt;MSH.2&gt;^~\&amp;amp;&lt;/MSH.2&gt;&#xd;
        &lt;MSH.3&gt;REG&lt;/MSH.3&gt;&#xd;
        &lt;MSH.4&gt;WH&lt;/MSH.4&gt;&#xd;
        &lt;MSH.6&gt;CWHC&lt;/MSH.6&gt;&#xd;
        &lt;MSH.7&gt;&#xd;
        &lt;TS.1&gt;20060201000926&lt;/TS.1&gt;&#xd;
        &lt;/MSH.7&gt;&#xd;
        &lt;MSH.9&gt;&#xd;
        &lt;CM_MSG.1&gt;ADT&lt;/CM_MSG.1&gt;&#xd;
        &lt;CM_MSG.2&gt;A02&lt;/CM_MSG.2&gt;&#xd;
        &lt;/MSH.9&gt;&#xd;
        &lt;MSH.10&gt;9061506&lt;/MSH.10&gt;&#xd;
        &lt;MSH.11&gt;P&lt;/MSH.11&gt;&#xd;
        &lt;MSH.12&gt;2.2&lt;/MSH.12&gt;&#xd;
        &lt;/MSH&gt;&#xd;
        &lt;EVN&gt;&#xd;
        &lt;EVN.1&gt;A02&lt;/EVN.1&gt;&#xd;
        &lt;EVN.2&gt;&#xd;
        &lt;TS.1&gt;20060201000926&lt;/TS.1&gt;&#xd;
        &lt;/EVN.2&gt;&#xd;
        &lt;EVN.5&gt;CCX&lt;/EVN.5&gt;&#xd;
        &lt;/EVN&gt;&#xd;
        &lt;PID&gt;&#xd;
        &lt;PID.3&gt;&#xd;
        &lt;CM_PAT_ID.1&gt;1333999&lt;/CM_PAT_ID.1&gt;&#xd;
        &lt;/PID.3&gt;&#xd;
        &lt;PID.5&gt;&#xd;
        &lt;PN.1&gt;LASTNAME15&lt;/PN.1&gt;&#xd;
        &lt;PN.2&gt;FIRSTNAME15&lt;/PN.2&gt;&#xd;
        &lt;/PID.5&gt;&#xd;
        &lt;PID.7&gt;&#xd;
        &lt;TS.1&gt;19000101&lt;/TS.1&gt;&#xd;
        &lt;/PID.7&gt;&#xd;
        &lt;PID.8&gt;F&lt;/PID.8&gt;&#xd;
        &lt;PID.11&gt;&#xd;
        &lt;AD.1&gt;3 1ST ST&lt;/AD.1&gt;&#xd;
        &lt;AD.3&gt;PORT COQUITLAM&lt;/AD.3&gt;&#xd;
        &lt;AD.4&gt;BC&lt;/AD.4&gt;&#xd;
        &lt;AD.5&gt;A1A 1A1&lt;/AD.5&gt;&#xd;
        &lt;/PID.11&gt;&#xd;
        &lt;PID.13&gt;(555)555-5555&lt;/PID.13&gt;&#xd;
        &lt;PID.16&gt;M&lt;/PID.16&gt;&#xd;
        &lt;PID.18&gt;&#xd;
        &lt;CK.1&gt;3603977&lt;/CK.1&gt;&#xd;
        &lt;/PID.18&gt;&#xd;
        &lt;PID.19&gt;3333 111 111&lt;/PID.19&gt;&#xd;
        &lt;/PID&gt;&#xd;
        &lt;PV1&gt;&#xd;
        &lt;PV1.2&gt;I&lt;/PV1.2&gt;&#xd;
        &lt;PV1.3&gt;&#xd;
        &lt;CM_INTERNAL_LOCATION.1&gt;DS&lt;/CM_INTERNAL_LOCATION.1&gt;&#xd;
        &lt;CM_INTERNAL_LOCATION.2&gt;DS10&lt;/CM_INTERNAL_LOCATION.2&gt;&#xd;
        &lt;CM_INTERNAL_LOCATION.3&gt;10&lt;/CM_INTERNAL_LOCATION.3&gt;&#xd;
        &lt;/PV1.3&gt;&#xd;
        &lt;PV1.4&gt;E&lt;/PV1.4&gt;&#xd;
        &lt;PV1.6&gt;&#xd;
        &lt;CM_INTERNAL_LOCATION.1&gt;DSO&lt;/CM_INTERNAL_LOCATION.1&gt;&#xd;
        &lt;CM_INTERNAL_LOCATION.2&gt;LD03&lt;/CM_INTERNAL_LOCATION.2&gt;&#xd;
        &lt;CM_INTERNAL_LOCATION.3&gt;03&lt;/CM_INTERNAL_LOCATION.3&gt;&#xd;
        &lt;/PV1.6&gt;&#xd;
        &lt;PV1.10&gt;OBS&lt;/PV1.10&gt;&#xd;
        &lt;PV1.14&gt;1&lt;/PV1.14&gt;&#xd;
        &lt;PV1.17&gt;&#xd;
        &lt;CN.1&gt;10236&lt;/CN.1&gt;&#xd;
        &lt;CN.2&gt;LASTNAME16&lt;/CN.2&gt;&#xd;
        &lt;CN.3&gt;FIRSTNAME16&lt;/CN.3&gt;&#xd;
        &lt;CN.4&gt;M&lt;/CN.4&gt;&#xd;
        &lt;/PV1.17&gt;&#xd;
        &lt;PV1.18&gt;OB&lt;/PV1.18&gt;&#xd;
        &lt;PV1.19&gt;&#xd;
        &lt;CM_PAT_ID.1&gt;4007467&lt;/CM_PAT_ID.1&gt;&#xd;
        &lt;/PV1.19&gt;&#xd;
        &lt;PV1.20&gt;&#xd;
        &lt;CM_FINANCE.1&gt;PRO&lt;/CM_FINANCE.1&gt;&#xd;
        &lt;/PV1.20&gt;&#xd;
        &lt;PV1.29&gt;N&lt;/PV1.29&gt;&#xd;
        &lt;PV1.41&gt;A&lt;/PV1.41&gt;&#xd;
        &lt;PV1.44&gt;&#xd;
        &lt;TS.1&gt;20000101010101&lt;/TS.1&gt;&#xd;
        &lt;/PV1.44&gt;&#xd;
        &lt;/PV1&gt;&#xd;
        &lt;PV2&gt;&#xd;
        &lt;PV2.2&gt;&#xd;
        &lt;CE.1&gt;LDR&lt;/CE.1&gt;&#xd;
        &lt;/PV2.2&gt;&#xd;
        &lt;PV2.3&gt;&#xd;
        &lt;CE.1&gt;WALKING&lt;/CE.1&gt;&#xd;
        &lt;/PV2.3&gt;&#xd;
        &lt;/PV2&gt;&#xd;
        &lt;OBX/&gt;&#xd;
        &lt;ZIB&gt;&#xd;
        &lt;ZIB.1&gt;1&lt;/ZIB.1&gt;&#xd;
        &lt;ZIB.2&gt;M&lt;/ZIB.2&gt;&#xd;
        &lt;ZIB.23&gt;BCHP&lt;/ZIB.23&gt;&#xd;
        &lt;/ZIB&gt;&#xd;
        &lt;ZIB&gt;&#xd;
        &lt;ZIB.1&gt;2&lt;/ZIB.1&gt;&#xd;
        &lt;ZIB.2&gt;SP&lt;/ZIB.2&gt;&#xd;
        &lt;ZIB.23&gt;SELF&lt;/ZIB.23&gt;&#xd;
        &lt;/ZIB&gt;&#xd;
        &lt;Z01&gt;&#xd;
        &lt;Z01.10&gt;1&lt;/Z01.10&gt;&#xd;
        &lt;Z01.12&gt;4:28 PM&lt;/Z01.12&gt;&#xd;
        &lt;Z01.13&gt;WALKING&lt;/Z01.13&gt;&#xd;
        &lt;Z01.16&gt;000000&lt;/Z01.16&gt;&#xd;
        &lt;Z01.20&gt;N&lt;/Z01.20&gt;&#xd;
        &lt;/Z01&gt;&#xd;
        &lt;ZTM&gt;&#xd;
        &lt;ZTM.2&gt;1&lt;/ZTM.2&gt;&#xd;
        &lt;ZTM.4&gt;N&lt;/ZTM.4&gt;&#xd;
        &lt;ZTM.9&gt;YES&lt;/ZTM.9&gt;&#xd;
        &lt;ZTM.10&gt;NO&lt;/ZTM.10&gt;&#xd;
        &lt;ZTM.14&gt;YES&lt;/ZTM.14&gt;&#xd;
        &lt;ZTM.15&gt;N&lt;/ZTM.15&gt;&#xd;
        &lt;ZTM.17&gt;NO&lt;/ZTM.17&gt;&#xd;
        &lt;ZTM.18&gt;D&lt;/ZTM.18&gt;&#xd;
        &lt;ZTM.19&gt;D&lt;/ZTM.19&gt;&#xd;
        &lt;ZTM.20&gt;NO&lt;/ZTM.20&gt;&#xd;
        &lt;ZTM.21&gt;NO&lt;/ZTM.21&gt;&#xd;
        &lt;/ZTM&gt;&#xd;
        &lt;/ADT_A02&gt;</hl7xml>
        </result>


        Thanks a lot.

        Charles

        Comment


        • #5
          Re: Retrieve HL7 XML messages from DB and send over MLLP Problem

          Ok I see the issue.

          Try:

          Code:
          tmp = msg[&#039;result&#039;][&#039;hl7xml&#039;];
          or

          Code:
          tmp = msg[&#039;hl7xml&#039;];
          Chris Lang

          Comment


          • #6
            Re: Retrieve HL7 XML messages from DB and send over MLLP Problem

            Hi Chris,

            I tried the "tmp = msg[&#039;result&#039;][&#039;hl7xml&#039;];". It did not work. No transformed data shown in the GUI nor error. Just nothing.

            Then tmp = msg[&#039;hl7xml&#039;]; Sometimes it works; most of time I have errors as following.

            com.webreach.mirth.model.converters.SerializerExce ption: ca.uhn.hl7v2.HL7Exception: Encoding characters &#039;^~&&#039; invalid -- must be 4 characters

            Any idea?

            Thanks,

            Charles

            Comment


            • #7
              Re: Retrieve HL7 XML messages from DB and send over MLLP Problem

              Hi Chris,
              Here is the error message from the log.

              ERROR 2006-12-15 10:12:11,656 [6b5ec6e8-c1dd-472a-a69a-c7840da8486c_destination_1_connector.dispatcher.4] org.mule.impl.DefaultComponentExceptionStrategy: Caught exception in Exception Strategy for: 6b5ec6e8-c1dd-472a-a69a-c7840da8486c: org.mule.umo.transformer.TransformerException: ca.uhn.hl7v2.HL7Exception: Encoding characters &#039;^~&&#039; invalid -- must be 4 characters (com.webreach.mirth.model.converters.SerializerExc eption)
              org.mule.umo.transformer.TransformerException: ca.uhn.hl7v2.HL7Exception: Encoding characters &#039;^~&&#039; invalid -- must be 4 characters (com.webreach.mirth.model.converters.SerializerExc eption)
              at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateOutboundTransformerScript( JavaScriptTransformer.java:377)
              at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.doTransform(JavaScriptTransformer. java:178)
              at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:197)
              at org.mule.impl.MuleEvent.getTransformedMessage(Mule Event.java:251)
              at org.mule.providers.tcp.TcpMessageDispatcher.doDisp atch(TcpMessageDispatcher.java:87)
              at org.mule.providers.AbstractMessageDispatcher$Worke r.run(AbstractMessageDispatcher.java:257)
              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)
              Caused by: com.webreach.mirth.model.converters.SerializerExce ption: ca.uhn.hl7v2.HL7Exception: Encoding characters &#039;^~&&#039; invalid -- must be 4 characters
              at com.webreach.mirth.model.converters.ER7Serializer. fromXML(ER7Serializer.java:79)
              at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateOutboundTransformerScript( JavaScriptTransformer.java:359)
              ... 9 more
              Caused by: ca.uhn.hl7v2.HL7Exception: Encoding characters &#039;^~&&#039; invalid -- must be 4 characters
              at ca.uhn.hl7v2.parser.PipeParser.doEncode(PipeParser .java:495)
              at ca.uhn.hl7v2.parser.Parser.encode(Parser.java:221)
              at com.webreach.mirth.model.converters.ER7Serializer. fromXML(ER7Serializer.java:77)
              ... 10 more

              Comment


              • #8
                Re: Retrieve HL7 XML messages from DB and send over MLLP Problem

                Chris,

                I think there is a bug in the process to save the original HL7 transformed data into database. That dropped the &#039;\&#039; character.

                MSH-2, ^~\&, is translated into <MSH.2>^~&amp;</MSH.2>.

                Thanks,

                Charles

                Comment


                • #9
                  Re: Retrieve HL7 XML messages from DB and send over MLLP Problem

                  Chris,

                  How can I replace the original <MSH.2>, "^~&amp;", to "^~\&amp;"?

                  Thanks,

                  Charles

                  Comment


                  • #10
                    Re: Retrieve HL7 XML messages from DB and send over MLLP Problem

                    The problem is serializing \ and & in XML/ER7. You can try having your preprocessor script convert \& to \\& but I&#039;m not sure if that will work.

                    What does the MSH.2 field look like in the original XML from the database?
                    Chris Lang

                    Comment

                    Working...
                    X