web stats
Adding an OBX record to a message - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 04-23-2015, 12:08 PM
smccagg smccagg is offline
What's HL7?
 
Join Date: Apr 2015
Posts: 2
smccagg is on a distinguished road
Default Adding an OBX record to a message

Hi:

I'm completely new to Mirth and need some help getting off the ground.

I have incoming messages that I need to grab the value from 3.1 of any OBX recording containing 'TX' in 2.1 and append an OBX record to the message with 'URL' in 2.1 and that 'grabbed' 3.1 value in the 5.1

Any help would be greatly appreciated

Thanks,

Scott
Reply With Quote
  #2  
Old 04-24-2015, 05:30 AM
mcalKno mcalKno is offline
 
Join Date: Apr 2015
Location: Pennsylvania
Posts: 247
mcalKno is on a distinguished road
Default

This will handle it for multiple instances.

Code:
for(var i=0;i<msg.OBX.length();i++){
	if(msg['OBX'][i]['OBX.2']['OBX.2.1'] == 'TX'){
		var newOBX = <OBX/>;
		newOBX['OBX.1']['OBX.1.1'] = msg.OBX.length()+1;
		newOBX['OBX.2']['OBX.2.1'] = 'URL';
		newOBX['OBX.5']['OBX.5.1'] = msg['OBX'][i]['OBX.3']['OBX.3.1'].toString();
		msg.appendChild(newOBX);
	}
}
Reply With Quote
  #3  
Old 04-27-2015, 07:58 AM
smccagg smccagg is offline
What's HL7?
 
Join Date: Apr 2015
Posts: 2
smccagg is on a distinguished road
Default

Thanks so much! That did the trick!
Reply With Quote
Reply

Tags
add record, hl7, obx

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 06:03 PM.


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