Thomas,
The table lookup will always return the default value specified for the table if the input value is not found in the table; so you’ll need to change your code to compare against the value ‘UNKNOWN’ (since that is the ‘Default’ value specified for the table, which is what will get returned if the input value is not found in the table); i.e.
set roomout {}
if [string match *NA $patroom] {
set roomout {}
} else {
set roomout $patroom
}
set bedout {}
if [string match *NA $patbed] {
set bedout {}
} else {
set bedout [tbllookup idxevm_bednum_2_CSY_bednum.tbl $patbed]
if ![string match UNKNOWN $bedout] {
set bedout $bedout
} else {
set bedout $patbed
}
}
Jim Cobane
Henry Ford Health