Announcement

Collapse
No announcement yet.

Obr-28.1, 2, 3, 4

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

  • Obr-28.1, 2, 3, 4

    I am new to Mirth and trying to read the provider numbers in OBR-28. Example: 123456~789888~777888

    I am using java 8 and Mirth 3.3.0.7801

    I have tried referencing OBR28.1 but when i execute the code below it does not do anything with the HL7 outbound message

    tmp=msg

    //if (msg['OBR']['OBR.28']['OBR.28.1.2'].toString() == "244100")
    //{
    //tmp['OBR']['OBR.']['OBR.28.1.2'] == "1083776371";
    //}

  • #2
    Well, are you using an outbound template? If you do not have any information in the outbound template then you can just do something like this:

    if (msg['OBR']['OBR.28']['OBR.28.1.2'].toString() == "244100")
    {
    msg['OBR']['OBR.']['OBR.28.1.2'] = "1083776371";
    }

    The only time I use an outbound template is if I am receiving non-HL7 data and sending it out as HL7 data.

    Comment


    • #3
      OBR28 - did not change

      The code worked for PV17 and OBR16, but when i tried it on OBR28 same code did not change

      if (msg['PV1']['PV1.3']['PV1.3.4'].toString() == "244100")
      {
      msg['PV1']['PV1.3']['PV1.3.4'] = "1083776371";
      }

      if (msg['PV1']['PV1.17']['PV1.17.1'].toString() == "244100")
      {
      msg['PV1']['PV1.17']['PV1.17.1'] = "1083776371"
      msg['PV1']['PV1.17']['PV1.17.13'] = "NPI";
      }

      if (msg['OBR']['OBR.16']['OBR.16.1'].toString() == "244100")
      {
      msg['OBR']['OBR.16']['OBR.16.1'] = "1083776371"
      msg['OBR']['OBR.16']['OBR.16.13'] = "NPI";
      }

      if (msg['OBR']['OBR.28']['OBR.28.1.1'].toString() == "244100")
      {
      msg['OBR']['OBR.']['OBR.28.1.1'] = "1083776371";
      }

      if (msg['OBR']['OBR.28']['OBR.28.1.2'].toString() == "244100")
      {
      msg['OBR']['OBR.']['OBR.28.1.2'] = "1083776371";
      }
      Attached Files

      Comment


      • #4
        Originally posted by maxidog View Post
        The code worked for PV17 and OBR16, but when i tried it on OBR28 same code did not change

        if (msg['PV1']['PV1.3']['PV1.3.4'].toString() == "244100")
        {
        msg['PV1']['PV1.3']['PV1.3.4'] = "1083776371";
        }

        if (msg['PV1']['PV1.17']['PV1.17.1'].toString() == "244100")
        {
        msg['PV1']['PV1.17']['PV1.17.1'] = "1083776371"
        msg['PV1']['PV1.17']['PV1.17.13'] = "NPI";
        }

        if (msg['OBR']['OBR.16']['OBR.16.1'].toString() == "244100")
        {
        msg['OBR']['OBR.16']['OBR.16.1'] = "1083776371"
        msg['OBR']['OBR.16']['OBR.16.13'] = "NPI";
        }

        if (msg['OBR']['OBR.28']['OBR.28.1.1'].toString() == "244100")
        {
        msg['OBR']['OBR.']['OBR.28.1.1'] = "1083776371";
        }

        if (msg['OBR']['OBR.28']['OBR.28.1.2'].toString() == "244100")
        {
        msg['OBR']['OBR.']['OBR.28.1.2'] = "1083776371";
        }
        Since there are repetitions in OBR.28, you would need to iterate through them.

        Code:
        for each(obr in msg.OBR)
        {
             for each(obr28 in obr['OBR.28'])
             {
                  var npi = obr28['OBR.28.1'].toString();
                  switch(npi)
                  {
                  	case "12345":
                  	obr28['OBR.28.1'] = '45678';
                  	break;
        
                  	case "09876":
                  	obr28['OBR.28.1'] = '67890';
                  	break;
        
                  	default:
                  	obr28['OBR.28.1'] = 'NA';
                  }
             }
        }

        Comment


        • #5
          Thanks You it worked

          Thank you very much that OBR logic worked great. I am new to Mirth and JAVA so did not know about the switch statement but see many uses for it.

          Again Thanks

          Comment

          Working...
          X