How to identify last OBX ?

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf How to identify last OBX ?

  • Creator
    Topic
  • #55449
    Omair Haq
    Participant

      Hello,

      I need some assistance from seasoned cloverleaf analysts. I’m trying to suppress the very last OBX in my XLATE, if the OBX-5 is blank. I can have blank OBX-5 in the middle, but the very last one PACS is rejecting the message. Does anyone has encounter this before? I’m thinking to put a counter of the OBX, but I don’t know how to evaluate the counter if the OBX is last?

      Can someone please assist me? Much appreciate.

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

          Xlate –

          A couple of ways:

          ITERATE through OBX group COPYing the ITERATE Counter (the %g value specified in the ITERATE Action) to a temp variable. At the end of the ITERATE the temp variable contains the number of OBX found. Then ITERATE again this time checking the value of the counter against the value in the temp variable. If it is less than the temp variable, do the build of the OBX. The last one won’t get built.

          ITERATE through the OBX group building the outbound and COPYing the ITERATE Variable to a temp variable. When the ITERATE is finished the temp variable has the position of the last OBX Group. COPY the temp variable to the ITERATE Counter and COPY @null to the OBX Group referenced by the updated ITERATE Counter (can use PATHCOPY if you like). This, in most cases, will null out the last OBX.

          Harold Victoria can show you how to reference the ITERATE Counter as a Source or Destination item or email me and I will work through this with you.

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

        • #85379
          Keith McLeod
          Participant

            Here is an alternative.

          • #85380
            Charlie Bursell
            Participant

              I know Jim always prefers Xlate but this is done simply in Tcl

              Assumes you have segments in segList

              # list of OBX locations

              set posList [lsearch -regexp $segList {^OBX}]

              # Last OBX split into fields

              set OBX [split [lindex $segList [lindex $posList end]] $fldsep]

              # See if OBX5 empty or just spaces

              if {{string trim [lindex $OBX 5]] eq “”} {

                   # remove last OBX

                   lvarpop segList [lindex $posList end]

              }

              msgset $mh [join $seglist r]

              etc.

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