Adding "title" Obx before the rest of the iteratio

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Adding "title" Obx before the rest of the iteratio

  • Creator
    Topic
  • #50585
    Gina Borden
    Participant

      I have a lab translate that I iterate through all the OBX segments. (see attached screenshot of translate)  I would like to add a line at the beginning of the interations with “titles” in OBX.3, OBX.5, and OBX.7.

      Currently my message comes out like this:

      OBX|1|ST|MLI-5603^Anti – HCV||See ARUP Report||Negative||||F

      I would like it to come out like this:

      OBX|1|ST|MLI-5603^TEST||RESULT||RANGE||||F

      OBX|2|ST|MLI-5603^Anti – HCV||See ARUP Report||Negative||||F

      If anyone has any suggestions, I would greatly appreciate them.  I am not great with tcl.

      Thanks,

      Gina

    Viewing 1 reply thread
    • Author
      Replies
      • #66694
        Robert Milfajt
        Participant

          If I understand, you want to put the title in once before the rest of the OBX’s.  Simple.

          First add a COPY statement (or many if you prefer to do it field by field) before your iterate to add the title data.  Use the value 0 where %g2 is from the following iterate.

          Code:

          COPY =RANGE -> 1(0).1(%g1).1(0).OBX(0).00575

          Next before you enter the iterate, initialize a variable to keep track of the next OBX statement you are going to set, call it %x1.

          Code:

          COPY =1 -> $%x1

          Now in your iterate, for each copy to field, replace %g2 with %x1.  The copy from stays %g2.  For example:

          Code:

          COPY 1(%g1).1(%g2).OBX.00569 -> 1(0).1(%g1).1(%x1).OBX(0).00569

          Lastly, at the end of the iterate, add one to the %x1 counter.

          Code:

          MATH: ADD  =1 $%x1 ->$%x1

          Hope this helps,

          Robert Milfajt
          Northwestern Medicine
          Chicago, IL

        • #66695
          Gina Borden
          Participant

            That’s perfect!

            Thanks a lot!

            Gina

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