Tested on Python 3.8 with Flask 1.1.2
-
Download source
git clone https://github.com/KitwareMedical/AllenInstituteMockLIMS cd AllenInstituteMockLIMS
-
Create virtual environment
python3 -m venv venv . venv/bin/activate
-
Install requirements
pip install -r requirements.txt
-
Start the flask application
python -m flask run
GET
/specimen_metadata/view
Returns json metadata of a specimen based on the kind of metadata.
Parameter | Type | Description |
---|---|---|
specimen_id |
integer |
Unique id property of the Specimen entry in the LIMS that the metadata is associated with |
kind |
string |
The kind of metadata that is to be retrieved (eg. "IVSCC cell locations") |
version_number (opt.) |
integer |
The version of the metadata, which may be defined by the kind of metadata |
{
"version_number": 2,
"data": {"foo": "bar"}
}
Status Code | Body |
---|---|
500 |
{ "status": 500, "message": "Something went wrong" } |
404 |
{ "status": 404, "message": "Record not found" } |
400 |
{ "status": 400, "message": "Param foo is missing" } |
Request:
GET
/specimen_metadata/view?specimen_id=1234&kind=IVSCC%20cell%20locations
Response:
{
"version_number": 2,
"data": {"foo": "bar"}
}
If version_number is not specified, then the current version will be returned
POST
/specimen_metadata/store
Stores json metadata of a specimen based on the kind of metadata.
None. If URL params are provided, the request will be rejected with code 400
Value | Type | Description |
---|---|---|
specimen_id |
integer |
Unique id property of the Specimen entry in the LIMS that the metadata is associated with |
kind |
string |
The kind of metadata that is to be retrieved (eg. "IVSCC cell locations") |
data |
object |
The metadata to be stored. This should be a vaid JSON object |
{
"specimen_id": 1234,
"kind": "IVSCC cell locations",
"data": {"foo": "bar"}
}
Header | Value |
---|---|
Content-Type |
application/json |
{
"id": 1234,
"version_number": 2
}
Status Code | Body |
---|---|
500 |
{"status": 500, "message": "Something went wrong"} |
404 |
{"status": 404, "message": "Record not found"} |
400 |
{"status": 400, "message": "Param foo is missing"} |
Request:
POST
/specimen_metadata/store
{
"specimen_id": 1234,
"kind": "IVSCC cell locations",
"data": {"foo": "bar"}
}
Response:
{
"id": 1234,
"version_number": 2
}