ORU messages insert %PAGE% in between OBX’s

Clovertech Forums Read Only Archives Cloverleaf General ORU messages insert %PAGE% in between OBX’s

  • Creator
    Topic
  • #51808
    mary brewer
    Participant

      I am receiving ORU^R01 messages from Xcelera cardio pacs system.

      The formatted text is fine with the exception of no page breaks.. It is just one OBX after another.. Currently, I have an Xlate where I am converting the ORU and doing some formatting.. What I need to do is insert (after 55 lines) and OBX segment with %PAGE%. Basically a loop.. Has anyone done this with OBX’S in an ORU before?

    Viewing 3 reply threads
    • Author
      Replies
      • #71819
        Jim Kosloskey
        Participant

          Mary,

          I have done something similar in the past.

          No Tcl.

          You will need your own destination repetition counter.

          You will need a counter to count the number of lines.

          At the beginning of your Xlate copy =0 to your own repetition counter (since the OBX is a group normally probably a %gnn). I like to use 99 as a starting point for my counters (hence %g99). That give me a visual hint this is probably my counter and not one owned by an ITERATE.

          This would be COPY =0 –> $%g99  (note the $ in front of the %g99).

          Copy =0 to your line counter (a temp variable of your naming – let’s say @line_cnt for this example).

          ITERATE over the OBX (typically a group) – let’s say %g1 is the counter used in this ITERATE.

             Inside the ITERATE:

                  COPY …(%g1).OBX…  –> …(%g99).OBX… (or use PATHCOPY same address pathing – note the use of %g99 for the destination).

                  MATH ADD =1 @line_cnt –> @line_cnt (increment the line counter so we can tell when we have another 55 OBXs)

                 Check @line_cnt equal 55

                    Yes –  MATH ADD =1 $%g99 –> $%g99

                        Above we are incrementing our repetition counter again note the $ in front of the %g99.

                      COPY =%PAGE% –> …(%g99).OBX…  This gets the value to the next OBX

                       COPY =0 to @line_cnt (reset the line counter) because we have reached 55 and want to be ready for the next

                    Else

                      MATH ADD =1 $%g99 –> $%g99  (increment our repetition counter for the next OBX).

          The above is the essentials of what needs to be done taken from memory – you may need to tweak it somewhat.

          The main thing is to have confidence this can be done inside the Xlate.

          By the way, there is a prescribed notation in HL/7 for indicating new page involving the use of the escape character.

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

        • #71820
          mary brewer
          Participant

            Hi Jim,

            Thank you.. I will keep plugging.. I have made some progress and totally want to stay inside the xlate as I would think it would work also.. .

            will keep you posted…

          • #71821
            mary brewer
            Participant

              Hi Jim, I am making progress, but think I am still off…

              Can you look at this and give me your throughts.

              I have put a screen shot in this attachment so you can look.

              Thank you in advance for your help.

              Mary

            • #71822
              mary brewer
              Participant

                Hi Jim,

                It worked!!!!!!!!!! yeah… I am going to leave happy today.. Thanks a bunch  ðŸ˜€  ðŸ˜€

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