web stats
Taking NTE.3 and putting them in the correct OBX.5 - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 03-31-2017, 01:01 PM
atibbits atibbits is offline
Mirth Guru
 
Join Date: May 2012
Location: Salina, KS
Posts: 381
atibbits is on a distinguished road
Unhappy Taking NTE.3 and putting them in the correct OBX.5

I need to figure out how to take multiple NTE.3.1 fields and combine them into the corresponding OBX.5. The problem is there can be multiple OBX segments and I have to get the correct NTE.3 in the correct OBX.5 fields. So here is an example:

Here is how the message looks coming into Mirth:

Quote:
MSH|^~\&|PRIMESUITE|1486|SALINA REGIONAL HEALTH CENTER LAB|SALINA REGIONAL HEALTH CENTER LAB|20170331110036||ORM^O01|1310|P|2.5.1|||AL
PID|1|355095|||RANGER^YELLOW||20040214|F||C|400 S SANTA FE^^SALINA^KS^67401^1|SALINE|7854527000|||||^^^T^N ||^0||^NOT HISPANIC OR LATINO
PV1|0001||^^^1035|VOIDED VISITS|||123456^FETHERSTON^AUBREY^^^^^L|^^^^^^^L|| |||||||123456^FETHERSTON^AUBREY^^^^^L||1010736|||| ||||||||||||||||1035
IN1|0001|2029|1041|AETNA|PO BOX 14079^^LEXINGTON^KY^40512-4079||8886323862|ABC123|AETNA||||||H|RANGER^YELLOW |1^SELF|2004-02-14T00:00:00|400 S SANTA FE^^SALINA^KS^67401^UNITED STATES^^^SALINE|Y||Y|||||||||N|||||ABC123|||||||F| |||T
GT1|1||RANGER^YELLOW||400 S SANTA FE^^SALINA^KS^67401^1^^^SALINE|||2004-02-14T00:00:00|F||1^SELF
ORC|NW|123456||123456|||201703310958||201703311000 |||123456^FETHERSTON^AUBREY^^^ ^PA-C^L
OBR|1|123456||CBCDIFF^CBC W/AUTO DIFF^L|R|20170331|201703311000||||N|||||123456^FET HERSTON^AUBREY^^^ ^PA-C^L|||||||||||^^^^^R
NTE|1|P|CC DR. PAUL JOHNSON AND
NTE|1|P|CC DR. MICKEY MOUSE ASAP
DG1|1|I10|F32.9^MAJOR DEPRESSIVE DISORDER, SINGLE EPISODE, UNSPECIFIED^I10
DG1|2|I10|R53.83^OTHER FATIGUE^I10
ORC|NW|123456||123456|||201703310958||201703311000 |||123456^FETHERSTON^AUBREY^^^ ^PA-C^L
OBR|2|123456||LIPR^LIPID PANEL 1040^L|R|20170331|201703311000||||N|||||123456^FET HERSTON^AUBREY^^^ ^PA-C^L|||||||||||^^^^^R
NTE|1|P|PATIENT IS FASTING FOR 12 HOURS
DG1|1|I10|F32.9^MAJOR DEPRESSIVE DISORDER, SINGLE EPISODE, UNSPECIFIED^I10
DG1|2|I10|R53.83^OTHER FATIGUE^I10
ORC|NW|123456||123456|||201703310958||201703311000 |||123456^FETHERSTON^AUBREY^^^ ^PA-C^L
OBR|3|123456||CMP^CMP^L|R|20170331|201703311000||| |N|||||123456^FETHERSTON^AUBREY^^^ ^PA-C^L|||||||||||^^^^^R
NTE|1|P|PLEASE CC ALL THE DOCOTRS
NTE|2|P|IN THE WORLD
DG1|1|I10|F32.9^MAJOR DEPRESSIVE DISORDER, SINGLE EPISODE, UNSPECIFIED^I10
DG1|2|I10|R53.83^OTHER FATIGUE^I10
ORC|NW|123456||123456|||201703310959||201703311000 |||123456^FETHERSTON^AUBREY^^^ ^PA-C^L
OBR|4|123456||PT^PROTIME LABCORP 005199^L|R|20170331|201703311000||||N|||||123456^F ETHERSTON^AUBREY^^^ ^PA-C^L|||||||||||^^^^^R
NTE|1|P|5 MG M/W/F 2.5 TUES/THURS/SAT/SUN
DG1|1|I10|F32.9^MAJOR DEPRESSIVE DISORDER, SINGLE EPISODE, UNSPECIFIED^I10
DG1|2|I10|R53.83^OTHER FATIGUE^I10
Here is how we want it to look going out:

