Combine obx’s into one

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Combine obx’s into one

  • Creator
    Topic
  • #54419
    Andrea Mancini
    Participant

    i’ve been reading a lot of posts about this but can’t really find a solution.  What I want to accomplish is to combine all OBX-5’s into the first OBX-5 and remove the rest of the OBX’s.  My problem is not with the concatenation. I’ve built the string and can populate OBX-5 with the right data.

    For some reason though when I Pathcopy the first OBX instance, it creates the other 3 OBX’s with empty segments. This is what I can’t understand. I’m using 0’s for my iteration counters. However, in

    the past I have been able to delete segments using the @null Pathcopy method but that’s when I have a bulkcopy at the top of the script.  So I’ve attempted to try to pathcopy just the first OBX along with using the @null Pathcopy method with no luck. i’m using a group iterator not a segment because that’s what my variant is.  If screenshots would be helpful, let me know.  Thank you!

Viewing 1 reply thread
  • Author
    Replies
    • #81379
      Jim Kosloskey
      Participant

      Andrea,

      Here is the way I would approach this:

      ITERATE through the OBX Group (say using %g1).

      Inside that ITERATE:

      COPY each OBX field EXCEPT OBX-5 using 0 for the group position inbound and outbound.

      CONCAT

        Source

        ~OBX(0.#5                 <–Note the tilde for outbound in Source

         ….(%g1).OBX(0).#5   <– The current OBX-5 repetition

         Destination

         …(0).OBX(0).#5

      The above is for when you want the resultant OBX-5 to contain all of the inbound OBX-5 NOT as a repeating field.

      IF you really want the outbound OBX-5 to be repeating:

      ITERATE over OBX group (%g1) inside:

         COPY each OBX field EXCEPT OBX-5 using 0 for the group position inbound and outbound.

         COPY …(%g1).OBX(0).#5(0) –> …(0).OBX(0).#5(%g1)

         The above COPY copies each repeating Group OBX-5 to the first repeating OBX-5 FIELD.

      If this is not clear then screen shots would help.

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

    • #81380
      Andrea Mancini
      Participant

      Hi Jim,

      Thanks for the info.  I did not try your method, but I changed my OBX in my variant to “optional” and the blank segments disappeared.  I think they were showing up because my variant was set so that the OBX segment was not optional within each OBX/NTE group – which I had one.

      BEFORE

      [

        {

             OBX

             [{NTE}]

        }

      ]

      AFTER

      [

        {

             [OBX]

             [{NTE}]

        }

      ]

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

Forum Statistics

Registered Users
5,119
Forums
28
Topics
9,293
Replies
34,435
Topic Tags
286
Empty Topic Tags
10