IF then through repeating segments

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf IF then through repeating segments

  • Creator
    Topic
  • #49438
    Mark Perschbacher
    Participant

      Is there a way to run an IF THEN expression through repeating segments?  To be specific, I am trying to null out all F’s in OBX-11 of an ORU in an xlate.  The way our lab system parses out the OBX,  it can repeat  at either 1(0).1(0).1(x).OBX or 1(0).1(0).1(0).OBX.(x)  I have tried setting up an Iterate with a group variable %gx, and then Copy @null to the %g1 and %g2, but it seems like the IF statement is only looking at the first matching segment.

    Viewing 1 reply thread
    • Author
      Replies
      • #61964
        Mike Grieger
        Participant

          Yes.  If you have the correct basis identified for the iterate, you just use the iteration variable in your IF statement and in the copy statements to your target.

          Lets say you have your basis as: group, 1(0).1(0).1(0), %g1

          You use that variable in your IF:

            IF 1(0).1(0).1(%g1).OBX.#11.[0]  eq =F

          and in your copy

            COPY  @null   to   1(0).1(0).1(%g1).OBX.#11.[0]

          (These paths may not be 100% correct – I’m kind of winging it, but hopefully you get the idea.  The thing you need to do is get the iterate right.  The Xlate testing tool – on a basic, plain bulk copy Xlate – is helpful for finding the basis and putting the basis variable in the right spot.)

        • #61965
          Mark Perschbacher
          Participant

            Thanks alot, that is just what I was wondering about

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