GET openspecimen/rest/ng/specimens?label={labelslabel1}&label={label2}&cprId={cprId}&eventId={eventId}&visitId={visitId}
...
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. |
Users can search for multiple specimens by providing multiple label values in URL query string | |
cprId [optional] | Collection Protocol Registration ID of that specimen. |
eventId [optional] | Event ID of anticipated specimen. |
Either this parameter or visitId parameter needs to be provided |
when searching based on cprId. | |
visitId [optional] | Visit ID under which the specimen is collected. Either this parameter or eventId parameter needs to be provided when searching based on cprId. |
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 |
&label=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 |