Import Scripts and the UXML Structure

Top  Previous  Next

HelpAn importing script is used to read the unified XML structure carrying the parsed data from a document and then update STARLIMS database tables with the data. That is, importing scripts can take the data within XML tags and move it into LIMS tables. For example, in the screen shot in the prior procedure, To create the UXML template for the HPLC report, the field Custom name 1 in the UXML template corresponds to the tag CNAME1 in the output XML. An SSL script can take the values parsed into the CNAME1 tags that correspond to ORDNO (sample ID), ANALYTE (analyte name), and NUMRES (retention time), and update the NUMRES field in the LIMS RESULTS table using an SSL statement such as:

 

SqlExecute ("Update RESULTS set NUMRES=?Numres? Where ORDNO=?ORDNO? And ANALYTE=?Analyte?") ;

 

clip0002TIP You can see the output XML by clicking the Show XML button in the Unified XML Designer window.

 

Importing scripts are stored in the STARLIMS Designer at path Server Scripts > SDMSImportScripts, where you can add an SSL script to update tables. Two base scripts are available in the designer for your use and guidance in building scripts for importing data.

 

SDMSImportScripts._ImportTemplate passes the required input parameters file ID and the associated UXML structure containing the extracted data. All importing scripts should use the parameters provided by this script.
SDMSImportScripts._HelperFunctions provides guidance for configuring the SSL functions that an importing script includes such as GetNumberOfRuns, FindKeywordByName, FindKeyWordByCName1, FindKeywordByCName2, FindKeywordByAttribute, and other similar functions, such as those for finding and getting tables or images. All importing scripts should be configured to call the appropriate functions from this list of functions. _HelperFunctions also includes information in comments to help you write an importing script.

 

Typically there are other available scripts that you can view as additional examples.

clip0003NOTE Typically, a unified XML structure that is expected to be used with the data parsed from a particular document is associated with the File Type for that document. Use the File Types tab in the SDMS Admin application to associate an importing script with a highlighted file type; click the ... inside the Importing Script field. In the resulting dialog box, choose a server script and click Select.