Table Configurator

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Table Configurator

  • Creator
    Topic
  • #51040
    Jerry Magrann
    Participant

      I’m sure there is an easy answer to this I’m just not seeing on a Monday –

      I have a table to convert doctor number values in two different fields being called from a TCL proc. If the doc number is not in the table I would just like the value that is in the field to remain as is. Right now when I’m running it through, the field gets blanked if the value is not located in the table. Is there something I have to set in my default or do I have to code around this in the TCL? Running Cloverleaf 5.3

      Thanks

    Viewing 3 reply threads
    • Author
      Replies
      • #68525
        Tom Rioux
        Participant

          Jerry,

          You can set your default value in your table to something like “DEFAULT” or “999999”  Then, in your Tcl code, have an IF statement that checks for this default and send the doctor’s code as is if true.

          Hope this helps…

          Tom Rioux

        • #68526
          Bob Richardson
          Participant

            Greetings,

            Since Cloverleaf 3.81P, you will need to test the return value from your table lookup and if null (empty) then pass your original value to the utput target.  Of course if you specifiy a default value (dflt=somevalue) then you would get that returned from your table lookup.

            For example we have the following in a tps Tcl procedure:

                     set obx_3_text [tbllookup EPIC_OBX3_1_CO.tbl $obx_3_1 ]

                     if {![string equal $obx_3_text {}]} {

                          set keep_obx(OBX${obx_seq}) $obx_3_text

                     } else {

                          set keep_obx(OBX${obx_seq}  $obx_3_1  ;#added here to illustrate

                     }

            Here we test if a value was returned from the table lookup and do some code.  We added an else for the empty value returned case and use the original lookup key for the logic.

            Or you could do a test like the following:

            if {  [string equal [tbllookup EPIC_PASS_LOC_PAREX.tbl $pv1_3_1] {}] } {

                       set somevariable $pv1_3_1  ;#not on table use original value

            }

            I hope this helps you out in solving your problem.

            I hope this helps you out.

          • #68527
            Jerry Magrann
            Participant

              Got it working – used “DEFAULT” in the default of the table and then coded it in TCL like Tom and Robert suggested.

              It would be a nice enhancement though in the tables for in the default to be able to put “@field” or something like that to keep the value of the field if the vaule isn’t in the table. Would save coding work. Just a thought for Healthvision.

              Thanks for your responses!!

              Jerry

            • #68528
              Jim Kosloskey
              Participant

                Jerry,

                A ‘preserve’ option wasrequested some time ago – we are waiting on that.

                I needed to do a dynamic Table lookup inside the Xlate (that is the Table name would be differnt potentially dependent on a user provided argument). Since the TABLE Action only allows a static table name, I wrote a Tcl proc that takes a Table name as an argument and does the lookup (invokes the Table lookup code). Since I was at it, I added an argument set so that if I want to I can get the inbound field valueif it is not located in the table instead of the default.

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

            Viewing 3 reply threads
            • The forum ‘Cloverleaf’ is closed to new topics and replies.