process.
What process removes/skips the transaction or does just returning
lappend displist “KILL $MSGID” in Cloverleaf tell it to remove the transaction?
or Is my script incorrect?
Any help is appreciated
Mark
proc tps_filter_RODS { args } {
global HciConnName
# Get mode start or run
set mode [keylget args MODE]
# Get the name of the procedure to be used for error messages, debug, etc.
set myname “$HciConnName/[lindex [info level 1] 0]”
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 msgId
set msg [msgget $msgId]
set field_sep [string index $msg 3] ;# HL7 field separator
set sub_sep [string index $msg 4] ;# HL7 subfield separator
set segList [split $msg r] ;# Get segments
set PID [lindex [lregexp $segList {^PID}] 0] ;# Get 1st PID
set PID5 [lindex [split [lindex [split $PID $field_sep] 4] $sub_sep] 0] ;# Get PID-5_0 Patient Last Name
set MSH [lindex [lregexp $segList {^MSH}] 0] ;# Get MSH
set MSH8 [lindex [split $MSH $field_sep] 8] ;# Get MSH-8 Message Type and Event Type
set MSH82 [lindex [split $MSH8 $sub_sep] 1] ;# Get MSH-8 Component 2
if {[regexp — {A04} $MSH82] ==1 } {
lappend dispList “CONTINUE $msgId”
} else {
lappend dispList “KILL $msgId”
}
}
shutdown {
# Doing some clean-up work
}
default {
error “Unknown mode ‘$mode’ in $myname”
}
}
return $dispList
}