web stats
OBX transform help - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 06-13-2016, 12:05 PM
cpitz cpitz is offline
Mirth Newb
 
Join Date: Sep 2012
Posts: 13
cpitz is on a distinguished road
Default OBX transform help

I am attempting to create a transform to iterate through all OBX segments in an HL7 message searching for substring text and if matched change OBX.4.1 to '1'. I am able to transform the field if the item is at the end of the message but when it's not it is ignored.

Here is what I have;

//Replace OBX4.1 with 1
for each (OBX in msg..OBX) {
var obx5 = OBX['OBX.5']['OBX.5.1'].toString()};
if ((obx5.substring(0,2) == "**")||(obx5.substring(0,2) == "NO")) {
OBX['OBX.4']['OBX.4.1']= '1';
}

Any assistance is appreciated.
Reply With Quote
  #2  
Old 06-14-2016, 04:12 AM
anadkat2000 anadkat2000 is offline
Mirth Newb
 
Join Date: May 2012
Posts: 20
anadkat2000 is on a distinguished road
Send a message via Yahoo to anadkat2000 Send a message via Skype™ to anadkat2000
Default

move for loop end after if statment should work for you.


//Replace OBX4.1 with 1
for each (OBX in msg..OBX)
{
var obx5 = OBX['OBX.5']['OBX.5.1'].toString();
if ((obx5.substring(0,2) == "**")||(obx5.substring(0,2) == "NO"))
{
OBX['OBX.4']['OBX.4.1']= '1';
}
}
Reply With Quote
  #3  
Old 06-14-2016, 04:46 AM
cpitz cpitz is offline
Mirth Newb
 
Join Date: Sep 2012
Posts: 13
cpitz is on a distinguished road
Default

This looks like its working as needed... Thanks!
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 08:52 PM.


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