Trying to replace an entire message with msgset, still only sending old message

Clovertech Forums Cloverleaf Trying to replace an entire message with msgset, still only sending old message

  • Creator
    Topic
  • #122185
    Joe Baranski
    Participant

      The reasoning behind this is we have to block SIUs without an Account Number in PID.18 when scheduled via an outside system.  I have 1 tclproc to kill the message on the SIU route and write the message to a local sqlite db.  Then on a separate ADT (split) route I have another tclproc that compares MRNs, if it finds a match it reads the SIU from the database and replaces the ADT msg value.  In Testing Tool it works, but testing the actual interfaces it’s still sending only the ADT payload.

      lappend n_newmsg $n_segment
      set n_msg [join $n_newmsg \r]
      msgset $mh $n_msg
      lappend dispList “CONTINUE $mh”
      Those are the relevant pieces of code, which according to the Cloverleaf documentation it should work.
      Thanks in advance for any assistance you may be able to offer,
      -Joe
    Viewing 6 reply threads
    • Author
      Replies
      • #122186
        David Barr
        Participant

          The code looks fine to me, and if the testing tool says that it works, then your actual interface is probably still running the old code. I think you can “reload procedure” through the gui to apply your change, but I always just restart the process where the proc is getting run.

        • #122187
          Jason Russell
          Participant

            Did you restart your process fully? Is the tclproc fully saved and showing up in the list? Just seems like the new code hasn’t been updated in memory.

          • #122189
            Jim Vilbrandt
            Participant

              Two alternative solutions to your original issue:

              • If you can access the Database of the system were the ADTs originate, create a DB-Lookup table to return the “best encounter” for the patient ID.
              • Create an SQLite Database that is updated by an ADT feed, then query that DB for the “best encounter”.

              Regards, Jim

            • #122190
              Charlie Bursell
              Participant

                Can’t see all of the code.  Is there a chance that dispList was set with the original message?

                Instead of   lappend dispList “CONTINUE $mh”  try set dispList “CONTINUE $mh”

                 

                • #122192
                  Joe Baranski
                  Participant

                    Can’t see all of the code. Is there a chance that dispList was set with the original message? Instead of lappend dispList “CONTINUE $mh” try set dispList “CONTINUE $mh”

                    The displist was set at the start of the proc and not referenced until the end of the swap.  I tried your suggestion of changing it to a set instead of lappend and got this error with the Testing Tool

                    [0:TEST] ‘CONTINUE’ (returned by ‘tonic_siu_from_adt_build_db ‘) does not match { <key> <value> }
                    [0:TEST] ‘message0’ (returned by ‘tonic_siu_from_adt_build_db ‘) does not match { <key> <value> }

                • #122191
                  Joe Baranski
                  Participant

                    The code looks fine to me, and if the testing tool says that it works, then your actual interface is probably still running the old code. I think you can “reload procedure” through the gui to apply your change, but I always just restart the process where the proc is getting run.

                    Did you restart your process fully? Is the tclproc fully saved and showing up in the list? Just seems like the new code hasn’t been updated in memory.

                    This proc is active on the route; there’s a line of code to update a ProcessedFlag field on the db table that gets set to 1 when it updates/swaps-in the SIU and that functions when resending messages.

                  • #122193
                    David Barr
                    Participant

                      You could always add a “msgdump $mh” command in your script for more debugging information. It should add messages to the process log to show you if the message has been modified, and if the msgdump output isn’t showing up it would indicate a problem getting your interface to run the script (not applied in the GUI or process not restarted).

                    • #122194
                      Charlie Bursell
                      Participant

                        My bad.  The command should be:  set dispList

                          Sorry about that

                      Viewing 6 reply threads
                      • You must be logged in to reply to this topic.