Can someone recommend how to do this without having to write a mile long IF statement?
Below is a portion of the filter.
# Here we retrieve the data from our original message
set msg [msgget $mh]
# Now we need to determine our field and subcomponent seperatoprs
set field_sep [csubstr $msg 3 1] ;# HL7 field separator
set sub_sep [csubstr $msg 4 1] ;# HL7 subfield separator
set disposition “KILL”
# Here we spilt the original message into a list of the segments contained within
set segmentList [split $msg r]
foreach segment $segmentList {
if {[cequal [crange $segment 0 2] IN1]} {
set fieldList [split $segment $field_sep]
set in1_3 [lindex $fieldList 3]
set in1_3_list [split $in1_3 $sub_sep]
set in2_3 [lindex $fieldList 3]
set in2_3_list [split $in2_3 $sub_sep]
set in1_3_1 [lindex $in1_3_list 0]
set in2_3_1 [lindex $in2_3_list 1]
puts “this is in1_3_1: $in1_3_1”
puts “this is in2_3_1: $in2_3_1”
if {[cequal $in1_3_1 “123”] || [cequal $in2_3_1 “567”]} {
set disposition “KILL”
} else {
set disposition “CONTINUE”
Thanks in advance for any suggestions.