Announcement

Collapse

Mirth Connect 3.12.0 Released!

Mirth Connect 3.12.0 is now available as an appliance update and on our GitHub page. This release includes database performance improvements, improves visual HL7 representation, message pruning, keystore handling, PDF generation, community contributions, and fixes several security vulnerabilities. This release also contains many improvements to commercial extensions. See the release notes for the list of fixes and updates.

Download | See What's New | Upgrade Guide | Release Notes

For discussion on this release, see this thread.
See more
See less

parsing a microbiology lab result message

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

  • parsing a microbiology lab result message

    I'm working on parsing ORU-R01 messages on microbiology lab results, like blood cultures, and writing the fields into the database.

    Each ORU-R01 messsage reports on one lab sample. The MSH, PID, ORC, OBR segments contain attributes for the sample.

    Each lab sample contains one or more organisms reported.

    Each organism contains one or more drug sensitivity result.

    The organism and drug sensitivity info are in the OBX segments. There are "organism" OBX segments and "drug sensitivity" OBX segments. The Observation Sub-ID field (OBX.4) matches organisms to their corresponding drug sensitivity data.

    So the entire parsing contains two iterative loops: one loop for the isolate, and then for each isolate, another loop for the associated drug sensitivity data.

    Parsing and writing the lab sample attributes is straightforward. But what would be the best approach for the two loops?

    Thanks,
    Dave

  • #2
    Rearsing a microbiology lab result message

    Perhaps with something like this....

    Code:
    var micCounter=0;
    var antCounter=0;
    
    for(micCounter=0;micCounter<msg['OBX'].length()>micCounter;micCounter++){
       if (msg['OBX'][micCounter]['OBX.3']['OBX.3.1']=....){/*┬┐Is the OBX describind an organism ? */
          var subId=msg['OBX'][micCounter]['OBX.4'].toString();
          for(antCounter=micCounter+1;antCounter<msg['OBX'].length()>antCounter;antCounter++){
             if (msg['OBX'][micCounter]['OBX.4']=subId....){
               //Do susceptibility sutf
          }
       }
    }

    Comment


    • #3
      Rearsing a microbiology lab result message

      Hi,

      sorry for the intrusion but, albertosaez, where should I write this javascript code?, in transformer?, in preprocessor?. is there any published channel with this kind of algorithm?.

      Thanks in advance,

      Ricardo Bernat

      Comment


      • #4
        Rearsing a microbiology lab result message

        This code should be in one Javascript step.

        AFAIK, you're the first one who ask for this issue, so I don't think you could find any code in the forum.

        The code I've posted is very simple. It reads all the OBX segments, and search for the ones which describes organism (I don't know how your message, so I don't know how it can be found), and then, search the rest of OBX segments to find the one which the same sub-id.

        Alberto.

        Comment


        • #5
          Rearsing a microbiology lab result message

          Hi all,

          first of all, thanks for your answer. On the other side, I'm trying to process HL7 files with multiple OBX segments for blood analysis data recover. Every segment has specified a name, a value and units, and this is my target, recover all this information.

          Should I put this script in a transformer step?....then destination definition will be superseded by the script, isn't it?.

          Thanks again for your help,

          Ricardo Bernat

          Comment


          • #6
            Rearsing a microbiology lab result message

            Thanks Alberto. I too would like to know the best location for this Javascript code. I guess the choice would be in the database writer vs the output transformer. (Doesn't make much sense to put it in the output filter, for example.)

            Also, does Mirth use the Mozilla Javascript engine? If so, which version is used: 1.5, 1.6, 1.7 or 1.8? And is the entire Javascript spec for that version supported (i.e. the entire spec according to the Mozilla Javascript site:

            http://developer.mozilla.org/en/docs/JavaScript
            )

            Thanks,
            Dave

            Comment

            Working...
            X