single message in multiple messages out tcl proc

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf single message in multiple messages out tcl proc

  • Creator
    Topic
  • #49974
    Joseph Paquette
    Participant

    Hello,

        I am trying to write a tcl proc that will handle order messages in with multiple OBR and ORC segments.  I have the proc generating the messages correctly, however I cannot figure out how to get more than one message out.  When using the testing tool it will only spit out a single message.  However using the echo command I see that I am generating more than one.  Anyone have any idea on how to get more than one message out from a single message in???

Viewing 2 reply threads
  • Author
    Replies
    • #64329
      Rob Abbott
      Keymaster

      You will have to create a new message handle for each additional message you want to return.  It’s recommended that you use msgcopy rather than msgcreate so that metadata is preserved.

      assume that $mh is your original inbound message and $hl7 contains your data.  The code below would exist inside your loop that is splitting the data into individual messages

      Code:

      set newMh [msgcopy $mh]
      msgset $newMh $hl7
      lappend dispList “CONTINUE $newMh”

      You can also do this sort of thing in translation with the CONTINUE operation.

      Rob Abbott
      Cloverleaf Emeritus

    • #64330
      Jim Kosloskey
      Participant

      Joseph,

      That is really easy to do in the Xlate – any reason you are doing it in Tcl?

      Jim Kosloskey

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

    • #64331
      Joseph Paquette
      Participant

      Hello,

          Usually have better control using tcl, have not really had a good example to look at using the suppress/continue option.  Working on the translation now may need some direction with the suppress/continue placements.

      Joe

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

Forum Statistics

Registered Users
5,129
Forums
28
Topics
9,301
Replies
34,447
Topic Tags
288
Empty Topic Tags
10