written by me, and the exact mode is not working as expected.
The filter is designed to pass results containing specific
physician codes, but it is also passing results containg codes
that are similar to those suppplied.
The args supplied are: {DRCODES {123|6682|4664|5681}}
The filter is also passing results with codes like 10123,
and 105681.
Any help will be greatly appreciated.
We are runing v5.5 rev 1 in a Redhat es4 environment.
proc filter_nonphysician {args} {
keylget args MODE mode
keylget args ARGS uargs
switch -exact — $mode {
start {
return “”
}
run {
set drcodes UNKNOWN ;# default value
keylget args MSGID mh
keylget uargs DRCODES drcodes
# init – variables
set pv1_7_1 “”;set pv1_8_1 “”;set pv1_9_1 “”;set pv1_17_1 “”
set obr_16_1 “”
# get message
set msg [split [msgget $mh] r]
# PV1 Seg – extract Dr codes from pv1 – 7.1,8.1,9.1 & 17.1
set pv1_loc [lsearch -regexp $msg {^PV1}]
set pv1_seg [lindex $msg $pv1_loc]
echo $pv1_seg
set pv1_7_1 [lindex [split [lindex [split $pv1_seg |] 7] ^] 0]
set pv1_8_1 [lindex [split [lindex [split $pv1_seg |] 8] ^] 0]
set pv1_9_1 [lindex [split [lindex [split $pv1_seg |] 9] ^] 0]
set pv1_17_1 [lindex [split [lindex [split $pv1_seg |] 17] ^] 0]
set dr_cd_in_msg “${pv1_7_1} ${pv1_8_1} ${pv1_9_1} ${pv1_17_1} “
# OBR seg – extract Dr codes from obr – 16.1
set obr_loc [lsearch -regexp $msg {^OBR}]
set obr_seg [lindex $msg $obr_loc]
set obr_16_1 [lindex [split [lindex [split $obr_seg |] 16] ^] 0]
append dr_cd_in_msg $obr_16_1
# Check if the physician codes are in pv1 7.1,8.1,9.1,17.1 or obr16.1
# If found continue message else kill message
if {[regexp $drcodes $dr_cd_in_msg]} {
echo “Found a Match … continue message”
echo DR_CD_IN_MSG: $dr_cd_in_msg
return “{CONTINUE $mh}”
} else {
echo “Dr code not in message .. message killed”
echo “Dr codes in Message: $dr_cd_in_msg”
echo “Wanted Dr codes : $drcodes”
return “{KILL $mh}”
}
}
}
}