I used a trxid proc to filter out charges to either pass through to the billing system or to be written out to an error thread. I then crated the routes that look for the trxid’s defigned in the proc. Has worked great and is easy to follow. Below is the code.
######################################################################
# Name: charge_route
# Purpose:
# UPoC type: trxid
# Args: msgId = message handle
# Returns: The message’s transaction ID
#
# Notes:
# The message is both modify- and destroy-locked — attempts to modify
# or destroy it will error out.
#
proc charge_route { mh } {
set datList [datlist]
set gh [grmcreate -msg $mh hl7 2.3 cerner23 dft]
set dh0 [grmfetch $gh {0(0).PV1(0).00133.[3]}]
set myent [datget $dh0 VALUE]
set ffour [string range $myent 0 3]
if { [string compare $ffour “MLMI”] == 0 } {
set trxId “LTHS”
} else {
set trxId “HBOC”
}
grmdestroy $gh
hcidatlistreset $datList
return $trxId ;# return it
}
Craig Weldy
Senior Interface Analyst
Beacon Health System
South Bend, In, 46615