Quote:
MSH|^~\&|PRIMESUITE|1486|SALINA REGIONAL HEALTH CENTER LAB|SALINA REGIONAL HEALTH CENTER LAB|20170331110036||ORM^O01|1310|P|2.5.1|||AL
PID|1|355095|||RANGER^YELLOW||20040214|F||C|400 S SANTA FE^^SALINA^KS^67401^1|SALINE|7854527000|||||^^^T^N ||^0||^NOT HISPANIC OR LATINO
PV1|0001||^^^1035|VOIDED VISITS|||123456^FETHERSTON^AUBREY^^^^^L|^^^^^^^L|| |||||||123456^FETHERSTON^AUBREY^^^^^L||1010736|||| ||||||||||||||||1035
IN1|0001|2029|1041|AETNA|PO BOX 14079^^LEXINGTON^KY^40512-4079||8886323862|ABC123|AETNA||||||H|RANGER^YELLOW |1^SELF|2004-02-14T00:00:00|400 S SANTA FE^^SALINA^KS^67401^UNITED STATES^^^SALINE|Y||Y|||||||||N|||||ABC123|||||||F| |||T
GT1|1||RANGER^YELLOW||400 S SANTA FE^^SALINA^KS^67401^1^^^SALINE|||2004-02-14T00:00:00|F||1^SELF
ORC|NW|123456||123456|||201703310958||201703311000 |||123456^FETHERSTON^AUBREY^^^ ^PA-C^L
OBR|1|123456||CBCDIFF^CBC W/AUTO DIFF^L|R|20170331|201703311000||||N|||||123456^FET HERSTON^AUBREY^^^ ^PA-C^L|||||||||||^^^^^R
OBX|1|TX|OECOMPHL^Comments to Phlebotomist:|CC DR. PAUL JOHNSON AND
DG1|1|I10|F32.9^MAJOR DEPRESSIVE DISORDER, SINGLE EPISODE, UNSPECIFIED^I10
DG1|2|I10|R53.83^OTHER FATIGUE^I10
ORC|NW|123456||123456|||201703310958||201703311000 |||123456^FETHERSTON^AUBREY^^^ ^PA-C^L
OBR|2|123456||LIPR^LIPID PANEL 1040^L|R|20170331|201703311000||||N|||||123456^FET HERSTON^AUBREY^^^ ^PA-C^L|||||||||||^^^^^R
OBX|2|TX|OECOMPHL^Comments to Phlebotomist:|PATIENT IS FASTING FOR 12 HOURS
DG1|1|I10|F32.9^MAJOR DEPRESSIVE DISORDER, SINGLE EPISODE, UNSPECIFIED^I10
DG1|2|I10|R53.83^OTHER FATIGUE^I10
ORC|NW|123456||123456|||201703310958||201703311000 |||123456^FETHERSTON^AUBREY^^^ ^PA-C^L
OBR|3|123456||CMP^CMP^L|R|20170331|201703311000||| |N|||||123456^FETHERSTON^AUBREY^^^ ^PA-C^L|||||||||||^^^^^R
OBX|3|TX|OECOMPHL^Comments to Phlebotomist:|PLEASE CC ALL THE DOCOTRS IN THE WORLD
DG1|1|I10|F32.9^MAJOR DEPRESSIVE DISORDER, SINGLE EPISODE, UNSPECIFIED^I10
DG1|2|I10|R53.83^OTHER FATIGUE^I10
ORC|NW|123456||123456|||201703310959||201703311000 |||123456^FETHERSTON^AUBREY^^^ ^PA-C^L
OBR|4|123456||PT^PROTIME LABCORP 005199^L|R|20170331|201703311000||||N|||||123456^F ETHERSTON^AUBREY^^^ ^PA-C^L|||||||||||^^^^^R
OBX|4|TX|OECOMPHL^Comments to Phlebotomist:|5 MG M/W/F 2.5 TUES/THURS/SAT/SUN
DG1|1|I10|F32.9^MAJOR DEPRESSIVE DISORDER, SINGLE EPISODE, UNSPECIFIED^I10
DG1|2|I10|R53.83^OTHER FATIGUE^I10
Any help would be greatly appreciated!!
Reply With Quote
  #2  
Old 03-31-2017, 01:40 PM
agradinc agradinc is offline
Mirth Newb
 
Join Date: Dec 2015
Posts: 14
agradinc is on a distinguished road
Default

You're likely going to want to use getSegmentsAfter. See http://www.mirthcorp.com/community/f...8&postcount=11
Reply With Quote
  #3  
Old 04-03-2017, 12:20 PM
atibbits atibbits is offline
Mirth Guru
 
Join Date: May 2012
Location: Salina, KS
Posts: 381
atibbits is on a distinguished road
Default

So,that is exactly what I decided to do! I use getSegmentsAfter and insertChildAfter to create a new OBX after each OBR. Then, I move the value from NTE.3 to each new OBX. It is working, but only if there is only 1 NTE in each group. I am still working on how to get all of the NTE.3s (if there is more than one) under each OBR into 1 OBX.5. However, I think I am close.
Reply With Quote
  #4  
Old 04-05-2017, 01:20 PM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 896
agermano is on a distinguished road
Default

Maybe something like (I haven't tested this):

Code:
for (var obr in msg) {
  var nte_segs = getSegmentsAfter(msg,obr,'NTE',true);
  var obx = <OBX/>;
  obx[OBX.4][OBX.4.1]='';
  for (var nte in nte_segs) {
    obx[OBX.4][OBX.4.1] += nte[NTE.3][NTE.3.1].toString();
    delete nte;
  }
  insertSegmentAfter(obx,obr);
}
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 01:27 AM.


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