Announcement

Collapse
No announcement yet.

Break multiple OBR Segments in a ORU lab message into separate messages

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

  • Break multiple OBR Segments in a ORU lab message into separate messages

    I need to break the following message with multiple batteries (OBR) into multiple messages. ie. One OBR per message. THe following message would result in 4 separate messages sent down stream. I'd like to do this in javascript since I don't know how many batteries (OBR) the lab system will bundle into a single HL7 message.

    Code:
    MSH|^~\&|LabPak|LABRESULTS|ICA|LAB|201003150118||ORU^R01|5101|P|2.3|||NE|NE|
    PID|1|<snip>
    PV1|1|R|||||||||||||||||
    OBR|1|24603|24603|PROTIME^PROTIME PANEL^L||201003150029|201003150029|||RA^ER||||201003150029|^^|OLS^OLSTAD^^^^^^L||||||201003150118|||F||^^^^^R||||^^I9
    OBX|1|NM|PT^PROTIME^L||24.4|SEC|14.0-16.0|H|||F|||||RA
    OBX|2|NM|INR^INR^L||2.1|RATIO|2.0-3.0|N|||F|||||RA
    OBR|2|24603|24603|CBC^COMPLETE BLOOD COUNT^L||201003150029|201003150029|||RA^ER||||201003150029|^^|OLS^OLSTAD^^^^^^L||||||201003150118|||F||^^^^^R||||^^I9
    OBX|1|NM|WBC^WBC^L||5.5|x10\S\3/uL|4.1-10.9|N|||F|||||RA
    OBX|2|NM|RBC^RBC^L||3.83|x10\S\6/uL|4.20-6.30|L|||F|||||RA
    OBX|3|NM|HGB^HGB^L||12.0|g/dL|12.0-18.0|N|||F|||||RA
    OBX|4|NM|HCT^HCT^L||35|%|37-51|L|||F|||||RA
    OBX|5|NM|MCV^MCV^L||91|fL|80-97|N|||F|||||RA
    OBX|6|NM|MCHC^MCHC^L||35|g/dL|31-36|N|||F|||||RA
    OBX|7|NM|RDW^RDW^L||12.9|%|11.4-14.5|N|||F|||||RA
    OBX|8|NM|PLT^PLT^L||154|x10\S\3/uL|140-440|N|||F|||||RA
    OBX|9|NM|LY%^LYMPH%^L||21|%|20-45|N|||F|||||RA
    OBX|10|NM|MCH^MCH^L||31|pg|26-32|N|||F|||||RA
    OBX|11|NM|MPV^MPV^L||8|fL|||||F|||||RA
    OBX|12|NM|BA%^BASO%^L||2.3|%|||||F|||||RA
    OBR|3|24603|24603|CMP^COMPREHENSIVE METABOLIC PROF^L||201003150029|201003150029|||RA^ER||||201003150029|^^|OLS^OLSTAD^^^^^^L||||||201003150118|||F||^^^^^R||||^^I9
    OBX|1|NM|GLU^GLUCOSE^L||127|mg/dL|74-110|H|||F|||||RA
    OBX|2|NM|BUN^BUN^L||22|mg/dL|7-25|N|||F|||||RA
    OBX|3|NM|CR^CREATININE^L||2.3|mg/dL|0.6-1.3|H|||F|||||RA
    OBX|4|NM|BN/CR^BUN/CREAT RATIO^L||9.6|CALC|12.0-20.0|L|||F|||||RA
    OBX|5|NM|NA^SODIUM^L||144|mmol/L|136-145|N|||F|||||RA
    OBX|6|NM|K^POTASSIUM^L||4.2|mmol/L|3.5-5.1|N|||F|||||RA
    OBX|7|NM|CL^CHLORIDE^L||104|mmol/L|98-107|N|||F|||||RA
    OBX|8|NM|CO2^CARBON DIOXIDE^L||28.7|mmol/L|21.0-32.0|N|||F|||||RA
    OBX|9|NM|CA^CALCIUM^L||8.6|mg/dL|8.5-10.1|N|||F|||||RA
    OBX|10|NM|TP^TOTAL PROTEIN^L||7.5|g/dL|6.7-8.5|N|||F|||||RA
    OBX|11|NM|ALB^ALBUMIN^L||3.2|g/dL|3.4-5.0|L|||F|||||RA
    OBX|12|NM|GLOB^GLOBULIN^L||4.3|CALC|2.6-3.9|H|||F|||||RA
    OBX|13|NM|ALKP^ALK. PHOS.^L||138|U/L|50-136|H|||F|||||RA
    OBX|14|NM|ALT^ALT (SGPT)^L||39|U/L|30-65|N|||F|||||RA
    OBX|15|NM|AST^AST (SGOT)^L||27|U/L|15-37|N|||F|||||RA
    OBX|16|NM|TBIL^TOTAL BILIRUBIN^L||0.63|mg/dL|0.00-1.00|N|||F|||||RA
    OBR|4|24603|24603|LPBN^NT-PRO BNP^L||201003150029|201003150029|||RA^ER||||201003150029|^^|OLS^OLSTAD^^^^^^L||||||201003150118|||F||^^^^^R||||^^I9
    OBX|1|NM|LPBN^NT-PRO BNP^L||2003.2|pg/ml|0.0-125.0|H|||F|||||RA
    For clarity message 1 would be....
    Code:
    MSH|^~\&|LabPak|LABRESULTS|ICA|LAB|201003150118||ORU^R01|5101|P|2.3|||NE|NE|
    PID|1|<snip>
    PV1|1|R|||||||||||||||||
    OBR|1|24603|24603|PROTIME^PROTIME PANEL^L||201003150029|201003150029|||RA^ER||||201003150029|^^|OLS^OLSTAD^^^^^^L||||||201003150118|||F||^^^^^R||||^^I9
    OBX|1|NM|PT^PROTIME^L||24.4|SEC|14.0-16.0|H|||F|||||RA
    OBX|2|NM|INR^INR^L||2.1|RATIO|2.0-3.0|N|||F|||||RA
    message 4 would be....
    Code:
    MSH|^~\&|LabPak|LABRESULTS|ICA|LAB|201003150118||ORU^R01|5101|P|2.3|||NE|NE|
    PID|1|<snip>
    PV1|1|R|||||||||||||||||
    OBR|4|24603|24603|LPBN^NT-PRO BNP^L||201003150029|201003150029|||RA^ER||||201003150029|^^|OLS^OLSTAD^^^^^^L||||||201003150118|||F||^^^^^R||||^^I9
    OBX|1|NM|LPBN^NT-PRO BNP^L||2003.2|pg/ml|0.0-125.0|H|||F|||||RA
    Thanks...

    Mark

  • #2
    Originally posted by markpmc View Post
    I need to break the following message with multiple batteries (OBR) into multiple messages. ie. One OBR per message. THe following message would result in 4 separate messages sent down stream. I'd like to do this in javascript since I don't know how many batteries (OBR) the lab system will bundle into a single HL7 message.

    Code:
    MSH|^~\&|LabPak|LABRESULTS|ICA|LAB|201003150118||ORU^R01|5101|P|2.3|||NE|NE|
    PID|1|<snip>
    PV1|1|R|||||||||||||||||
    OBR|1|24603|24603|PROTIME^PROTIME PANEL^L||201003150029|201003150029|||RA^ER||||201003150029|^^|OLS^OLSTAD^^^^^^L||||||201003150118|||F||^^^^^R||||^^I9
    OBX|1|NM|PT^PROTIME^L||24.4|SEC|14.0-16.0|H|||F|||||RA
    OBX|2|NM|INR^INR^L||2.1|RATIO|2.0-3.0|N|||F|||||RA
    OBR|2|24603|24603|CBC^COMPLETE BLOOD COUNT^L||201003150029|201003150029|||RA^ER||||201003150029|^^|OLS^OLSTAD^^^^^^L||||||201003150118|||F||^^^^^R||||^^I9
    OBX|1|NM|WBC^WBC^L||5.5|x10\S\3/uL|4.1-10.9|N|||F|||||RA
    OBX|2|NM|RBC^RBC^L||3.83|x10\S\6/uL|4.20-6.30|L|||F|||||RA
    OBX|3|NM|HGB^HGB^L||12.0|g/dL|12.0-18.0|N|||F|||||RA
    OBX|4|NM|HCT^HCT^L||35|%|37-51|L|||F|||||RA
    OBX|5|NM|MCV^MCV^L||91|fL|80-97|N|||F|||||RA
    OBX|6|NM|MCHC^MCHC^L||35|g/dL|31-36|N|||F|||||RA
    OBX|7|NM|RDW^RDW^L||12.9|%|11.4-14.5|N|||F|||||RA
    OBX|8|NM|PLT^PLT^L||154|x10\S\3/uL|140-440|N|||F|||||RA
    OBX|9|NM|LY%^LYMPH%^L||21|%|20-45|N|||F|||||RA
    OBX|10|NM|MCH^MCH^L||31|pg|26-32|N|||F|||||RA
    OBX|11|NM|MPV^MPV^L||8|fL|||||F|||||RA
    OBX|12|NM|BA%^BASO%^L||2.3|%|||||F|||||RA
    OBR|3|24603|24603|CMP^COMPREHENSIVE METABOLIC PROF^L||201003150029|201003150029|||RA^ER||||201003150029|^^|OLS^OLSTAD^^^^^^L||||||201003150118|||F||^^^^^R||||^^I9
    OBX|1|NM|GLU^GLUCOSE^L||127|mg/dL|74-110|H|||F|||||RA
    OBX|2|NM|BUN^BUN^L||22|mg/dL|7-25|N|||F|||||RA
    OBX|3|NM|CR^CREATININE^L||2.3|mg/dL|0.6-1.3|H|||F|||||RA
    OBX|4|NM|BN/CR^BUN/CREAT RATIO^L||9.6|CALC|12.0-20.0|L|||F|||||RA
    OBX|5|NM|NA^SODIUM^L||144|mmol/L|136-145|N|||F|||||RA
    OBX|6|NM|K^POTASSIUM^L||4.2|mmol/L|3.5-5.1|N|||F|||||RA
    OBX|7|NM|CL^CHLORIDE^L||104|mmol/L|98-107|N|||F|||||RA
    OBX|8|NM|CO2^CARBON DIOXIDE^L||28.7|mmol/L|21.0-32.0|N|||F|||||RA
    OBX|9|NM|CA^CALCIUM^L||8.6|mg/dL|8.5-10.1|N|||F|||||RA
    OBX|10|NM|TP^TOTAL PROTEIN^L||7.5|g/dL|6.7-8.5|N|||F|||||RA
    OBX|11|NM|ALB^ALBUMIN^L||3.2|g/dL|3.4-5.0|L|||F|||||RA
    OBX|12|NM|GLOB^GLOBULIN^L||4.3|CALC|2.6-3.9|H|||F|||||RA
    OBX|13|NM|ALKP^ALK. PHOS.^L||138|U/L|50-136|H|||F|||||RA
    OBX|14|NM|ALT^ALT (SGPT)^L||39|U/L|30-65|N|||F|||||RA
    OBX|15|NM|AST^AST (SGOT)^L||27|U/L|15-37|N|||F|||||RA
    OBX|16|NM|TBIL^TOTAL BILIRUBIN^L||0.63|mg/dL|0.00-1.00|N|||F|||||RA
    OBR|4|24603|24603|LPBN^NT-PRO BNP^L||201003150029|201003150029|||RA^ER||||201003150029|^^|OLS^OLSTAD^^^^^^L||||||201003150118|||F||^^^^^R||||^^I9
    OBX|1|NM|LPBN^NT-PRO BNP^L||2003.2|pg/ml|0.0-125.0|H|||F|||||RA
    For clarity message 1 would be....
    Code:
    MSH|^~\&|LabPak|LABRESULTS|ICA|LAB|201003150118||ORU^R01|5101|P|2.3|||NE|NE|
    PID|1|<snip>
    PV1|1|R|||||||||||||||||
    OBR|1|24603|24603|PROTIME^PROTIME PANEL^L||201003150029|201003150029|||RA^ER||||201003150029|^^|OLS^OLSTAD^^^^^^L||||||201003150118|||F||^^^^^R||||^^I9
    OBX|1|NM|PT^PROTIME^L||24.4|SEC|14.0-16.0|H|||F|||||RA
    OBX|2|NM|INR^INR^L||2.1|RATIO|2.0-3.0|N|||F|||||RA
    message 4 would be....
    Code:
    MSH|^~\&|LabPak|LABRESULTS|ICA|LAB|201003150118||ORU^R01|5101|P|2.3|||NE|NE|
    PID|1|<snip>
    PV1|1|R|||||||||||||||||
    OBR|4|24603|24603|LPBN^NT-PRO BNP^L||201003150029|201003150029|||RA^ER||||201003150029|^^|OLS^OLSTAD^^^^^^L||||||201003150118|||F||^^^^^R||||^^I9
    OBX|1|NM|LPBN^NT-PRO BNP^L||2003.2|pg/ml|0.0-125.0|H|||F|||||RA
    Thanks...

    Mark
    Hi Mark - without being Mirth specific, there is a technique that I have seen used with other integration engines. The approach is to build a channel which accepts your lab result message and has two destinations. The channel transforms the incoming message into two messages; the first which is sent to the destination, contains only the first OBR. The second, which is fed back into the channel contains the second thru nth OBR. You just have to have a way of filtering out a message with no OBR segments.

    This approach has the nickname of the deli-slicer because it works like your butcher when running your favorite lunchmeat thru an automatic slicer.

    Will be interested to hear if you can make use of this technique and develop it in Mirth.
    Good luck.

    Comment


    • #3
      joequinn's method should work just fine. Use the function router.routeMessage(channelName, 'message') to route the OBR groups to another channel to be processed. The secondary channel will probaly need to accept XML. As always, be sure to use logger.error(String); to debug

      Comment


      • #4
        Thanks guys. I'll give this approach a try. I wish there was a 'send_message' function that was callable in JS. Then I could just loop thru the message in code instead of looping via a channel.

        Comment


        • #5
          Yes, and this capability exists in some commercial integration engines. Can we cross-post this to the Development forum to see if it takes root as a request for a future enhancement?

          Comment

          Working...
          X