I am working on a potential tcl script to only send adt messages for certain departments. The thing is, there are 20+ departments for me to filter. It seemed logical for me to build these departments into an array at startup, then have the array available during runtime.
As I understand TCL within Quovadx, I believe I would need to build the array into one tcl script (as I have posted below), then I would need to add the one script to both the start-up procedures field within the Protocol Properties, AND to the TPS Outbound Data field under the outbound tab.
Am I pretty close on my reasoning?
######################################################################
# Name: filter_hl7_dpt
# Purpose: to filter by department.
#
# 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 filter_hl7_dpt { 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
build the array here
}
run {
# ‘run’ mode always has a MSGID; fetch and process it
Filter message here using the array
}
time {
# Timer-based processing
# N.B.: there may or may not be a MSGID key in args
}
shutdown {
# Doing some clean-up work
}
}
return $dispList
}