Announcement

Collapse
No announcement yet.

OBX mapping from HL7 - variable number of OBX items?

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

  • OBX mapping from HL7 - variable number of OBX items?

    Hello!

    I am kinda new to Mirth and community - i have discovered this awesome project.. 2 days ago =)

    But thanks to all of you guys and this forums and developers - i have already connected 3 lab analyzers to one PC and get XML/CSV files for further processing.

    The questions is - i have hematology analyzer Mindray BC5150 - it was hard to implement (ack message of specific format - i had to use post processor and build a reply as per communication manual, otherwise the analyzer just shut down with error)

    I have the following HL7 message - and i have some flags in OBX segment..

    Sometimes i have H, L or N flag - and Mirth parses them as duplicate OBX.8 segments, so sometimes i have:

    OBX|9|NM|751-8^NEU#^LN||8.42|10*9/L|2.00-7.00|H~N|||F

    which has the following parsing
    Capture.png

    I need to remove second OBX.8 [1] segment, where there is already H or L OBX.8[0] segment..

    I am trying this code:

    Code:
    for each (obx in msg.OBX)
    if (obx['OBX.8']['OBX.8.1'].toString() != 'N') {
    
    
    delete msg.OBX['OBX.8'][1];
    }
    but it deletes both whole obx.8 segments.. what am i doing wrong?

    Code:
    MSH|^~\&|||||20220621181746||ORU^R01|141|P|2.3.1|| ||||UNICODE
    PID|1||^^^^MR||||20030119000000|Жен
    PV1|1
    OBR|1||9918959126|00001^Automated Count^99MRC|||20220608115802|||||||||||||||||HM||| |||||Доктор
    OBX|1|IS|08001^Take Mode^99MRC||O||||||F
    OBX|2|IS|08002^Blood Mode^99MRC||W||||||F
    OBX|3|IS|08003^Test Mode^99MRC||CBC+DIFF||||||F
    OBX|4|IS|01002^Ref Group^99MRC||Взрос.женщ||||||F
    OBX|5|NM|30525-0^Age^LN||19|yr|||||F
    OBX|6|NM|6690-2^WBC^LN||11.78|10*9/L|4.00-11.00|H~N|||F
    OBX|7|NM|704-7^BAS#^LN||0.05|10*9/L|0.00-0.07|N|||F
    OBX|8|NM|706-2^BAS%^LN||0.4|%|0.0-1.0|N|||F
    OBX|9|NM|751-8^NEU#^LN||8.42|10*9/L|2.00-7.00|H~N|||F
    OBX|10|NM|770-8^NEU%^LN||71.5|%|47.0-72.0|N|||F
    OBX|11|NM|711-2^EOS#^LN||0.14|10*9/L|0.02-0.35|N|||F
    OBX|12|NM|713-8^EOS%^LN||1.1|%|0.5-5.0|N|||F
    OBX|13|NM|731-0^LYM#^LN||2.32|10*9/L|0.80-4.00|N|||F
    OBX|14|NM|736-9^LYM%^LN||19.7|%|19.0-37.0|N|||F
    OBX|15|NM|742-7^MON#^LN||0.85|10*9/L|0.21-0.77|H~N|||F
    OBX|16|NM|5905-5^MON%^LN||7.3|%|3.0-11.0|N|||F
    OBX|17|NM|789-8^RBC^LN||4.58|10*12/L|3.80-5.20|N|||F
    OBX|18|NM|718-7^HGB^LN||126|g/L|120-140|N|||F
    OBX|19|NM|787-2^MCV^LN||84.1|fL|81.0-102.0|N|||F
    OBX|20|NM|785-6^MCH^LN||27.4|pg|27.0-33.3|N|||F
    OBX|21|NM|786-4^MCHC^LN||326|g/L|300-380|N|||F
    OBX|22|NM|788-0^RDW-CV^LN||13.6|%|10.0-14.5|N|||F
    OBX|23|NM|21000-5^RDW-SD^LN||41.9|fL|35.0-54.0|N|||F
    OBX|24|NM|4544-3^HCT^LN||38.5|%|35.0-47.0|N|||F
    OBX|25|NM|777-3^PLT^LN||331|10*9/L|150-400|N|||F
    OBX|26|NM|32623-1^MPV^LN||10.7|fL|6.5-12.0|N|||F
    OBX|27|NM|32207-3^PDW^LN||16.1||10.0-18.0|N|||F
    OBX|28|NM|10002^PCT^99MRC||0.356|%|0.100-0.400|N|||F
    OBX|29|NM|10013^PLCC^99MRC||107|10*9/L|30-90|H~N|||F
    OBX|30|NM|10014^PLCR^99MRC||32.3|%|11.0-45.0|N|||FMSH|^~\&|||||20220621181746||ORU^R01|141 |P|2.3.1|| ||||UNICODE
    Last edited by rzrwolf; Yesterday, 01:26 AM.

  • #2
    Will answer to myself - it was very easy.. just several hours and voila =)) I have removed second OBX unnecessary segment

    Code:
    for each (obx in msg.OBX)
    if (obx['OBX.8']['OBX.8.1'].toString() != 'N') {
    
    delete obx ['OBX.8'][1];
    
    }
    Lack of knowledge of javascript is terrible, when you need to make something work as you want..

    Anyone willing to share the experience with Mindray Analyzers BC5150, CL1200i, or BS240 and MIRTH are welcome to contact .
    Last edited by rzrwolf; Yesterday, 03:05 AM.

    Comment

    Working...
    X