Announcement

Collapse
No announcement yet.

Message Builder Error

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

  • Message Builder Error

    I am trying to map XML data to HL7 in an outbound channel. After some success with patient demographic data I tried to map some data into a OBX segment and received the following error:

    org.mozilla.javascript.EcmaError: TypeError: Assignment to lists with more that one item is not supported (bb73ad52-bccf-4158-8cfe-58b355600f06#1)
    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.XMLList.putXMLPrope rty(XMLList.java:374)
    at org.mozilla.javascript.xmlimpl.XMLObjectImpl.ecmaP ut(XMLObjectImpl.java:233)
    at org.mozilla.javascript.ScriptRuntime.setObjectElem (ScriptRuntime.java:1397)
    at org.mozilla.javascript.ScriptRuntime.setObjectElem (ScriptRuntime.java:1389)
    at org.mozilla.javascript.gen.c12._c2(bb73ad52-bccf-4158-8cfe-58b355600f06:1)
    at org.mozilla.javascript.gen.c12.call(bb73ad52-bccf-4158-8cfe-58b355600f06)
    at org.mozilla.javascript.optimizer.OptRuntime.callNa me0(OptRuntime.java:106)
    at org.mozilla.javascript.gen.c12._c0(bb73ad52-bccf-4158-8cfe-58b355600f06:1)
    at org.mozilla.javascript.gen.c12.call(bb73ad52-bccf-4158-8cfe-58b355600f06)
    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.c12.call(bb73ad52-bccf-4158-8cfe-58b355600f06)
    at org.mozilla.javascript.gen.c12.exec(bb73ad52-bccf-4158-8cfe-58b355600f06)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateOutboundTransformerScript( JavaScriptTransformer.java:307)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.doTransform(JavaScriptTransformer. java:174)
    at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:197)
    at org.mule.impl.MuleEvent.getTransformedMessage(Mule Event.java:251)
    at org.mule.providers.file.FileMessageDispatcher.doDi spatch(FileMessageDispatcher.java:74)
    at org.mule.providers.file.FileMessageDispatcher.doSe nd(FileMessageDispatcher.java:220)
    at org.mule.providers.AbstractMessageDispatcher.send( AbstractMessageDispatcher.java:166)
    at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:191)
    at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:130)
    at org.mule.routing.outbound.AbstractOutboundRouter.s end(AbstractOutboundRouter.java:85)
    at org.mule.routing.outbound.FilteringMulticastingRou ter.route(FilteringMulticastingRouter.java:89)
    at org.mule.routing.outbound.OutboundMessageRouter$1. doInTransaction(OutboundMessageRouter.java:78)
    at org.mule.transaction.TransactionTemplate.execute(T ransactionTemplate.java:48)
    at org.mule.routing.outbound.OutboundMessageRouter.ro ute(OutboundMessageRouter.java:82)
    at org.mule.impl.model.DefaultMuleProxy.onCall(Defaul tMuleProxy.java:247)
    at org.mule.impl.model.seda.SedaComponent.doSend(Seda Component.java:209)
    at org.mule.impl.model.AbstractComponent.sendEvent(Ab stractComponent.java:277)
    at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:201)
    at org.mule.routing.inbound.InboundMessageRouter.send (InboundMessageRouter.java:161)
    at org.mule.routing.inbound.InboundMessageRouter.rout e(InboundMessageRouter.java:128)
    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)


    Any idea where I am going wrong?

  • #2
    Re: Message Builder Error

    Can you post your Javascript code?
    Chris Lang

    Comment


    • #3
      Re: Message Builder Error

      I'm not using any javascript steps in my transformer currently...maybe thats my mistake. Here's the XML I am trying to map and the export of my outbound channel. Hope this helps and thanks in advance for any help you can give.

      - <report>
      - <case>
      <caseId>2</caseId>
      <panelName>Panel1</panelName>
      <name>My Case 1</name>
      </case>
      - <patient>
      - <name>
      <lname>smith</lname>
      <fname>michael</fname>
      </name>
      <dob>01.11.2006</dob>
      </patient>
      - <slide>
      <slideId>2</slideId>
      <barcode>19274764</barcode>
      <score>0.70413855888820187</score>
      </slide>
      </report>



      - <com.webreach.mirth.model.Channel>
      <id>85f16526-71c0-4f8d-8fbf-c6dd08cd4d3d</id>
      <name>VTEST1</name>
      <description />
      <enabled>true</enabled>
      <version>1.3.2</version>
      <revision>74</revision>
      <direction>OUTBOUND</direction>
      <protocol>HL7</protocol>
      <mode>ROUTER</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" />
      <property name="charsetEncoding">DEFAULT_ENCODING</property>
      <property name="checkFileAge">0</property>
      <property name="autoDelete">0</property>
      <property name="host">D:/DevProjects/HL7/VIAS/Test</property>
      <property name="fileFilter">simplevias2.xml</property>
      <property name="moveToDirectory" />
      </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">0</property>
      <property name="DataType">File Writer</property>
      <property name="outputPattern">output.hl7</property>
      <property name="template">ER7: ${message.encodedData} XML: ${message.transformedData}</property>
      <property name="host">D:/DevProjects/HL7/MIRTH/Samples/HL7 Messages</property>
      </properties>
      - <transformer>
      - <steps>
      - <com.webreach.mirth.model.Step>
      <sequenceNumber>0</sequenceNumber>
      <name>tmp[&#039;ORM_O01.PATIENT&#039;][&#039;PID&#039;][&#039;PID.5&#039;][&#039;XPN.2&#039;]</name>
      <script>tmp[&#039;ORM_O01.PATIENT&#039;][&#039;PID&#039;][&#039;PID.5&#039;][&#039;XPN.2&#039;] = validate(msg[&#039;patient&#039;][&#039;name&#039;][&#039;lname&#039;]);</script>
      <type>HL7 Message Builder</type>
      - <data class="map">
      - <entry>
      <string>Mapping</string>
      <string>msg[&#039;patient&#039;][&#039;name&#039;][&#039;lname&#039;]</string>
      </entry>
      - <entry>
      <string>Variable</string>
      <string>tmp[&#039;ORM_O01.PATIENT&#039;][&#039;PID&#039;][&#039;PID.5&#039;][&#039;XPN.2&#039;]</string>
      </entry>
      </data>
      </com.webreach.mirth.model.Step>
      - <com.webreach.mirth.model.Step>
      <sequenceNumber>1</sequenceNumber>
      <name>tmp[&#039;ORM_O01.PATIENT&#039;][&#039;PID&#039;][&#039;PID.7&#039;][&#039;TS.1&#039;]</name>
      <script>tmp[&#039;ORM_O01.PATIENT&#039;][&#039;PID&#039;][&#039;PID.7&#039;][&#039;TS.1&#039;] = validate(msg[&#039;patient&#039;][&#039;dob&#039;]);</script>
      <type>HL7 Message Builder</type>
      - <data class="map">
      - <entry>
      <string>Mapping</string>
      <string>msg[&#039;patient&#039;][&#039;dob&#039;]</string>
      </entry>
      - <entry>
      <string>Variable</string>
      <string>tmp[&#039;ORM_O01.PATIENT&#039;][&#039;PID&#039;][&#039;PID.7&#039;][&#039;TS.1&#039;]</string>
      </entry>
      </data>
      </com.webreach.mirth.model.Step>
      - <com.webreach.mirth.model.Step>
      <sequenceNumber>2</sequenceNumber>
      <name>tmp[&#039;ORM_O01.ORDER&#039;][&#039;ORM_O01.ORDER_DETAIL&#039;][&#039;ORM_O01.OBSERVATION&#039;][&#039;OBX&#039;][&#039;OBX.5&#039;]</name>
      <script>tmp[&#039;ORM_O01.ORDER&#039;][&#039;ORM_O01.ORDER_DETAIL&#039;][&#039;ORM_O01.OBSERVATION&#039;][&#039;OBX&#039;][&#039;OBX.5&#039;] = validate(msg[&#039;slide&#039;][&#039;score&#039;]);</script>
      <type>HL7 Message Builder</type>
      - <data class="map">
      - <entry>
      <string>Mapping</string>
      <string>msg[&#039;slide&#039;][&#039;score&#039;]</string>
      </entry>
      - <entry>
      <string>Variable</string>
      <string>tmp[&#039;ORM_O01.ORDER&#039;][&#039;ORM_O01.ORDER_DETAIL&#039;][&#039;ORM_O01.OBSERVATION&#039;][&#039;OBX&#039;][&#039;OBX.5&#039;]</string>
      </entry>
      </data>
      </com.webreach.mirth.model.Step>
      </steps>
      <template>MSH|^~\&|LAB|CCF|||20040920080937||ORM^O 01|42640000009|P|2.3| PID|||56797971||RESULTSREVIEW^TESTPATIENT^||196505 25|M||||||||||56797971| PV1||O|UNKO^||||| ORC|RE||A0203809||IP||||||| OBR|1|A0203809|A0203809|400090^Complete Blood Count|||200609240000|||||||200609240847||deleted^^ ^^MD^^^^^^||||||200609241055|||P OBX|1|ST|40010^White Blood Count (WBC) (x1000)||PENDING||||||P OBX|2|ST|40020^Red Blood Count (RBC)||PENDING||||||P ORC|RE||A0203809||CM||||||| OBR|2|A0203809|A0203809|650300^Depakene (Valproic Acid) Level|||200609240000|||||||200609240847||^deleted^ ^^^MD^^^^^^||||||200609241055|||F OBX|1|NM|65030^Depakene (Valproic Acid) Level||76.8|ug/ml|50-100||||F|||200609241054||</template>
      </transformer>
      - <filter>
      <rules />
      <template />
      </filter>
      <transportName>File Writer</transportName>
      </com.webreach.mirth.model.Connector>
      </destinationConnectors>
      - <properties>
      <property name="initialState">stopped</property>
      <property name="synchronous">true</property>
      <property name="store_messages">true</property>
      <property name="recv_xml_encoded">false</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 return message;</preprocessingScript>
      </com.webreach.mirth.model.Channel>

      Comment


      • #4
        Re: Message Builder Error

        The problem is related to the last mapper step.

        You need to specify which ORM_O01.ORDER group are you refering (there&#039;re two in the message example).

        This has to be done in a JS step. Try:

        tmp[&#039;ORM_O01.ORDER&#039;][i][&#039;ORM_O01.ORDER_DETAIL&#039;][&#039;ORM_O01.OBSERVATION&#039;][&#039;OBX&#039;][&#039;OBX.5&#039;]=msg[&#039;slide&#039;][&#039;score&#039;].toString();

        (With &#039;i&#039; being 0..1)

        Comment


        • #5
          Re: Message Builder Error

          Hi,

          Can you pls explain how to map XML data to HL7 in an outbound channel ?

          From
          kgk_007

          Comment


          • #6
            Re: Message Builder Error

            Thanks for the input...it helped me solve my problem. At first it didn&#039;t work, but then I found another post with a similar issue and changed it as follows:

            tmp[&#039;ORM_O01.ORDER&#039;][&#039;ORM_O01.ORDER_DETAIL&#039;][&#039;ORM_O01.OBSERVATION&#039;][&#039;OBX&#039;][&#039;OBX.5&#039;][i]=msg[&#039;slide&#039;][&#039;score&#039;].toString();

            Moving the [i] to the end of the OBX.5 segment worked.

            Here&#039;s the link to that topic...I will probably have to generate the OBX segments as they do here.

            http://www.mirthproject.org/index.ph...=221&Itemid=63

            Thanks again!

            Comment


            • #7
              Re: Message Builder Error

              Not sure if I&#039;m the best person to answer you&#039;re question, but thought I would let you know some of the "gotchas" i ran into. The file repository here was very helpful as it had some good examples. The template section of the destination was very confusing and I finally discovered the proper syntax by looking at the sample outbound channel.

              Also the discussion of E4X was very helpful as the syntax used in the transformer steps was alien to me. This can be found at:

              http://www.faqts.com/knowledge_base/...phtml/fid/1762

              My test channel uses a file reader for the source which is configured to look at my test xml file as shown in the post above. The destination is a file writer setup to create a file called "output.hl7". The Template section of the destination has the statements:

              ER7: ${message.encodedData}
              XML: ${message.transformedData}

              The first line results in a HL7 steam in the output file. The second line results in the XML encoded output to be included in the file as well. Very handy for testing.

              The destination transformer was confusing at first as i didn&#039;t realize there were different types of transformer steps. This is where the familiarity of E4X really helps. The HL7 Message Builder steps are very useful if you&#039;re XML will map directly to your HL7 template. See the "Getting Started Tutorial" WIKI at:

              http://www.mirthproject.org/index.ph...d=45&Itemid=81

              From the post above you can see that the rest of my mapping will probably need to be done with JavaScript steps.

              Hope this helps....

              Comment

              Working...
              X