Tcl proc context question …

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Tcl proc context question …

  • Creator
    Topic
  • #51708
    Joe Halbrook
    Participant

      I am using the following code to filter specific ORU messages as they come inbound to a thread.  I have the proc located in the IB TPS stack on the inbound thread.  And the proc works fine for normal message flow.

      Code:


      proc tps_filter_cerner_panels { args } {

         global HciSiteDir
         keylget args MODE mode

         switch -exact — $mode {
             start {
                 # Do nothing.
             }

             run {
                 keylget args MSGID mh
                 set msg [msgget $mh]
                 set dispList “{CONTINUE $mh}”

                 set obr_4_0 [hl7get $msh OBR 4 0]      ;# Panel Group
                 set obr_4_0_table “$HciSiteDir/Tables/CernerPanelUID.tbl”

                 set panel “”
                 set panel [tbllookup $obr_4_0_table $obr_4_0]
                 if  {[string length $panel] > 1} {
                     set dispList “{KILL $mh}”;   #KILL the message
                 }
                 return $dispList
             }

             shutdown {
                 # Do nothing.
             }

             default {
                 # Do nothing.
             }
         }
      }

      Yet, any time I send a message to this same inbound thead via the hcicmd from another proc, I get this error:

      Code:


      [cmd :cmd :INFO/0: bno31cern_in:04/19/2010 10:06:15] Doing ‘resend’ command with args ‘ib_pre_tps data 5120 /hci/quovadx/qdx5.7/integrator/testbno/iig/files/G3052985-260063250-446406-535415.dat nl’
      [sms :sms :ERR /0: bno31cern_in:04/19/2010 10:06:15] Tcl error:
      msgId = message0
      proc = ‘tps_filter_cerner_panels’
      args = ”
      result = ‘can’t read “msh”: no such variable’
      errorInfo: ‘
      can’t read “msh”: no such variable
         while executing
      “hl7get $msh OBR 4 0″
         (”run” arm line 7)
         invoked from within
      “switch -exact — $mode {
             start {
                 # Do nothing.
             }

             run {
                 keylget args MSGID mh
                 set msg [msg…”
         (procedure “tps_filter_cerner_panels” line 6)
         invoked from within
      “tps_filter_cerner_panels {MSGID message0} {CONTEXT sms_ib_data} {ARGS {}} {MODE run} {VERSION 3.0}”‘

      I’m sure there is a simple explanation, but I’m not understanding the issue, here.  Any thoughts would be appreciated.

      Joe

    Viewing 1 reply thread
    • Author
      Replies
      • #71382
        Michael Hertel
        Participant

          Change:

          [hl7get $msh OBR 4 0]

          To:

          [hl7get $msg OBR 4 0]

          Because:

          set msg [msgget $mh]

          Then get a cup of coffee.

        • #71383
          Joe Halbrook
          Participant

            See, I knew it would be something very simple.  ðŸ™‚  Thanks Michael.

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