web stats
Destination transformer returns XML scheme/data instead of just data - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 02-13-2019, 07:43 AM
John Carter John Carter is offline
What's HL7?
 
Join Date: Jan 2015
Posts: 1
John Carter is on a distinguished road
Default Destination transformer returns XML scheme/data instead of just data

In certain circumstance, my destination transformer returns two lots of XML schema/data instead of just the data. Here is some sample code I've used to check things out...

var strTemp = msg['OBR']['OBR.14']['OBR.14.1'].toString();
channelMap.put('COLLECTION DATE/TIME','[' + strTemp + ']');


When I look at the mappings for the failed messages the 'COLLECTION DATE/TIME' contains...

[<OBR.14.1>201902051215</OBR.14.1><OBR.14.1>201902051215</OBR.14.1>]

I've checked the transformed HL7 message and it looks fine...

<OBR.14>
<OBR.14.1>201902051215</OBR.14.1>
</OBR.14>


For lots of other messages the transformer correctly returns just the data from 'OBR.14.1'

I'm using version 3.4.2.9129 of Mirth.

Any help/guidance would be much appreciated!
Reply With Quote
  #2  
Old 02-15-2019, 11:28 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 629
agermano is on a distinguished road
Default

You likely have two OBR segments in that message. You have to decide how you want to handle things when there are multiple OBR segments.

Do you need them all?
Can you always use the first one?
Do you want only the earliest or latest one?

In the example you gave, the two values are identical, so maybe you can use the first one if you know they will always be the same. Notice the change below that tells it to always use the first OBR segment.

Code:
var strTemp = msg['OBR'][0]['OBR.14']['OBR.14.1'].toString();
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


All times are GMT -8. The time now is 07:28 PM.


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