Originally posted by Scott Folley
# 'run' mode always has a MSGID; fetch and process itkeylget args MSGID mh# Here we retrieve the data from our original messageset msg [msgget $mh]# Now we need to determine our field and subcomponent seperatoprsset field_sep [ string range $msg 3 3] ;# HL7 field separatorset sub_sep [string range $msg 4 4] ;# HL7 subfield separator# Here we spilt the original message into a list of the segments contained withinset segmentList [split $msg r]# Seed the variables so that they exist at the proc scopeset pid_3_4 ""set pv1_18_1 ""# Now we iterate over each segment in our list.foreach segment $segmentList { set fieldList [ split $segment $field_sep ] set segId [ lindex $fieldList 0 ] switch -exact -- $segId { PID { set pid_3 [lindex $fieldList 3] # split PID-3 on the sub-seperator set pid_3_list [split $pid_3 $sub_sep] # get the first element in PID-3 set pid_3_4 [lindex $pid_3_list 3] } PV1 { set pv1_18 [lindex $fieldList 18] # split PV1-18 on the sub-seperator set pv1_18_list [split $pv1_18 $sub_sep] # get the first element in PV1-18 set pv1_18_1 [lindex $pv1_18_list 0] } }}if { $pv1_18_1 == "PAO" && $pid_3_4 == "W" }{ lappend dispList "KILL $mh"} else { lappend dispList "CONTINUE $mh"}
[sms :sms :ERR /0: neobrowse] Tcl error: msgId = message0 proc = 'kill_pao' args = '' result = 'extra characters after close-brace' errorInfo: 'extra characters after close-brace while compiling"if { $pv1_18_1 == "PAO" && $pid_3_4 == "W" " ("run" arm line 40) invoked from within"switch -exact -- $mode { start { # Perform special init functions # N.B.: there may or may not be a MSGID key in args ..." (procedure "kill_pao" line 6) invoked from within"kill_pao {MSGID message0} {CONTEXT sms_ob_data} {ARGS {}} {MODE run} {VERSION 3.0}"'