IN1 Rearrange by Insurance

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf IN1 Rearrange by Insurance

  • Creator
    Topic
  • #55322
    Lina Patel
    Participant

      Hello,

      Looking for best approach in Xlate for below IN1 insurance segment in ADT message.

      If IN1 – has a insurance type (A) in IN1-2, source order

      A, B, C, D

      request is output in destination order

      B, C, D, A

      Insurance type A would always be last.

      What would be best approach in XLATE.

      Thank you in advance for your insight.

      Lina

      🙂

    Viewing 3 reply threads
    • Author
      Replies
      • #84958
        Jim Kosloskey
        Participant

          Lina,

          Is the IN1-2 field in this instance actually constructed as A, B, C, D?

          Or is this a repeating IN group wherein there is a repetition for A another for B another for C, etc.?

          Or something else.

          I think more information is needed about the structure of the inbound and outbound.

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

        • #84959
          Lina Patel
          Participant

            Hi Jim,

            Thank you for your response.

            Here is an If statement from the Xlate (which I was unable to paste at this time)

            Below If statement is part if

            ITERATE

            group

            1(0).0

            %g1

            IF 0(0).PV1(0).#2(0) eq =O && 1(0).0(%g1).IN1(0).#2(0).[0] eq =MA01

            copy

            MA01 info last

            MA02 will be first

            BCBS second

            Self Pay if available third

            to

            destination structure

            1(0).0(%g1).IN1(0)

            all fields – including insurance name, address, type from source.

            Lina

            [/b]

          • #84960
            Jim Kosloskey
            Participant

              I am assuming you don’t care what the actual values are you just want the first to be last and all the others moved down one.

              I am also assuming there will not be a fixed number off repetitions.

              If there were a fixed number (like 4) then simply

              COPY all of the IN1 group expressed as 1(0).0(0).IN1(0) to 1(0).0(3).IN1(0) <– this will put the first last

              COPY all of the IN1 group expressed as 1(0).0(1).IN1(0) to 1(0).0(0).IN1(0) <– this puts the second first

              COPY all of the IN1 group expressed as 1(0).0(2).IN1(0) to 1(0).0(1).IN1(0)<– this puts the third second.

              If there are not a fixed number then you could do this:

              COPY =0 to $%g99

              COPY =0 to $%g98

              ITERATE over the IN group COPYing the %g1 value to %g99

              At then end of this ITERATE %g99 will have the count of the number of IN1 groups (relative to zero).

              then

              ITERATE over the IN group

                 Check if %g1 eq 0 (zero)

                   True COPY IN group (using %g1) to IN group (using %g99)

                 ELSE

                   COPY IN group (using  %g1) to IN group (using %g98)

                   MATH ADD =1 $%g98 to $%g98

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

            • #84961
              Lina Patel
              Participant

                Jim,

                As always, Excellent recommendations.

                Will try this.

                Appreciate your help.

                Lina

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