Creating multiple order messages from a single message

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Creating multiple order messages from a single message

  • Creator
    Topic
  • #49695
    Anthony Widjaja
    Participant

      Has anyone written a proc or design an xlate that will create multiple messages from a single message based on the # of OBR segment?

      For example:

      MSH

      PID

      PV1

      ORC

      OBR

      OBX

      OBX

      OBR

      OBX

      OBX

      OBX

      will generate 2 messages:

      MSH

      PID

      PV1

      ORC

      OBR

      OBX

      OBX

      and

      MSH

      PID

      PV1

      ORC

      OBR

      OBX

      OBX

      OBX

      Thanks,

      Anthony Widjaja

      Programmer Specialist/Integration Team Lead

      Parkland Health and Hospital System

      6300 Harry Hines, Suite 500

      Dallas, TX  75235

      V (214) 590-4743

      F (214) 590-4794

      P (214) 786-0259

      awidja@parknet.pmh.org

    Viewing 4 reply threads
    • Author
      Replies
      • #63154
        John Hamilton
        Participant

          Yes this can be done with an Iterfate within the Xlate.

          Just Iterate over the group and contiue at the end of the iteration.

          Create all the MSH, PID..ORC outside the iterate.

          Then within the iterate add the OBR & OBX Continue Add next OBR & OBX and continue.

        • #63155
          John Hamilton
          Participant

            Here is a translation that will do what you want.

            There is a bug in it that is a bit of a challenge.

            If your first OBR has more OBX then the second OBR.

            I don’t know how to remove the extra OBX’s.

            I thought a Pathcopy @null would work but it does not.

            Or maybe I just have it wrong.

            You will need to change the tags to match your HL7 variant.

            But this should get you started.

          • #63156
            Anthony Widjaja
            Participant

              That’s what I need.

              Thanks,

              Anthony

            • #63157
              Tom Rioux
              Participant

                Here is what you need to get rid of the bug:

                In your xlate, you have the following line in the body of your xlate:

                { OP PATHCOPY }

                                   { ERR 0 }

                                   { IN 1(%g1).OBX(%s1) }

                                   { OUT 1(0).OBX(%s1) }

                Just BEFORE that line, put this line:

                { OP PATHCOPY }

                                   { ERR 0 }

                                   { IN @null }

                                   { OUT 1(0).OBX(%s1) }

                Since in the outbound message, the field notations for the OBX

              • #63158
                Anthony Widjaja
                Participant

                  Thanks to John and Thomas.

                  I got it working now.

                  Anthony

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