Sidebar

Automatically saving to a system variable table

0 votes
764 views
asked Mar 27, 2018 by maria-j-3133 (220 points)
Is there a way to save, add and update values in a system variable table automatically?

I am looking into receiving MRN numbers from a hospital and saving/updating the cross reference table I have for that hospital.

1 Answer

0 votes
You can update a system variable. Here is a KB on how to do this.

https://www.qvera.com/kb/index.php/1188/can-i-programmatically-add-entries-to-a-table?show=1188#q1188

The system variable table lookup is designed for static lookups that have occasional updates. If you have a table that is constantly being updated you should use a database table instead. The database table allows you do run select and update statements for individual rows in the table. To update a system variable table, you have to retrieve the entire table, modify it and set it back.

Also, system variables are not thread safe. If you have "First in First Out" checked on the channel you can do this. If not then you can have 2 messages update the system variable table at the same time and lose one of the updates.
answered Mar 27, 2018 by brandon-w-8204 (33,270 points)
edited Mar 27, 2018 by brandon-w-8204
commented Mar 28, 2018 by maria-j-3133 (220 points)
Will this check the table to see if the entry already exists? Is there a way to do that?
commented Mar 28, 2018 by brandon-w-8204 (33,270 points)
Any updates to the table have to be done by retrieving the table. Doing your own check for existing values with a script and putting the entire table back. A database is recommended for what you are looking to do.
commented Mar 28, 2018 by maria-j-3133 (220 points)
If we were to use and set up an external database, can we automatically add from Qvera the same way?
commented Mar 28, 2018 by brandon-w-8204 (33,270 points)
QIE supports external databases and you can do select, update, and insert statements against them from within any interface.
...