Mirth Community

Mirth Community (http://www.mirthcorp.com/community/forums/index.php)
-   Support (http://www.mirthcorp.com/community/forums/forumdisplay.php?f=6)
-   -   Transformer problem? (http://www.mirthcorp.com/community/forums/showthread.php?t=442)

cableops 09-18-2006 12:50 PM

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['ORU_R01.PATIENT_RESULT']['ORU_R01.ORDER_OBSERVATION']['OBR']['OBR.4']['CE.1']=msg['ORU_R01.PATIENT_RESULT']['ORU_R01.ORDER_OBSERVATION']['OBR']['OBR.4']['CE.4']; hl7_xml = msg;</script>
<type>JavaScript</type>
- <data class="map">
- <entry>
<string>Script</string>
<string>msg['ORU_R01.PATIENT_RESULT']['ORU_R01.ORDER_OBSERVATION']['OBR']['OBR.4']['CE.1']=msg['ORU_R01.PATIENT_RESULT']['ORU_R01.ORDER_OBSERVATION']['OBR']['OBR.4']['CE.4']; 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>

chrisl 09-18-2006 03:05 PM

Re: Transformer problem?
 
Can you email me the XML directly?

Thanks,
-Chris

chrisl 09-18-2006 03:08 PM

Re: Transformer problem?
 
Do you get any errors? If not, what kind of output do you see?

Try this in your transformer step:

msg['ORU_R01.PATIENT_RESULT']['ORU_R01.ORDER_OBSERVATION']['OBR']['OBR.4']['CE.1'].text()[0] =msg['ORU_R01.PATIENT_RESULT']['ORU_R01.ORDER_OBSERVATION']['OBR']['OBR.4']['CE.4'].text()[0]; h

cableops 09-19-2006 04:00 PM

Re: Transformer problem?
 
I tried adding a +'' at the end and the transformer step and it is now working fine. Is this a bug?

msg['ORU_R01.PATIENT_RESULT']['ORU_R01.ORDER_OBSERVATION']['OBR']['OBR.4']['CE.1'] = msg['ORU_R01.PATIENT_RESULT']['ORU_R01.ORDER_OBSERVATION']['OBR']['OBR.4']['CE.4']+'';

chrisl 09-19-2006 07:58 PM

Re: Transformer problem?
 
Interesting - this appears to be a Javascript quirk - it is converting it to a string when you add the ''. I will look into this. Thanks!
-Chris


All times are GMT -8. The time now is 01:29 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Mirth Corporation