A command line tool to report LIMS changes to the sample-tracking service.
As updating sample statuses in more then one place can lead to errors and frustration, automation of
this process is deemed important. The sample-status-reporter
automates the migration of updated
sample statuses from an openBis LIMS to the
sample-tracking-service.
Interaction with the sample-tracking-service
To propagate information to the sample-tracking service, the app queries the following endpoints:
PUT /v2/samples/{sampleCode}/status/
Please see the sample-tracking-service SwaggerHub entry for further detail.
Integration with the openBIS LIMS
The sample information is retrieved automatically from an openBIS instance acting as LIMS. The
configuration of the openBIS needs to make sure each sample provides a QBiC barcode (containing Q
) and a sample status.
Furthermore, the names of the properties providing this information needs to be provided (see Environment Variables).
- The sample status may contain values
from
["Sample received", "QC passed", "QC failed", "Library completed"]
.
Besides that you can configure LIMS statuses this tools will ignore. For this pass a comma-separated list in the LIMS_IGNORED_STATUSES
environment variable.
This tool acts in the role of a user configured by you. Please make sure, that the configured user
only sees projects where you want to propagate the status to the sample-tracking system.
To run the application, first make sure you provide a correct configuration.
Checkout the latest code from main
and run the maven goal spring-boot:run
:
mvn spring-boot:run [-Dspring-boot.run.arguments=[-hV],[-t=<timePoint>]]
-h, --help Show this help message and exit.
-t, --time-point=<timePoint>
Point in time from where to search for updates e.g. '2022-01-01T00:00:00Z'.
Defaults to the last successful run.
If never run successfully defaults to the same time yesterday.
-V, --version Print version information and exit.
Alternatively you can package the application and run it as .jar
. First compile the project and
build an executable java archive:
mvn clean package
The JAR file will be created in the /target
folder:
|-target
|---sample-status-reporter-1.0.0.jar
|---...
Now change into the folder and run the REST service app with:
java -jar sample-status-reporter-1.0.0.jar [-hV] [-t=<timePoint>]
-h, --help Show this help message and exit.
-t, --time-point=<timePoint>
Point in time from where to search for updates e.g. '2022-01-01T00:00:00Z'.
Defaults to the last successful run.
If never run successfully defaults to the same time yesterday.
-V, --version Print version information and exit.
Please note that this project requires java 17
.
For this application to be run the following environment variables need to be set:
Environment Variable | Description | Default Value |
---|---|---|
LAST_UPDATE_FILE |
A path to a persistent file. The last successful run is stored here. | last-updated.txt |
LIMS_PASSWORD |
The password to access the OpenBiS LIMS | |
LIMS_SERVER_URL |
The URL to the OpenBiS LIMS API | |
LIMS_USER |
The user to access the OpenBiS LIMS | |
LIMS_BARCODE_PROPERTY |
The name of the property in the OpenBiS LIMS from which to read the QBiC barcode | |
LIMS_STATUS_PROPERTY |
The name of the property in the OpenBis LIMS from which to read the sample status information | |
LIMS_IGNORED_STATUSES |
A comma-separated list of LIMS sample statuses to be ignored by the reporter | |
LOG_PATH |
A path in which the log file generated by this application is stored | log/path/ |
SAMPLE_TRACKING_AUTH_PASSWORD |
The password for the sample tracking user | astrongpassphrase! |
SAMPLE_TRACKING_AUTH_USER |
The username for the sample tracking service | qbic |
SAMPLE_TRACKING_LOCATION_ENDPOINT |
The endpoint to list all locations. This does not contain the base url | /locations |
SAMPLE_TRACKING_LOCATION_USER |
The sample tracking user currently using the application | [email protected] |
SAMPLE_TRACKING_URL |
The base URL for the sample tracking service | http://localhost.de |
USER_DB_DIALECT |
The database dialect of the user database | org.hibernate.dialect.MariaDBDialect |
USER_DB_DRIVER |
The database driver for the user database | com.mysql.cj.jdbc.Driver |
USER_DB_HOST |
The URL to the host of the user database containing the database name | localhost |
USER_DB_USER_NAME |
The database user name | myusername |
USER_DB_USER_PW |
The database user password | astrongpassphrase! |