Homepage › Clovertech Forums › Read Only Archives › Cloverleaf › Cloverleaf › Kill Unused Message Types Before Routing? › Re: tcl to suppress messages before they get to a thread
We have some that kill multiple ADT types, just add an else if.
######################################################################
# Name: tpsKillA04
# Purpose: Kill A04 before gets to threads
# 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 tpsKillA04 { 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^A04”]} {
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
}