Iteration Issue

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Iteration Issue

  • Creator
    Topic
  • #54837
    Gina Borden
    Participant

      I need to break a message into new messages every 25 DG1 segments.  I created a variable iteration, and it works perfectly, except for the last group of iteration.  See in the example below, I have 95 DG1 segments, it splits it into 4 messages, but 4th message should only have the remaining 20 DG1’s (76 – 95), so it fills in the extra 5 with the previous messages last 5 (71 – 75).

      Attached is a snapshot of my translate.  I really feel I need a Supress in there somewhere, but I can’t figure out where it needs to go.

      Any help is greatly appreciated.

      Example

      DG1|90|0|Z95.5|||DF|010|637||||||DF|39|019364||||||||||E

      DG1|91|0|Z95.1|||DF|010|637||||||DF|40|019364||||||||||E

      DG1|92|0|Z99.2|||DF|010|637||||||DF|41|019364||||||||||1

      DG1|93|0|I25.2|||DF|010|637||||||DF|42|019364||||||||||1

      DG1|94|0|Z99.81|||DF|010|637||||||DF|43|019364||||||||||1

      DG1|95|0|Z79.4|||DF|010|637||||||DF|44|019364||||||||||1

      DG1|71|0|K21.9|||DF|010|637||||||DF|20|019364||||||||||Y

      DG1|72|0|G47.33|||DF|010|637||||||DF|21|019364||||||||||Y

      DG1|73|0|F32.9|||DF|010|637||||||DF|22|019364||||||||||Y

      DG1|74|0|J98.4|||DF|010|637||||||DF|23|019364||||||||||Y

      DG1|75|0|D63.1|||DF|010|637||||||DF|24|019364||||||||||Y

      PR1|1|9|96.71||20150919|PC|||||017764|||1

      PR1|2|9|54.98||20150920|PC|||||005496|||2

      PR1|3|9|45.13||20150924|PC|||||021865|||3

      Thanks,

      Gina

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

          Your SUPPRESS should be unconditional.

          I usually place mine right at the beginning of the Xlate out in the open that way when anyone (including me ) looks at the Xlate later it is a reminder multiple messages are being built.

          What you need to do is to clear out the  DG1 segments after you CONTINUE to clear the decks for the next potential set.

          So ITERATE again (AFTER the CONTINUE) and either PATHCOPY @null to the group/segment or COPY @null to each field in the Group/Segment.

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

        • #83167
          Robert Kersemakers
          Participant

            Or clear the remaining (and already filled) segments before you send out your last message. You should have a counter that tells you where to start clearing the remaining DG1 segments: clear all DG1 segments until you hit 25.

            Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

          • #83168
            Jim Kosloskey
            Participant

              I do the cleanup after every message as you never know the number of repetitions with each message so even intermediate messages can have lingering data.

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

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