renumbering segments after suppressing

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf renumbering segments after suppressing

  • Creator
    Topic
  • #50686
    Yamil Velez
    Participant

      Hi all

           

           I would like to know if there is a way to renumber the segments after you suppress them.

         For example this the original

      DG1|1|FF||NEWBORN||A|||||||||0

      DG1|2|I9|V30.00|SINGLE LB IN-HOSP W/O CS||AM

      DG1|3|I9|V30.01|SINGLE LB IN-HOSP W CS||F|||||||||1

      DG1|4|I9|771.81|NB SEPTICEMIA [SEPSIS]||F|||||||||2

      DG1|5|I9|770.89|RESP PROB AFTER BRTH NEC||F|||||||||3

      DG1|6|FF||NEWBORN||W|||||||||1

      DG1|7|FF||||W|^015|627|||||0.00

      after my suppression I have the following

      DG1|2|I9|V30.00|SINGLE LB IN-HOSP W/O CS||AM

      DG1|3|I9|V30.01|SINGLE LB IN-HOSP W CS||F|||||||||1

      DG1|4|I9|771.81|NB SEPTICEMIA [SEPSIS]||F|||||||||2

      DG1|5|I9|770.89|RESP PROB AFTER BRTH NEC||F|||||||||3

      Can I renumber them so they start at 1 and end at 4

      Thanks

      Yamil

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

          Yamil,

          In your ITERATE Action inside your IF Action that determines which segments will or won’t be built, you will need to keep your own counter (I use a temp variable like @dg1_ctr).

          I usually initialize my counter at the beginning of the Xlate (COPY =0 –> @dg1_ctr).

          Then at the appropriate point in the Xlate, I do a MATH ADD Action @dg1_ctr =1 –> @dg1_ctr. Then I COPY @dg1_ctr to the DG1 Set-ID field (DG-1).

          That way as you construct each outbound segment you number the Set-ID appropriately.

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

        • #67101
          Yamil Velez
          Participant

            Thank you Jim

            It work

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