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

Go Back   Mirth Community > Mirth Connect > Support

Thread Tools Display Modes
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...


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


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

I'm using version of Mirth.

Any help/guidance would be much appreciated!
Reply With Quote
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

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.

var strTemp = msg['OBR'][0]['OBR.14']['OBR.14.1'].toString();
Reply With Quote

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