web stats
Logic to change all OBX (OBR-11) segment status - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 04-23-2018, 04:37 PM
newbie_mrth newbie_mrth is offline
Mirth Newb
 
Join Date: Jul 2017
Posts: 13
newbie_mrth is on a distinguished road
Default Logic to change all OBX (OBR-11) segment status

Hi there,

Another newbie question. So i need to insert some logic for when an order status change is ORC-1 (SC) and ORC-5 (CM), update all OBX segments for OBX-11 = W.

Can anyone give some examples of how i would implement this in javascript?

Thanks in advance.


Thinking maybe something like this?

if (msg['ORC']['ORC.1']['ORC.1.1'].toString() == "SC" && msg['ORC']['ORC.5']['ORC.5.1'].toString() == "CM")
{
message.setAllNodes('OBX-11','W');
}

Last edited by newbie_mrth; 04-23-2018 at 05:15 PM. Reason: more information
Reply With Quote
  #2  
Old 04-23-2018, 09:47 PM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 1,028
agermano is on a distinguished road
Default

Is this what you're looking for?
Code:
if (msg['ORC']['ORC.1']['ORC.1.1'].toString() == "SC" &&
  msg['ORC']['ORC.5']['ORC.5.1'].toString() == "CM") {
  for each (var obx in msg['OBX']) {
    obx['OBX.11']['OBX.11.1'] = 'W';
  }
}
Reply With Quote
  #3  
Old 04-24-2018, 07:25 AM
siddharth siddharth is offline
Mirth Guru
 
Join Date: Feb 2013
Posts: 835
siddharth is on a distinguished road
Default

I am curious, where did you get this piece of code

message.setAllNodes('OBX-11','W'); ?
__________________
HL7v2.7 Certified Control Specialist!
Reply With Quote
  #4  
Old 04-24-2018, 09:52 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 1,028
agermano is on a distinguished road
Default

I assumed it was psuedo-code.
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 06:27 PM.


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