Announcement

Collapse
No announcement yet.

PID loop

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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^[email protected] t^NET^^[email protected]~(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^^[email protected]~(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

  • #2
    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?

    Comment


    • #3
      It looks like you already asked and I already answered this question https://forums.mirthproject.io/node/18980

      Comment

      Working...
      X