Split one ORU message into multiple messages

Clovertech Forums Read Only Archives Cloverleaf Tcl Library Split one ORU message into multiple messages

  • Creator
    Topic
  • #51822
    Garrett Fletcher
    Participant

      Hi,

      I need to make a proc that will split a ORU message in to multiple messages. The input is HL7 and the output is going to be VRL. Where is the best place to put a proc like this? Will I need to generate a new message ID for each message?

      Thanks,

      Garrett

    Viewing 3 reply threads
    • Author
      Replies
      • #71863
        Gary Atkinson
        Participant

          I believe you can do this in the translation tool if you want.  You can use the the CONTINUE function.

        • #71864
          Garrett Fletcher
          Participant

            Thanks I got it working with the XLT. For some reason it was not gen 2 messages at first. I think I had my continue in the wrong place. Also I had to start with a surpress because the first message was duplicating. Here is a screenshot of my translation for people who may want to do this in the future.

            I am writing to a VRL (.csv) so every “message” is a new record in the file.

          • #71865
            Jim Kosloskey
            Participant

              Congratulations Garrett.

              You have learned a valuable skill. You will find this useful even fro HL/7 to HL/7 and other various message structures.

              The Xlate always attempts to produce a message so even though you are using a CONTINUE, when you are finished the Xlate is not. As you discovered, you need to put a SUPPRESS in such a location that it tells the Xlate not produce the message it has built (normally if I recall correctly that is the last one you CONTINUED which looks like a duplicate of the CONTINUE unless you understand the need for the SUPPRESS).

              The SUPPRESS does not have to be the first Action in the Xlate to be effective in these cases, however that is a good placement. It is what I do whenever I am creating multiple outbound messages from one inbound message. The SUPPRESS does need to be unconditionally executed wherever it is placed in these cases.

              Placing it first also gives me (and others) a immediate visual that clues me that the Xlate is controlling the output of messages.

              One suggestion I might make is to add COMMENTS (in my mind you cannot have too many COMMENTS) so that it is clear to the uninitiated who might follow you (and to you if too much time has gone by) of wht is intended and why it is being done.

              Again congratulations!!

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

            • #71866
              Garrett Fletcher
              Participant

                Thanks for the explanation, Jim. I got it working but I wasnt sure why it kept duplicating that first message. It is good to know how that works :).

                G

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