· Jan 9, 2017

Automatting Data Lookup Table Import

Is there a way to have a Data Lookup table be automatically updated via a script or cache code? We have a file that is being created by our EMR, and we need to import it into Ensemble to update it. Just trying to see if we can automate this process.



Scott Roth

Ohio State University Wexner Medical Center

Discussion (5)0
Log in or sign up to continue

class Ens.Util.LookupTable has %Import and %Export methods.  You can use %Export to export an existing table to see the format expected by %Import.

Another option is to import a csv file using the SQL Data Import Wizard.  You can find that at System Explorer -> SQL and then click the 'Wizards' link at the top and choose Data Import.  I believe the csv file needs 3 columns: tablename, key, value.  The table name gets repeated for every row.  I'm not sure if this can be automated.

The last option is to edit the globals directly.  Ens.Util.LookupTable doesn't use standard default storage.  Instead, everything is stored in ^Ens.LookupTable with this format:


The last two options break the abstraction barrier so if the way lookup tables are stored ever changes, they'll stop working.  %Import and %Export are preferred.