GET openspecimen/rest/ng/specimens?label={labels}&cprId={cprId}&eventId={eventId}&visitId={visitId}
Use this resource to get specimens with specific parameters. This API returns all the matching specimens based on the parameters provided.
Use HTTP GET method to call this API by passing the below details in JSON format.
Below are the attributes which need to be sent in the request body:
Parameter | Details |
---|---|
label [optional] | The label of the specimen which you want. This is the array of string. You can specify comma separated labels for multiple labels. |
cprId [optional] | Collection Protocol Registration ID of that specimen. |
eventId [optional] | Event ID of anticipated specimen. This needs to be provided with cprId. |
visitId [optional] | Visit ID under which the specimen is collected. |
Result:
The response of this request will contains the details of the specimens.
Below is the example of the get specimens:
URL | openspecimen/rest/ng/specimens?label=b1,b2 |
Method | GET |
Request | application/json |
Response | [ { "id": 8, "cpId": 1, "cprId": 1, "eventId": null, "visitId": 1, "visitName": "first visit", "cpShortTitle": "blood", "reqId": null, "sortOrder": null, "label": "b1", "barcode": null, "type": "Whole Blood", "specimenClass": "Fluid", "lineage": "Aliquot", "anatomicSite": "Autonomic nervous system, NOS", "laterality": "Not Applicable", "status": "Collected", "reqLabel": null, "pathology": "Malignant, Pre-Invasive", "initialQty": 20, "availableQty": 20, "available": true, "concentration": 10, "parentId": 1, "parentLabel": "blood1", "storageLocation": { "id": 1, "name": "Fluid Container", "positionX": "5", "positionY": "A" }, "storageType": null, "collectionContainer": null, "activityStatus": "Active", "createdOn": 1449500400000, "code": null, "distributed": null }, { "id": 9, "cpId": 1, "cprId": 1, "eventId": null, "visitId": 1, "visitName": "first visit", "cpShortTitle": "blood", "reqId": null, "sortOrder": null, "label": "b2", "barcode": null, "type": "Whole Blood", "specimenClass": "Fluid", "lineage": "Aliquot", "anatomicSite": "Autonomic nervous system, NOS", "laterality": "Not Applicable", "status": "Collected", "reqLabel": null, "pathology": "Malignant, Pre-Invasive", "initialQty": 20, "availableQty": 20, "available": true, "concentration": 10, "parentId": 1, "parentLabel": "blood1", "storageLocation": { "id": 1, "name": "Fluid Container", "positionX": "6", "positionY": "A" }, "storageType": null, "collectionContainer": null, "activityStatus": "Active", "createdOn": 1449500400000, "code": null, "distributed": null } ] |
Error Cases :
code | Applies to | Status Message |
---|---|---|
200 | All resources | Specimens got successfully |
401 | All requests | Authorization failed, user doesn’t have authority |
500 | All requests | Internal server error, encountered server error while performing operations |