Controlling iterates help

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Controlling iterates help

  • Creator
  • #51362
    Jodi Agosta2

    Hi All, Is there a way to control an iterate (say a %s1, can I do a %s1+1 or set %s1 to 3 etc?).  

    Here is the request I recieved. I have a non standard ORM coming in. In it it has multiple DG1s, NTEs and OBR’s in the format of






    They are requesting that these be outputed to  ORU OBX segments. They also want a hardcoded set OBX and some PID data added to the first part of the OBX to make a header of sorts. I am at a loss as to how to do this without having some control over the iterates of OBX. I would need to move the hard code to OBX 1. The PID info to OBX 4,5,and 6. and then iterated OBR,NTE, and DG1’s through the next OBX segments repeating as needed.  Does that make sense? So I would have to set %s1 to a number to start the iteration and then control it throughout.  This probably could be done through a program also but it sounds way to complex for my skills.

    Has anyone done this before?



Viewing 6 reply threads
  • Author
    • #69885

      Yes indeed! I would suggest doing and a forum search for “xlate” and “iterate” (search for all terms). There are several real good threads discussing the subject.

      Here is one of the many good threads:

      -- Max Drown (Infor)

    • #69886
      Jodi Agosta2

      Thanks Max,

      Will do. The thread you gave me is giving me some great ideas on how to make this work.

      Much appreciated!!

    • #69887
      Jim Kosloskey

      You are going to need to use your own counter for the outbound repetitions (OBX for example).

      I like to make my counters start with 99 – so for example if I need a segment counter I would use %s99 as my counter.

      This stands out to me then when looking at the Xlate when I see counters in the 90s that these are counters I am managing. Of course I also put in lots of comments to help.

      I would not recommend changing the inbound counters (the ones actually specified in the ITERATEs – beside I do not think you will need to.

      To reference any counter (yours or the Xlates) as a variable (As in the MATH ADD Action) you need to add a $ – like this: $%s99.


    • #69888
      Jodi Agosta2

      Right now I am trying to figure out why my add is not working. Mind you I have never done this before but it seems to be straight forward. Here is what I have

      COPY {=Hospital Name}->{1(0).1(0).1(%s99).OBX.00573.[0]

      MATH:ADD =1->{$%s99}

      COPY {=Patient Name}->{1(0).1(0).1(%s99).OBX.00573.[0]

      Keeps clobbering  the hospital name.

      If I substitute a static address it looks fine.

      btw I am on a windows machine running v5.4.

      Thanks for the help.

    • #69889
      Tom Rioux


      On your MATH ADD try this:

      =1 $%s99 —> $%s99

      Hope this helps…

      Tom Rioux

    • #69890
      Jodi Agosta2

      Thanks Thomas, will do.  I did finally get it to iterate but on the wrong value (%g1 instead of my $%s99) . I plan to play with it this afternoon.  I don’t know how I got away with not knowing this for so long. It looks pretty powerful, I just need to figure it out.

    • #69891
      Jodi Agosta2

      Max, Jim, Thomas,  

      You guys are the greatest. Once I got the hang of it , it was amazingly easy to do.  Thanks for giving me such good advise. Very much appreciated.


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

Forum Statistics

Registered Users
Topic Tags