Need help on sending an HL7 message from proc to thread

Homepage Clovertech Forums Read Only Archives Cloverleaf Tcl Library Need help on sending an HL7 message from proc to thread

  • Creator
    Topic
  • #52705
    Tom Gilbert
    Participant

    I am storing a HL7 message in an SQL table.  I am then writing a Tcl proc that will pull the messages from the SQL table that have not been sent.  This will be done every xx seconds.

    My problem is that I have the message in a variable but how do I get it from the the variable in the proc to the thread to get it on its way.

    Please Help… 😀

Viewing 5 reply threads
  • Author
    Replies
    • #75208
      Russ Ross
      Participant

      You might be able to make some progress by starting with writing what you have in the variable to a temp file and playing with the resend feature from the IDE which you can view and will look something like this (forgive me if it is slightly wrong since some genuis made it so you can’t copy/paste it anymore like we could in TK, hint for enhancement)

      hcicmd -p super_adt -c “ib_super_adt resend ib_pre_tps data 5120 my_temp_file nl”

      I also took a look at hcicmd and see it is a perl script that might reveal the method behind the madness if you have the determination to see how it reads a file and resends to a cloverleaf thread.

      Since you are writing HL7 messages to a SQL data base perhaps I can assume you have the Cloverleaf ODBC module.

      If that is true I believ you could write a stored procedure that the ODBC module for Cloverleaf could call periodically to have the desired messages pulled and sent to cloverleaf.

      Of course, I haven’t done it myself but that is what popped into my head in addition to the approach that you have 80% working it sounds like.

      I do recall being able to create message handles and populate metadata from scratch that might allow directing message content in a variable to a thread, but never gave it a try or used those commands much past level 2 training, but those thoughts are also surfacing when I start thinkg about what approaches might work.

      Maybe this dialog will get others to start having some ideas that might be more tanglibly useful.

      I just don’t have enough time or energy because I have to go help my son do his algebra which has me just about exhausted these days.

      Russ Ross
      RussRoss318@gmail.com

    • #75209
      David Barr
      Participant

      You need to create an inbound thread with the protocol set to “upoc”.  In the “read tps”, have it call your tcl proc. You can use the schedule to configure how frequently you want your query to run. In the TPS proc, call “msgcreate” with the data that you want to put in the message. Then you can route the messages from this thread to your outbound thread.

    • #75210
      Tom Gilbert
      Participant

      Hello David,  I did the createmsg and that worked great.  I still cannot get it to the thread.  I did select upoc on the thread and I did put the tcl proc in the properties and set the seconds.  but for some reason it is not going to the thread.  Please see program attached…

    • #75211
      David Barr
      Participant

      You need to use “msgcreate” to put your message into a Cloverleaf message handle, then return the message handle in the disposition list with a CONTINUE disposition.

    • #75212
      Tom Gilbert
      Participant

      I am doing the following but for some reason it is not sending.  Am I missing anything…

      set newmsg $KDDH_Message

      set mh [msgcreate -recover $newmsg]

      lappend dispList “CONTINUE $mh”

      The msgcreate is creating message0 which is great but not going to the thread…

      I attached the setting when i select Protocol: UPOC for my protocol and the Read TPS with interval…  am i missing something…

      thanks

    • #75213
      David Barr
      Participant

      These messages are created as inbound messages. They aren’t going anywhere unless you route them.

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

Forum Statistics

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