Announcement

Collapse
No announcement yet.

Transformer problem?

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

  • Transformer problem?

    I've created a simple file to file channel with the task of copying the content of OBR-4.4 to OBR-4.1.

    It does not seem to work so I was hoping someone could check it out to see what I am doing incorrectly.

    Here is the sample message I am using:
    MSH|^~\&||TBT||22365|20060818152112||ORU^R01|60495 000466|T|2.2
    PID|1||10036268||TEST^CASE1B^^^^||19470412|F|||^^^ ^||2127267400||||||000300064
    ORC|RE|73144|10036268||F|||||||
    OBR|1|73144|10036268|^^^45484R^HEMOGLOBIN A1C^|||20060808103600|||||||||G95785^G^ERIC^^^^^|| |||31D0696246^Quest Diagnostics^One Malcolm Avenue^Teterboro^NJ^07608^William E. Tarr, M.D.|20060818152112|||F||
    OBX|1|TX|^^^45484^HEMOGLOBIN A1C||5.0|Percent|||||F|||20060808103600|^^^TBR
    NTE|1|AMTC^HA1C_60220| Reference Range: Non Diabetics < 6.0%

    Below is the Channel:


    - <com.webreach.mirth.model.Channel>
    <id>3</id>
    <name>File to File</name>
    <description />
    <enabled>true</enabled>
    <version>1.1.0</version>
    <revision>0</revision>
    <direction>INBOUND</direction>
    <mode>ROUTER</mode>
    - <sourceConnector>
    <name>sourceConnector</name>
    - <properties>
    <property name="checkFileAge" value="1" />
    <property name="fileAge" value="1000" />
    <property name="pollingFrequency" value="1000" />
    <property name="autoDelete" value="1" />
    <property name="DataType" value="File Reader" />
    <property name="moveToDirectory" value="C:\HOST\RESMAPPER_DONE" />
    <property name="host" value="C:/HOST/RES_OUT" />
    <property name="moveToPattern" value="${UUID}.txt" />
    </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="outputAppend" value="0" />
    <property name="DataType" value="File Writer" />
    <property name="outputPattern" value="${UUID}.txt" />
    <property name="template" value="${HL7 ER7}" />
    <property name="host" value="C:/HOST/MIRTH_OUT" />
    </properties>
    - <transformer>
    - <steps>
    - <com.webreach.mirth.model.Step>
    <sequenceNumber>0</sequenceNumber>
    <name>Copy OBR-4.5 to OBR-4.1</name>
    <script>msg[&#039;ORU_R01.PATIENT_RESULT&#039;][&#039;ORU_R01.ORDER_OBSERVATION&#039;][&#039;OBR&#039;][&#039;OBR.4&#039;][&#039;CE.1&#039;]=msg[&#039;ORU_R01.PATIENT_RESULT&#039;][&#039;ORU_R01.ORDER_OBSERVATION&#039;][&#039;OBR&#039;][&#039;OBR.4&#039;][&#039;CE.4&#039;]; hl7_xml = msg;</script>
    <type>JavaScript</type>
    - <data class="map">
    - <entry>
    <string>Script</string>
    <string>msg[&#039;ORU_R01.PATIENT_RESULT&#039;][&#039;ORU_R01.ORDER_OBSERVATION&#039;][&#039;OBR&#039;][&#039;OBR.4&#039;][&#039;CE.1&#039;]=msg[&#039;ORU_R01.PATIENT_RESULT&#039;][&#039;ORU_R01.ORDER_OBSERVATION&#039;][&#039;OBR&#039;][&#039;OBR.4&#039;][&#039;CE.4&#039;]; hl7_xml = msg;</string>
    </entry>
    </data>
    </com.webreach.mirth.model.Step>
    </steps>
    <template>MSH|^~\&||TBT||22365|20060818152112||ORU ^R01|60495000466|T|2.2 PID|1||10036268||TEST^CASE1B^^^^||19470412|F|||^^^ ^||2127267400||||||000300064 ORC|RE|73144|10036268||F||||||| OBR|1|73144|10036268|H^^^45484R^HEMOGLOBIN A1C^|||20060808103600|||||||||G95785^G^ERIC^^^^^|| |||31D0696246^Quest Diagnostics^One Malcolm Avenue^Teterboro^NJ^07608^William E. Tarr, M.D.|20060818152112|||F|| OBX|1|TX|45484^^^45484^HEMOGLOBIN A1C||5.0|Percent|||||F|||20060808103600|^^^TBR NTE|1|AMTC^HA1C_60220| Reference Range: Non Diabetics < 6.0%</template>
    </transformer>
    - <filter>
    <rules />
    </filter>
    <transportName>File Writer</transportName>
    </com.webreach.mirth.model.Connector>
    </destinationConnectors>
    - <properties>
    <property name="initialState" value="started" />
    <property name="recv_xml_encoded" value="false" />
    </properties>
    </com.webreach.mirth.model.Channel>

  • #2
    Re: Transformer problem?

    Can you email me the XML directly?

    Thanks,
    -Chris
    Chris Lang

    Comment


    • #3
      Re: Transformer problem?

      Do you get any errors? If not, what kind of output do you see?

      Try this in your transformer step:

      msg[&#039;ORU_R01.PATIENT_RESULT&#039;][&#039;ORU_R01.ORDER_OBSERVATION&#039;][&#039;OBR&#039;][&#039;OBR.4&#039;][&#039;CE.1&#039;].text()[0] =msg[&#039;ORU_R01.PATIENT_RESULT&#039;][&#039;ORU_R01.ORDER_OBSERVATION&#039;][&#039;OBR&#039;][&#039;OBR.4&#039;][&#039;CE.4&#039;].text()[0]; h
      Chris Lang

      Comment


      • #4
        Re: Transformer problem?

        I tried adding a +&#039;&#039; at the end and the transformer step and it is now working fine. Is this a bug?

        msg[&#039;ORU_R01.PATIENT_RESULT&#039;][&#039;ORU_R01.ORDER_OBSERVATION&#039;][&#039;OBR&#039;][&#039;OBR.4&#039;][&#039;CE.1&#039;] = msg[&#039;ORU_R01.PATIENT_RESULT&#039;][&#039;ORU_R01.ORDER_OBSERVATION&#039;][&#039;OBR&#039;][&#039;OBR.4&#039;][&#039;CE.4&#039;]+&#039;&#039;;

        Comment


        • #5
          Re: Transformer problem?

          Interesting - this appears to be a Javascript quirk - it is converting it to a string when you add the &#039;&#039;. I will look into this. Thanks!
          -Chris
          Chris Lang

          Comment

          Working...
          X