- This topic has 4 replies, 3 voices, and was last updated 15 years, 6 months ago by .
-
Topic
-
I wrote the following code and it tested fine in the testing tool. When applied to the route, it kills all messages. I only want vitals with nursing station {CI} to pass. Is my return wrong?
********* CODE BELOW ***********************
set filter_name “MedStation_filter”
set fld_sep [csubstr $msg 3 1] ;# hl7 Field Separator
#echo $fld_sep
set cmp_sep [csubstr $msg 4 1] ;# hl7 Component Separator
#echo $cmp_sep
set rep_sep [csubstr $msg 5 1] ;# hl7 Repetition Separator
#echo $rep_sep
set slist [split $msg n] ;# Get segments
echo [csubstr $slist 1 3]
set seg “” ;# Just in case
#
foreach seg $slist {
echo “SEGNAME: [csubstr $seg 0 3]”
if [cequal [csubstr $seg 0 3] PV1] {
set fields [split $seg $fld_sep]
set room_bed [lindex [split [lindex $fields 3] $cmp_sep] 2]
set station [string range $room_bed 0 1]
echo “Room and Bed: $room_bed”
echo “Station: [string range $room_bed 0 1]”
if [lcontain {CI} $station] {
echo “$filter_name – passed – station in {CI}”
return “{CONTINUE $mh}”
}
break
}
}
#
echo “$filter_name – failed all test.”
return “{KILL $mh}”
}
}
}
- The forum ‘Cloverleaf’ is closed to new topics and replies.