How to autoimport results from instruments?


#1

SENAITE can be configured to automatically import results files generated by instruments at regular intervals of time, without human intervention. For instance, let’s say you want to automatically import the results generated by Agilent MassHunter, for which there is already an import interface for quantitative reuslts available in SENAITE.

Configure the results path

Choose the instrument from the instruments list (or create a new one):

  1. Click to the top right gear-icon
  2. Choose “Instruments”
  3. Click to the instrument of choice

Two sections are displayed at the bottom of the edit view: “Import Data Interface” and “Results file folders”.

As soon as you select the import data interface to use, a new row for the selected interface will be displayed below the “Results files folders” section:

For the selected interface, type the full path where Senaite should look for files at regular intervals of time and press “Save”

Import results from configured paths

If you type http://localhost:8080/senaite/auto_import_results in your browser, Senaite will try to import new results files (not yet imported) from inside the specified folder. This auto import will be logged automatically in “Import > Auto Import Instrument Results” view:

Captura%20de%202019-03-22%2001-02-35

Configure Senaite to automatically import results

To tell Senaite to automatically call the method auto_import_results at regular intervals of time, a clock must be added to the buildout.cfg file:

zope-conf-additional =
    <clock-server>
       method /senaite/auto_import_results
       period 3600
       user admin
       password secret
       host localhost:8080
    </clock-server>

In this example, the method “/senaite/auto_import_results” will be called once per hour (3600 seconds). Further info about clocks here: https://docs.plone.org/develop/plone/misc/asyncronoustasks.html

Stop the instance, run bin/buildout and start the instance again.

Each time the system founds a new result file will try to import and log the action in “Import > Auto Import Instrument Results”.