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

Repetition of segments in HL7

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

  • Repetition of segments in HL7

    The xml that I am trying to map to HL7 has multiple Insurances.
    Looping works fine but when the actual HL7 message is created it adds the extra IN1 segment at the last line in HL7.

    Example

    MSH|^~\&|PURK|TEST1334|1100|SE|200809050851||ORM|| P|2.2
    PID|1|498043|||MOUSE^MICKEY||19701102|M|||123MAIN ST^^OLYMPIA^WA^98210||2531134567||||||
    PV1|1||||||I111^WELLOCK^MATTHEW^^^^^U
    IN1|1|||MEDICAID OF MAINE|04330^^AUGUS|||22222|||||||MC||1|||||||||||| |||||||111111111|
    GT1|1||MOUSE^MINNIE^S||123 MAIN ST^^OLYMPIA^WA^98210|5555555555|||||1|||||||
    DG1|1|I9|780.4
    IN1|2|||MEDICAID|62794^^Springfield|||3333333||||| ||MC||1|||||||||||||||||||111111111|

    Thanks..

  • #2
    Re:Repetition of segments in HL7

    srinivasay wrote:
    The xml that I am trying to map to HL7 has multiple Insurances.
    Looping works fine but when the actual HL7 message is created it adds the extra IN1 segment at the last line in HL7.

    Example

    MSH|^~&|PURK|TEST1334|1100|SE|200809050851||ORM||P |2.2
    PID|1|498043|||MOUSE^MICKEY||19701102|M|||123MAIN ST^^OLYMPIA^WA^98210||2531134567||||||
    PV1|1||||||I111^WELLOCK^MATTHEW^^^^^U
    IN1|1|||MEDICAID OF MAINE|04330^^AUGUS|||22222|||||||MC||1|||||||||||| |||||||111111111|
    GT1|1||MOUSE^MINNIE^S||123 MAIN ST^^OLYMPIA^WA^98210|5555555555|||||1|||||||
    DG1|1|I9|780.4
    IN1|2|||MEDICAID|62794^^Springfield|||3333333||||| ||MC||1|||||||||||||||||||111111111|

    Thanks..
    Post your channel, if this is happening when you build a message it is likely a bug in your message building code/query .
    Jon Bartels

    Zen is hiring!!!!
    http://consultzen.com/careers/
    Talented healthcare IT professionals wanted. Engineers to sales to management.
    Good benefits, great working environment, genuinely interesting work.

    Comment


    • #3
      Re:Repetition of segments in HL7

      Here is the channel.. LabCorp_Outbound_Channel.xml (72077 bytes)

      Comment


      • #4
        Re:Repetition of segments in HL7

        I don't see anything specifically wrong, but I would guess that it is an issue with what order your JS gets processed in. The repeating segment is valid and correct, just not in the right position so it has to be a bug when you build your message.
        Jon Bartels

        Zen is hiring!!!!
        http://consultzen.com/careers/
        Talented healthcare IT professionals wanted. Engineers to sales to management.
        Good benefits, great working environment, genuinely interesting work.

        Comment


        • #5
          Re:Repetition of segments in HL7

          I appreciate your help...

          What I noticed is, Outbound Message Template content takes precedence over the javascript. Looks like as mapping starts, first the template values are filled and if there is any remaining content its just added at the bottom.

          Any thoughts on this...

          Thanks..

          Comment


          • #6
            Re:Repetition of segments in HL7

            I am evaluating this software...
            Please help me on this..

            Comment


            • #7
              Re:Repetition of segments in HL7

              I had a chat with srinivasay on IRC this morning. He indicated he is evaluating Mirth to replace Cloverleaf.

              I think what is happening is that the individual blocks of code that process a single segment from his source message are being called in the same order that the source message has them. What should happen is that when one segment is handled it should loop and pop the other segments of the same type off the source message and process them. So if the source order is PID, PV1, IN1, BLA, XXX, IN1 it needs to process in PID, PV1, IN1 *loop and get the other IN1*, BLA, XXX.

              I didn't have time to import the channel so I might be wrong.

              Can another expert have a look and offer advice or a clarification?
              Jon Bartels

              Zen is hiring!!!!
              http://consultzen.com/careers/
              Talented healthcare IT professionals wanted. Engineers to sales to management.
              Good benefits, great working environment, genuinely interesting work.

              Comment


              • #8
                Re:Repetition of segments in HL7

                Yes, it is correct that the Outbound Message Template takes precedence over the javascript. The javascript code will then build upon the outbound message template so it's better to only provide mandatory segments in the outbound template, and insert any optional segments using javascript in whichever order you'd like.

                The outbound template you provided already has an IN1 segment. so the first insurance data will be mapped to that segment, and any additional insurance data will then create another IN1 segment (by default any newly created segment gets appended to the end of the message unless you specifically assign where to insert).

                If you want the IN1 segments to be grouped together, try this.

                for (var i = 0; i < msg['HEADER']['SPECIMEN_GRP']['PAT_INS'].length() ; i++) {
                newIN1segment = new XML("<IN1></IN1>");
                newIN1segment['IN1.1']['IN1.1.1'] = i + 1;
                ...
                ...

                // assuming the very first IN1 segment will be the 4th segment in order.
                tmp.insertChildAfter(tmp.*[4+i], newIN1segment);
                }
                Chris Ro
                Sr. Software Engineer | Mirth Corporation

                Comment


                • #9
                  Re:Repetition of segments in HL7

                  Thanks chrisr... your logic worked....
                  But I have a concern with creating a new XML object and then trying it to insert into the main HL7 xml. I think this will impact the performance..

                  Please post thoughts on this....

                  Comment


                  • #10
                    Re:Repetition of segments in HL7

                    From my experience, (I've developed many many channels), the impact on performance is minimal if any. It's not like we're creating hundreds and thousands of new objects, and even then it'd be hardly noticeable, and after each time a message is processed, Java GC will take care of any unused object.
                    Chris Ro
                    Sr. Software Engineer | Mirth Corporation

                    Comment

                    Working...
                    X