Clovertech
› Clovertech Forums › Cloverleaf › TCL – lookup table
Is it possible to use the lookup table w/ tcl scripts? If so, how do you do this?
The “tbllookup” command provides Lookup Table functionality from Tcl.
Rob Abbott Cloverleaf Emeritus
tablename is the name of the table
variablename is the name of the variable you are checking in the table
x is what is returned
set x [tbllookup “tablename” “variablename”]
The Guthrie Clinic Sayre, PA
and if your table is bi-directional, there is a “-side <side name>” parameter you can add before the name of the table.
Paul Bishop Carle Foundation Hospital Urbana, IL
I always use hcitbllookup. They seem to be identical. Is one of these older or better? Or is it recommended to use one of the two?
Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands
How do you handle a lookup that has more than one condition?
set procid [tbllookup its_proc_id.tbl $categoryID $procedureMnemonic
What do you mean ‘more than one condition’?
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.
the query will match on 2 things, category and mnemonic.
Do both values reside in a side of the table with no separator like this:
|categorymnemnonic| or with a separator of some kind (caret used here) like this:
|category^mnemonic|?
in either case I would try concatenating the ‘category’ and ‘mnemonic’ values together with or without separator as appropriate then do the lookup.