I am putting this proc in the TPS inbound Data field If thier is an easier way to do this or a better way let me know.
proc create_hl7_ack { args } {
keylget args MODE mode ;# Fetch mode
set dispList {} ;# Nothing to return
switch -exact — $mode {
start {
}
run {
keylget args MSGID mh
set msg [msgget $mh]
if {[cequal [crange $msg 0 2] “MSH”] && [llength [split $msg “r”]] > 1} {
set acktype AA
set disptype “CONTINUE”
} else {
set acktype AR
set disptype “KILL”
}
set ack [lindex [split $msg “r”] 0]
append ack “r” “MSA” [cindex $msg 3] $acktype “r”
set ackh [msgcreate -type reply $ack]
lappend dispList “$disptype $mh”
lappend dispList “OVER $ackh”
}
time {
}
shutdown {
# new mode added by C:hciroot3.8.0Pbinhcitpsconvert.htc on 20020327082942
}
default {
error “Unknown mode ‘$mode’ in create_hl7_ack”
}
}
return $dispList
}