Announcement

Collapse

Mirth Connect 3.12.0 Released!

Mirth Connect 3.12.0 is now available as an appliance update and on our GitHub page. This release includes database performance improvements, improves visual HL7 representation, message pruning, keystore handling, PDF generation, community contributions, and fixes several security vulnerabilities. This release also contains many improvements to commercial extensions. 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

transforner error - XML to HL7

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

  • transforner error - XML to HL7

    Have an HL7 message in my database, which I have successfully extracted from the record. By default, Mirth specifies that data from the database reader comes in as XML. But I want to remove the XML encoding from the rawdata coming in.

    Tried using the following in my channel transformer:

    var useStrictParser=false;
    var useStrictValidation=false;
    var handleRepetitions=false;
    SerializerFactory.getHL7Serializer(useStrictParser , useStrictValidation, handleRepetitions).fromXML(messageObject.getRawDat a());

    Also tried with
    var useStrictParser=false;
    var useStrictValidation=false;
    var handleRepetitions=false;

    SerializerFactory.getHL7Serializer(useStrictParser , useStrictValidation, handleRepetitions).fromXML(msg);

    in either case I get the following error:
    ERROR-300: Transformer error
    ERROR MESSAGE: Error evaluating transformer
    java.lang.NullPointerException
    at ca.uhn.hl7v2.parser.XMLParser.supportsEncoding(XML Parser.java:137)
    at ca.uhn.hl7v2.parser.Parser.parse(Parser.java:139)
    at com.webreach.mirth.model.converters.ER7Serializer. fromXML(ER7Serializer.java:137)
    at com.webreach.mirth.model.converters.ER7Serializer. fromXML(ER7Serializer.java:50)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateTransformerScript(JavaScri ptTransformer.java:393)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.transform(JavaScriptTransformer.ja va:278)
    at org.mule.transformers.AbstractEventAwareTransforme r.doTransform(AbstractEventAwareTransformer.java:4 8)
    at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:197)
    at org.mule.impl.MuleEvent.getTransformedMessage(Mule Event.java:251)
    at com.webreach.mirth.server.controllers.MessageObjec tController.getMessageObjectFromEvent(MessageObjec tController.java:460)
    at com.webreach.mirth.server.mule.providers.file.File MessageDispatcher.doDispatch(FileMessageDispatcher .java:73)
    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)

    I have the following raw data coming into my channel on deploying:

    <?xml version="1.0" encoding="UTF-8"?>
    <result>
    <result_hl7>MSH|^~\&amp;|LAB|INT||2117|20070924032 456||ORU^R01|20070924032456093|D|2.3|||||||&#xd;
    PID|1|123123123|||ABC^DEF^L||19050311|F|||line 1^Line 2^line^er^12345|||||||IC72670001|&#xd;
    PV1|1|O||&#xd;
    IN1|1||1|MEDICARE|one^^two^WI^12345||&#xd;
    ORC|RE|IC72670001||100-20070924-1|CM|||||||75-^lname^fname^M^^^^^NPI^^^^||||||||&#xd;
    OBR|1|IC72670001||i33^I HGBA1C^^i33^I HGBA1C|||20070924145751|||||||20070924145753||75^l name^fname^M^^^^^NPI^^^IC72670001|100-20070924-1|||20070924032500|||F|||||||||||||||||||]&#xd;
    OBX|1|NM|i33^I HGBA1C^^i33^I HGBA1C^||100|||H|||F|||20070924032500||||</result_hl7>
    </result>

    How can the hl7 message be extracted?

  • #2
    Re:transforner error - XML to HL7

    paste the above raw data xml into the destination tab in your transformer. Drag the node <result_hl7> into a variable.

    Comment


    • #3
      Re:transforner error - XML to HL7

      Thank you Sween,

      Draged the node <result_hl7> into a variable.
      used the variable 'res' and have it's connector map set to "msg['result_hl7'].toString()" and have "${res}" as my template in the Destination Tab. Now on deploying the channel I get the error:

      ERROR-300: Transformer error
      ERROR MESSAGE: Error evaluating transformer
      java.lang.NullPointerException
      at ca.uhn.hl7v2.parser.XMLParser.supportsEncoding(XML Parser.java:137)
      at ca.uhn.hl7v2.parser.Parser.parse(Parser.java:139)
      at com.webreach.mirth.model.converters.ER7Serializer. fromXML(ER7Serializer.java:137)
      at com.webreach.mirth.model.converters.ER7Serializer. fromXML(ER7Serializer.java:50)
      at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateTransformerScript(JavaScri ptTransformer.java:393)
      at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.transform(JavaScriptTransformer.ja va:278)
      at org.mule.transformers.AbstractEventAwareTransforme r.doTransform(AbstractEventAwareTransformer.java:4 8)
      at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:197)
      at org.mule.impl.MuleEvent.getTransformedMessage(Mule Event.java:251)
      at com.webreach.mirth.server.controllers.MessageObjec tController.getMessageObjectFromEvent(MessageObjec tController.java:460)
      at com.webreach.mirth.server.mule.providers.file.File MessageDispatcher.doDispatch(FileMessageDispatcher .java:73)
      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)


      The RAW message and the TRANSFORMED message in the dashboard status shows

      <?xml version="1.0" encoding="UTF-8"?>
      <result> <result_hl7>MSH|^~\&amp;|LAB|INT||2117|20070925103 655||ORU^R01|20070925103655546|D|2.3PID|1|12312312 3|||ABC^DEF^L||19050311|F|||line 1^Line ^line^er^12345|||||||IC72670001|
      PV1|1|O||
      IN1|1||1|MEDICARE|one^^two^WI^12345||
      ORC|RE|IC72670001||100-20070924-1|CM|||||||75-^lname^fname^M^^^^^NPI^^^^||||||||
      OBR|1|IC72670001||i33^I HGBA1C^^i33^I HGBA1C|||20070924145751|||||||20070924145753||75^l name^fname^M^^^^^NPI^^^IC72670001|100-20070924- 1|||20070924032500|||F|||||||||||||||||||]
      OBX|1|NM|i33^I HGBA1C^^i33^I HGBA1C^||100|||H|||F|||20070924032500||||</result_hl7>
      </result>

      Also the Mappings tab in the Dashboard shows
      1. Value of res to be the HL7 message
      2. And Value of Destination 1 to be "FAILURE: Error evaluating transformer
      NullPointerException
      null"

      I'm using Mirth 1.6

      Comment


      • #4
        Re:transforner error - XML to HL7

        The issue is resolved! I had checked all the three properties in the Destination transformer's Outgoing Data.

        Thanks
        Anna

        Comment


        • #5
          Re:transforner error - XML to HL7

          hmmm... in messing around with this I couldn't seem to do anything without putting CDATA tags within result_hl7 to make it valid XML...
          don't get me wrong, glad to see you fixed it. Just wondering...

          <?xml version="1.0" encoding="UTF-8"?>
          <result> <result_hl7><![CDATA[ MSH|^~& |LAB|INT||2117|20070925103655||ORU^R01|20070925103 655546|D|2.3PID|1|123123123|||ABC^DEF^L||19050311| F|||line 1^Line ^line^er^12345|||||||IC72670001|
          PV1|1|O||
          IN1|1||1|MEDICARE|one^^two^WI^12345||
          ORC|RE|IC72670001||100-20070924-1|CM|||||||75-^lname^fname^M^^^^^NPI^^^^||||||||
          OBR|1|IC72670001||i33^I HGBA1C^^i33^I HGBA1C|||20070924145751|||||||20070924145753||75^l name^fname^M^^^^^NPI^^^IC72670001|100-20070924- 1|||20070924032500|||F|||||||||||||||||||]
          OBX|1|NM|i33^I HGBA1C^^i33^I HGBA1C^||100|||H|||F|||20070924032500||||]]></result_hl7>
          </result>

          Comment


          • #6
            transforner error - XML to HL7

            hi anna,

            i have the same problem as u did,great that its resolved on your end,sadly
            i'm still stuck ..
            Please tell me what is "msg" in the following function..true its the message but in which form has it to be passesd?

            SerializerFactory.getHL7Serializer(useStrictParser , useStrictValidation, handleRepetitions).fromXML(msg);

            please do help..

            Comment

            Working...
            X