web stats
PID loop - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 03-25-2020, 09:29 AM
math1964 math1964 is offline
Mirth Newb
 
Join Date: Apr 2019
Posts: 15
math1964 is on a distinguished road
Default PID loop

if ((msg['PID'][0]['PID.3']['PID.3.2'].toString() == 'PRN'
msg['PID'][0]['PID.3']['PID.3.1'] = '';
msg['PID'][0]['PID.3']['PID.3.4'] = 'email';
}
Else
if ((msg['PID'][2]['PID.3']['PID.3.2'].toString() == 'NET'
msg['PID'][2]['PID.3']['PID.3.1'] = '';

}
}

PID 3.1 must be blank
PID 3.4 will have the word email

If ['PID'][2]['PID.3']['PID.3.2'] has "NET"
then ['PID'][2]['PID.3']['PID.3.1'] must be blank

Before
PID||8878390^^^Enterprise ID|24594^^^Cerner MRN|8929710^^^Patient ID|TEST^ABBY||20081001|F||Patient Declined^Patient Declined|CHERRY^NULL.^BLUFFTON^IN^46714^UNITED STATES||(615)778-8137^PRN^PH^^1^615^7788137~(888)888-8888^WPN^PH^^1^888^8888888~laura_terlikosky@chs.ne t^NET^^laura_terlikosky@chs.net~(999)999-9999^ORN^CP^^1^999^9999999|(888)888-8888^WPN^PH^^1^888^8888888|eng^English|S||||||Pati ent Declined^Patient Declined NK1|1|EMERGENCY^ABBY|SPOUSE||(111)444-6667|(222)333-5556|C

After
PID||8878390^^^Enterprise ID|24594^^^Cerner MRN|8929710^^^Patient ID|TEST^ABBY||20081001|F||Patient Declined^Patient Declined|CHERRY^NULL.^BLUFFTON^IN^46714^UNITED STATES||(615)778-8137^PRN^PH^email^1^615^7788137~(888)888-8888^WPN^PH^^1^888^8888888~ ^NET^^laura_terlikosky@chs.net~(999)999-9999^ORN^CP^^1^999^9999999|(888)888-8888^WPN^PH^^1^888^8888888|eng^English|S||||||Pati ent Declined^Patient Declined NK1|1|EMERGENCY^ABBY|SPOUSE||(111)444-6667|(222)333-5556|C
Reply With Quote
  #2  
Old 03-26-2020, 10:51 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 1,165
agermano is on a distinguished road
Default

I'm not exactly sure what your question is.

Your data doesn't line up with your code. It looks like maybe you meant PID.13 instead of PID.3?

The title of the post is PID loop. Did you want to know how to check all of the PID.13 values in a loop rather than accessing the elements by index 0 and 2?
Reply With Quote
  #3  
Old 03-26-2020, 10:53 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 1,165
agermano is on a distinguished road
Default

It looks like you already asked and I already answered this question http://www.mirthcorp.com/community/forums/showthread.php?t=222344
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:26 PM.


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