More Itertate OBX help

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf More Itertate OBX help

  • Creator
    Topic
  • #53440
    Cliff Stark
    Participant

      I am not real clear on how to iterate messages so anyone’s help would be greatly appreciated.  I am simply trying to iterate the OBX segment on the attached xlate.  Please take a look.  I have searched the forums but still am not understanding.

      Thank you very much!

    Viewing 3 reply threads
    • Author
      Replies
      • #77710
        Gary Atkinson
        Participant

          Your translation is a bit confusing.  Do you have multiple obr.obx groupings in your message?  If so, you should nest your iterations.  Also, the basis is not shown so there may be issue there too.  Run an example message in hl7tester with level3, this will show you were iterations are occurring.

        • #77711
          Keith McLeod
          Participant

            Your basis appears to b e incorrect.  You should never use the variable in your basis that you are just defining.  %f1 is just being defined.  It is used for the field repetition counter in your case.  Notice that the basis drops off the (0) after the #5.  That is where the variable that you are defining will be used.

            #5(%f1)

            Your iterates should start at the PID grouping, with 1 as your basis and %g1 as the variable, next inside the PID iterate group would be the ORC iterate group with 1(%g1).1 as you first nested basis with a variable of %g2, third would be the OBX/NTE grouping inside the ORC grouping with the basis 1(%g1).1(%g2).1 and %g3 as the variable.  Last would be the field iterate nested under these iterates with the basis  1(%g1).1(%g2).1(%g3).OBX(0).#5 with variable %f1.

            The variables become counters.  Lets say the PID group usually has one group per messaage.  The %g1 would have the value 0.  Inside that group it contains all segments down through CTI.  In your message strructure that is where the top curly brace end.  It could have multiple ORC groups stating with the curly brace before the ORC sement.  %g2 will count the number of times that ORC and all the segments contained within the curly braces that define that group.  Notice that OBX and NTE are grouped, and the 3rd counter %g3 counts those repetitions.  Finally if you are after the repeating contents of OBX:5, the %f counts the repetitions of the OBX:5 field usually by the repetition character.

            As Gary has indicated, make use of your testing tool and review the message with the level turned up.  You will then see the numbers increment based on those iterations.  The real trick is that once you understand your inbound addresses, is to make use of those variables in the outbound if you choose to contruct your messages diffently.  For instance if you wanted to copy each field repetition into its own OBX segment, you might have something like:

            1(%g1).1(%g2).1(%g3).OBX(0).#5(%f1) –> 1(%g1).1(%g2).1(%f1).OBX(0).#5

            Notice the use of %f1 instead of the %g3 on the outbound side of the copy.  Without testing….but this should create a new OBX segment for each field repetition.  Of course there is cleanup etc… required to make this happen cleanly….  Happy motoring!!!

          • #77712
            Cliff Stark
            Participant

              I have tried every way I can think of and still not able to get this to work.  Should my iterate be repeating the group or field?  I have it set to field but I’m not getting anywhere.  

              Thank you for your help.

            • #77713
              Tom Rioux
              Participant

                Here is a little trick I use when I have trouble with a messy iterate situation.   I take the incoming message and run it through the HL7 tester in the testing tool.   Turn the detail up to like 3 or 4.   The output should give you an idea of when and where you should be iterating.

                Hope this helps…

                Tom Rioux

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