web stats
Obr-28.1, 2, 3, 4 - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 10-29-2015, 08:15 AM
maxidog maxidog is offline
Mirth Newb
 
Join Date: Nov 2011
Posts: 9
maxidog is on a distinguished road
Default 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";
//}
Reply With Quote
  #2  
Old 10-29-2015, 08:44 AM
atibbits atibbits is offline
Mirth Guru
 
Join Date: May 2012
Location: Salina, KS
Posts: 381
atibbits is on a distinguished road
Default

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.
Reply With Quote
  #3  
Old 10-29-2015, 09:36 AM
maxidog maxidog is offline
Mirth Newb
 
Join Date: Nov 2011
Posts: 9
maxidog is on a distinguished road
Default 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
File Type: txt Rjhs2.txt (542 Bytes, 3 views)
Reply With Quote
  #4  
Old 10-30-2015, 03:56 AM
mcalKno mcalKno is offline
 
Join Date: Apr 2015
Location: Pennsylvania
Posts: 247
mcalKno is on a distinguished road
Default

Quote:
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';
          }
     }
}
Reply With Quote
  #5  
Old 10-30-2015, 05:50 AM
maxidog maxidog is offline
Mirth Newb
 
Join Date: Nov 2011
Posts: 9
maxidog is on a distinguished road
Red face 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
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 02:23 PM.


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