web stats
Transformer problem? - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 09-18-2006, 01:50 PM
cableops cableops is offline
Mirth Newb
 
Join Date: Aug 2006
Posts: 21
cableops
Default 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>
Reply With Quote
  #2  
Old 09-18-2006, 04:05 PM
chrisl chrisl is offline
Mirth Employee
 
Join Date: Aug 2006
Posts: 967
chrisl is an unknown quantity at this point
Default Re: Transformer problem?

Can you email me the XML directly?

Thanks,
-Chris
__________________
Chris Lang
Reply With Quote
  #3  
Old 09-18-2006, 04:08 PM
chrisl chrisl is offline
Mirth Employee
 
Join Date: Aug 2006
Posts: 967
chrisl is an unknown quantity at this point
Default 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
__________________
Chris Lang
Reply With Quote
  #4  
Old 09-19-2006, 05:00 PM
cableops cableops is offline
Mirth Newb
 
Join Date: Aug 2006
Posts: 21
cableops
Default 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']+'';
Reply With Quote
  #5  
Old 09-19-2006, 08:58 PM
chrisl chrisl is offline
Mirth Employee
 
Join Date: Aug 2006
Posts: 967
chrisl is an unknown quantity at this point
Default 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
__________________
Chris Lang
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with transformer orande Development 3 10-23-2007 06:37 AM


All times are GMT -8. The time now is 02:51 PM.


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