If statement for Diet Orders

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf If statement for Diet Orders

  • Creator
    Topic
  • #55519
    Vanessa Rivera
    Participant

      Need to write this If statement in an xlate for diet orders. Any help is appreciated.

      If ODS.4.3 equals Supplement Type #1 and Freq #1

      place whats in ODS.4.2 from the Freq #1 ODS into ODS.4.3.

      This will have to repeat again if there is  #2 for both.  We only send the max of two supplements per message.

      This is what we have now:

      ODS|S|||Supplement Type #1^ Ensure High Protein

      ODS|S|||Supplement Type #2^ Juven

      ODS|S|||Freq #1^ BREAKFAST

      ODS|S|||Freq #2^ LUNCH

      This is what we want:

      ODS|S|||Supplement Type #1^ Ensure High Protein^ BREAKFAST

      ODS|S|||Supplement Type #2^ Juven^ LUNCH

      ODS|S|||Freq #1^ BREAKFAST

      ODS|S|||Freq #2^ LUNCH

    Viewing 0 reply threads
    • Author
      Replies
      • #85625
        Jim Kosloskey
        Participant

          Based on your information I think you will need nested ITERATEs.

          When you find a repetition of ODS (group or segment) where ODS-4.1 contains =Type #1 then do a second ITERATE checking for the ODS repetition where ODS-4.1 contains =Freq #1. Then COPY that repetition of ODS-4.2 to the first repetition set’s ODS-4.3.

          The same for Type #2.

          If you would like to discuss in more detail email me (click on email button in my signature) and I will walk through this with you.

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

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