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

How to convert HL7 to XML tree with multiples OBR?

  • Filter
  • Time
  • Show
Clear All
new posts

  • How to convert HL7 to XML tree with multiples OBR?

    I'm new in MIRTH ... I already use it to change some data in HL7 segment and it works well, nut it was simple to do.

    I want to use MIRTH to change an HL7 ORM message in an XML tree. My HL7 ORM message contains many ORC/OBR. For example:

    ORC|NW|954^050901^019201^L|7000039^050901^003900^L ||||||200305081258|||003900
    OBR|1|954^050901^019201^L|7000039^050901^003900^L| ADEN2^^L|||20030508|||||||||019201|
    ORC|NW|954^050901^019201^L|7000039^050901^003900^L ||||||200305081258|||003900
    OBR|4|954^050901^019201^L|7000039^050901^003900^L| ACTDI^^L|||20030508|||||||||019201|
    ORC|NW|954^050901^019201^L|7000039^050901^003900^L ||||||200305081258|||003900
    OBR|8|954^050901^019201^L|7000039^050901^003900^L| ACASE^^L|||20030508|||||||||019201|

    How can I use MIRTH to create an XML tree (with one node for each OBR for example)?

    I don't really understand how to deal with multiples segments in filters/transformers/etc... Any information/documentation/sample is welcome.

    Thanks in advance for your help

    Post edited by: drouhne, at: 04/24/2008 01:52

  • #2
    Re:How to convert HL7 to XML tree with multiples OBR?

    Mirth automatically parses all types of incoming data into XML. You should already have the transformed message object available to use within Mirth.

    for example,

    var index = 0;
    msg['ORC'][index]['ORC.1']['ORC.1.1'] = value;

    You can copy/paste your sample ORM message into the Inbound Message Template, and see the tree structure of the message under the Message Tree tab. You can then drag and drop fields to see how the index works with multiple segments.

    Post edited by: chrisr, at: 04/24/2008 10:50
    Chris Ro
    Sr. Software Engineer | Mirth Corporation


    • #3
      Re:How to convert HL7 to XML tree with multiples OBR?

      Thanks chrisr,

      OK, I can browse the XML tree and create a new message. I suppose I have to do that in the destination transformer script but when I write my XML in message.rawData, the result is still the HL7 I have in entry ... Any idea?

      The next stop will be to split a HL7 message with multiple PID segments in N differents files with an XML tree for each partient. Any idea how to do that?

      Thanks again for your help


      • #4
        Re:How to convert HL7 to XML tree with multiples OBR?

        rawData means the original unmodified data. transformedData is the data automatically transformed into an XML format by Mirth. encodedData is the data in whichever format you selected as the output protocol. You're probably looking in the wrong place. There's little info to be able to help you with your next task. I don't think I've ever seen a HL7 message with multiple PID segments. but you can probably just loop through each PID segment and create a new HL7 message.
        Chris Ro
        Sr. Software Engineer | Mirth Corporation