Iterate groups

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Iterate groups

  • Creator
    Topic
  • #49142
    lisa sater
    Participant

      Hi,

      I am working on with ORM^O01 message.  The IB variant is:  

      MSH

      PID

      PV1

      ORC

      [{NTE}]

      [

       {

           OBR

           [OBX]

        }

      ]

      The OB variant is:

      MSH

      PID

      PV1

      ORC

      [

       {

           OBR

           [{NTE}]

           [OBX]

        }

      ]

      In the translator I have the iterates working for the OBR and NTE segments, but when I add the OBX segment in, I loose the 2nd and 3rd OBR segments.

      This is the iterate section that will give me each OBR followed by NTEs.  But I need the OBXs to follow the NTEs.

      { { OP ITERATE }

         { BASIS 1(0).0(0) }

         { VAR %g1 }

         { TYPE group }

         { BODY {

             { { OP COMMENT }

                 { COMMENT {getting all the OBR segs} }

             }

             { { OP PATHCOPY }

                 { ERR 0 }

                 { IN 1(0).0(%g1).OBR }

                 { OUT 1(%g1).0(0).OBR }

             }

             { { OP COPY }

                 { ERR 0 }

                 { IN {{0(0).ORC.#4.[0]}} }

                 { OUT {{1(%g1).0(0).OBR.#2.[0]}} }

             }

             { { OP ITERATE }

                 { BASIS 0(0).NTE }

                 { VAR %s1 }

                 { TYPE segment }

                 { BODY {

                     }

                     { { OP PATHCOPY }

                         { ERR 0 }

                         { IN 0(0).NTE(%s1) }

                         { OUT 1(%g1).0(0).NTE(%s1) }

                     }

                 }}

             }

         }}

      }

      Results:  

      1(0).0(0).ORC(0)  :  >|NW|031507:RI1^LAB||2186||N|^^^^^R||200703151313< 1(0).1(0).OBR(0)  :  >|1|031507:RI1^LAB||2627^CYTOMEGALOVIRUS CULTURE, RAPID^L|||200703151312|||||||200703151313||^O’BRYANT^LARRY^K^^^M.D.||||||||LAB|||^^^^^R< 1(0).1(0).NTE(0)  :  >|1||02/02/07 1252 DUDOMED,< 1(0).1(0).NTE(1)  :  >|2||STUCK X2< 1(0).1(0).NTE(2)  :  >|3||PT FEELING FAINT AFTER FIRST STICK< 1(0).1(1).OBR(0)  :  >|2|031507:RI1^LAB||2692^HERPES SIMPLEX VIRUS CULTURE^L|||200703151312|||||||200703151313||^O’BRYANT^LARRY^K^^^M.D.||||||||LAB|||^^^^^R< 1(0).1(1).NTE(0)  :  >|1||02/02/07 1252 DUDOMED,< 1(0).1(1).NTE(1)  :  >|2||STUCK X2< 1(0).1(1).NTE(2)  :  >|3||PT FEELING FAINT AFTER FIRST STICK< 1(0).1(2).OBR(0)  :  >|3|031507:RI1^LAB||34429^T3 FREE^L|||200703151312|||||||200703151313||^O’BRYANT^LARRY^K^^^M.D.||||||||LAB|||^^^^^R< 1(0).1(2).NTE(0)  :  >|1||02/02/07 1252 DUDOMED,< 1(0).1(2).NTE(1)  :  >|2||STUCK X2< 1(0).1(2).NTE(2)  :  >|3||PT FEELING FAINT AFTER FIRST STICK< When I add the OBX to the mix: Xlate { { OP PATHCOPY }            { ERR 0 }            { IN 1(0).0(%g1).OBX }            { OUT 1(%g1).1(0).OBX } The Results is: [0:TEST] [mid:0x67fcf63c] The # 9 segment encountered ‘OBR’ is out of order for message type ‘ORM_O01’.  Segment ignored. [0:TEST] [mid:0x67fcf63c] The # 14 segment encountered ‘OBR’ is out of order for message type ‘ORM_O01’.  Segment ignored. 1(0).0(0).ORC(0)  :  >|NW|031507:RI1^LAB||2186||N|^^^^^R||200703151313< 1(0).1(0).OBR(0)  :  >|1|031507:RI1^LAB||2627^CYTOMEGALOVIRUS CULTURE, RAPID^L|||200703151312|||||||200703151313||^O’BRYANT^LARRY^K^^^M.D.||||||||LAB|||^^^^^R< 1(0).1(0).NTE(0)  :  >|1||02/02/07 1252 DUDOMED,< 1(0).1(0).NTE(1)  :  >|2||STUCK X2< 1(0).1(0).NTE(2)  :  >|3||PT FEELING FAINT AFTER FIRST STICK< 1(0).2(0).0(0).OBX(0)  :  >|1|TX|LAB.SRCE^CULTURE SOURCE?||CSF< 1(0).2(0).0(0).NTE(0)  :  >|1||02/02/07 1252 DUDOMED,< 1(0).2(0).0(0).NTE(1)  :  >|2||STUCK X2< 1(0).2(0).0(0).NTE(2)  :  >|3||PT FEELING FAINT AFTER FIRST STICK< If someone has some suggestions that would be great.  Thanks! Lisa

    Viewing 1 reply thread
    • Author
      Replies
      • #60876
        Robert Gordon
        Participant

          You have an input record which is good.  Now you need an output sample from your input.  When you have them both run the output through the tester under HL7 and look at what the results look like (run this several times and find more detail).  It will help you find any problem faster and effectively.

        • #60877
          lisa sater
          Participant

            Thanks, this is solved.  The OB Variant name was ORM_MDH and with a copy or pathcopy it was reverting to the ORM_O01 OB message structure.

        Viewing 1 reply thread
        • The forum ‘Cloverleaf’ is closed to new topics and replies.