Re: here is a tcl that will kill msg based on trixid.

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Need TcL Proc to kill message based upon TrxId Re: here is a tcl that will kill msg based on trixid.

#56386

Here is one that we use here at Mt. Sinai.

Name:         tpsKillA28

# Purpose:      Kill A28 before gets to threads

#               added 7/2/03 by gerri jackson along w/other adt a28 suppression

# UPoC type:    tps

# Args:         tps keyedlist containing the following keys:

#               MODE    run mode (“start”, “run” or “time”)

#               MSGID   message handle

#               ARGS    user-supplied arguments:

#                      

#

# Returns: tps disposition list:

#          

#

proc tpsKillA28 { args } {

   keylget args MODE mode                      ;# Fetch mode

   set dispList {}                             ;# Nothing to return

   switch -exact — $mode {

       start {

           # Perform special init functions

           # N.B.: there may or may not be a MSGID key in args

       }

       run {

           # ‘run’ mode always has a MSGID; fetch and process it

           keylget args MSGID mh

                               set inmsg [msgget $mh]

                               #Check Event

                               set msgSegments [split $inmsg r]

                               set mshSeg [lindex $msgSegments 0]

                               set event [getHL7Field $mshSeg 8] ;# event is th

e 9th field

                               if {[cequal $event “ADT^A28”]} {

               lappend dispList “KILL $mh”

                               

                                } else {

                               lappend dispList “CONTINUE $mh”

                               } ;# end of if-else

       }

       time {

           # Timer-based processing

           # N.B.: there may or may not be a MSGID key in args

       }

       shutdown {

           # Doing some clean-up work

       }

       default {

           error “Unknown mode ‘$mode’ in tpsKillMsg”

       }

   }

   return $dispList

}

(END)

Forum Statistics

Registered Users
5,116
Forums
28
Topics
9,292
Replies
34,432
Topic Tags
286
Empty Topic Tags
10