Best way to move NTE segment from a PID to an OBX segment.

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Best way to move NTE segment from a PID to an OBX segment.

  • Creator
    Topic
  • #49325
    John Hamilton
    Participant

      I can think of a couple of ways to do this in different places.  I am wondering if anyone had a good reason for choosing one way over another.

      There may or may not be an NTE after the PID.

      The same statement can be made of the OBX.

      The setid will have to be sequential

      Convert —

      MSH

      PID

      NTE(P)  

      ORC

      OBR

      OBX

      NTE(O)

      To

      MSH

      PID

      ORC

      OBR

      OBX

      NTE(P)

      NTE(O)

    Viewing 2 reply threads
    • Author
      Replies
      • #61514
        Jim Kosloskey
        Participant

          John,

          My preference is to do this in an Xlate.

          Jim Kosloskey

          email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

        • #61515
          Bill Bertera
          Participant

            If you’re already using an Xlate, I would probably wait until you COPY the OBX(s), then iterate/copy through the PID-NTE(s). Then iterate copy/through the OBX-NTE(s), but for the destination field, use the variable from the PID-NTE iterate (%s1), which you manually increment in the PRE.

          • #61516
            Jim Kosloskey
            Participant

              John,

              You can do any iteration counter manipulation right within the Xlate (no Tcl required) if you like.

              For example let’s say you want to maintain your own iteration counter (let’s say you are already using %s1 and %g1) – perhaps %s2.

              Now let’s say you want to initialize %s2. You would do a COPY of =0 to $%s2 (note the $ in front of the counter).

              To add one to the counter you would do a MATH ADD =1 $%s2 to $%s2 (again note the use of the $). To use the counter in an address path you need to remove the $ and just use %s2.

              As Bill indicated you will need to maintain your own counter so that the reference to the outbound NTE segments following the OBX is independent of the inbound NTEs at either the PID or OBX.

              Jim Kosloskey

              email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

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