Adding Rows to Tables

Clovertech Forums Read Only Archives Cloverleaf Tcl Library Adding Rows to Tables

  • Creator
    Topic
  • #52124
    Josh Fishel
    Participant

      Is it possible to add rows to a table from incoming HL7 messages?

      For example, I would like to add OBX-5 to the “incoming” column, and PID-18 to the “outgoing” column of a previously created table.

      Thanks!

      josh

    Viewing 2 reply threads
    • Author
      Replies
      • #73174
        David Barr
        Participant

          I’m not sure if it’s possible, but I would advise against it. I think you’re better off using a database to store this data. Recent versions of Cloverleaf include the Sqlite database, and it is simple to install on older versions.  Rather than using a “table” action to look up the data, you can use a “copy” action with an xltp proc to select the data from the table.

        • #73175
          garry r fisher
          Participant

            Hi,

            It is possible using some of the Table commands in Tcl. I would not recommend it though as you have to be aware of locking issues and performance hits.

            Use Sqlite or similar as suggested by David.

            Regards

            Garry

          • #73176
            Jim Kosloskey
            Participant

              I am not suggesting to do this but I don’t think there would be any performance hits to those using the Table while it is being ‘updated’.

              Remember the Table is loaded into memory by the engine so even if you make a change via the GUI the change is not immediate to the engines using the Table.

              While there is I/O activity, the Table is only referenced on first use and loaded into memory – a purge caches refreshes the Tables. I don’t think there would be any I/O conflict once the Table is loaded.

              I would suspect if one were to do this one would first make a copy of the table and make changes to the copy. Then rename the table files (saving the old one for audit purposes – remember Revisions does not track changes made outside the configurtion tool). Then a purge caches would need to take place for the Table to be refreshed. Unfortunately one cannot refresh just certain objects so all Tables, etc. being used at the level of refreshment will be refreshed. Maybe some objects not wanted to be refreshed just then.

              With the exception of the purging caches, all of the above should be able to be accomplished via Tcl (the purge caches via an exec inside the Tcl proc).

              Not knowing exaclty what this table is used for, it is difficult to make a single recommendation. There are many methods to keep ‘tables’ updated depending on the use of the Table and other business considerations.

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

          Viewing 2 reply threads
          • The forum ‘Tcl Library’ is closed to new topics and replies.