Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

GET openspecimen/rest/ng/specimens

or

openspecimen/rest/ng/specimens?start?label={startlabels}&maxcprId={maxResultscprId}&searchStringeventId={searchStringeventId}&countReqvisitId={true/falsevisitId}

Use this resource to get specimens with specific parameters. This API returns all the matching specimens based on the searchString,  if searchString not specified then it returns all the specimens present in the openSpecimen applicationparameters 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:

maxResults
Parameter
Details
searchString label [optional]The value with label of the specimen which you want to search the Specimen. The given value will be matched with Label and Barcode.start . This is the array of string. You can specify comma separated labels for multiple labels.
cprId [optional]
start index of the resultsCollection Protocol Registration ID of that specimen.
eventId [optional]Maximum number of records to fetch. By default it will be 100
countReq [optional]Set this parameter to true, if want to get the total count of matching results.

http[s]:<host>:<port>/openspecimen/rest/ng/specimens

 

Use this URL to get users in openSpecimen application.

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:

URLhttp://<host>:<port>/openspecimen/rest/ng/specimens?searchStringlabel=Tissue1b1,b2
MethodGET
Requestapplication/json

Response

[

  { "activityStatus" : "Active",

  "barcode" : "",

  "biohazardDetails" : [  ],

  "collectionStatus" : "Collected",

  "comment" : "creating an adhoc specimen.",

  "createdOn" : "2014-02-21",

  "externalIdentifierDetails" : [  ],

  "id" : 2,

  "initialQuantity" : 2.0,

  "label" : "Tissue1",

  "lineage" : "New",

  "pathologicalStatus" : "Metastatic",

  "scgId" : 1,

  "specimenClass" : "Tissue",

  "specimenType" : "Fixed Tissue",

  "tissueSide" : "Left",

  "tissueSite" : "Nasal cavity"

}]

 

    "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
200All resourcesSpecimens got successfully
401All requestsAuthorization failed, user doesn’t have authority
500All requestsInternal server error, encountered server error while performing operations