Creating one OBX.5 from multiple OBX’s

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Creating one OBX.5 from multiple OBX’s

  • Creator
    Topic
  • #53505
    Gordon Koch
    Participant

      Hello Clovertechers,

         I have a problem where I want to grab data from multiple OBX.5 fields (obviously the inbound OBX segment iterates) and place specific data in a single OBX segment. This is working fine most of the time via basic iterate functionality with IF statements picking out the desired data, which is placed in variables to be CONCAT’ed in the outbound OBX.5 field. However, the order of the inbound OBX segments appear to impact whether I can grab my data in the IF statement. For example, my primary hook in a nested IF statement (which is the basis of the outbound OBX) needs to occur after the other OBX’s from which I am grabbing data and placing in variables. Otherwise, I do not collect all the desired pieces. Any input is appreciated.

      Thank you.

    Viewing 5 reply threads
    • Author
      Replies
      • #77914
        Jim Kosloskey
        Participant

          Gordon,

          Can you share more detail?

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

        • #77915
          Robert Kersemakers
          Participant

            What you could do in this case is iterate twice through the OBX segments.

            First iterate through the OBX segments and gather all the information you need, without writing data to the outbound message.

            Then iterate a second time through the OBX segments to write the outbound message. This time you will always have your gathered information complete and you can use your already working IF statement.

            Hope this helps.

            Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

          • #77916
            Gordon Koch
            Participant

              Hello Jim,

                  I added a screen shot of the Xlate in the attached Word document. Basically I am not capturing the desired data in the @specdate variable when the OBX containing this data is last. It is is the nested IF statement where I am interrogating the @result variable that the outbound OBX segment is constructed.

              Thank You.

            • #77917
              Gordon Koch
              Participant

                Hello Robert,

                   I think I am basically doing this by putting my data in the variables. I do understand your point, where I am “losing” some of it when I construct the outbound OBX. However, I am not sure where to do the second iterate.

                Thanks.

              • #77918
                Robert Kersemakers
                Participant

                  You would do your second iterate immediately after your first iterate. You will need to decide though which lines of your current iteration go in the first iterate, and which in the second. To keep things easy/readable, I would advise to:

                  * put all the lines that gather information and store the information in variables, in the first iterate.

                  * put all the lines that transfer information to the outbound message, in the second iterate.

                  I have included a screen-print of an Xlate with 2 iterations. The second iteration has the same basis as the first.

                  Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

                • #77919
                  Gordon Koch
                  Participant

                    Hello Robert,

                       Thank you for the example. I will look to restructure may Xlate along those line.

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