TCL – lookup table

Clovertech Forums Cloverleaf TCL – lookup table

  • Creator
    Topic
  • #118717
    Stewart
    Participant

      Is it possible to use the lookup table w/ tcl scripts?  If so, how do you do this?

    Viewing 6 reply threads
    • Author
      Replies
      • #118718
        Rob Abbott
        Keymaster

          The “tbllookup” command provides Lookup Table functionality from Tcl.

          Rob Abbott
          Cloverleaf Emeritus

        • #118719
          Gene Millard
          Participant

            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

          • #118722
            Paul Bishop
            Participant

              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

            • #118852
              Robert Kersemakers
              Participant

                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

              • #119621
                Stewart
                Participant

                  How do you handle a lookup that has more than one condition?

                   

                  set procid [tbllookup its_proc_id.tbl $categoryID $procedureMnemonic

                • #119622
                  Jim Kosloskey
                  Participant

                    What do you mean ‘more than one condition’?

                    email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

                    • #119623
                      Stewart
                      Participant

                        the query will match on 2 things, category and mnemonic.

                    • #119624
                      Jim Kosloskey
                      Participant

                        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.

                        email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

                    Viewing 6 reply threads
                    • You must be logged in to reply to this topic.