Versions Compared

Key

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

openspecimen/rest/ng/specimens

or

Table of Contents

Specimen details provided multiple parameters.

GET openspecimen/rest/ng/specimens?startlabel={label1}&label={startlabel2}&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:

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 maxResults
. Users can search for multiple specimens by providing multiple label values in URL query string
cprId [optional]
start index of the results
Collection Protocol Registration ID of that specimen.
eventId [optional]
Maximum number of records to fetch. By default it will be 100countReq [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.

Result:

Event ID of the 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.

The response of this request will contains contain the details of the specimens. Below is the example of the get specimens:

Expand
titleClick here for more details


URL

...

openspecimen/rest/ng/specimens?label=b1&label=b2
MethodGET
Requestapplication/json
Response


Code Block
[
  {
    "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
  }
]



Specimen custom fields provided the specimen label.

GET  openspecimen/rest/ng/specimens?label={label}&exactMatch=true&includeExtensions=true

Use this resource to get a specimen custom field by providing the specimen label. Specimen custom field details will be found under the 'extensionDetail' element.

Expand
titleClick here for more details


URLopenspecimen/rest/ng/specimens?

...

label=kspl-spec&exactMatch=true&includeExtensions=true
Method GET
Requestapplication/json
Response


Code Block
[
  {
    "opComments": null,
    "id": 405402,
    "cpId": 3698,
    "cprId": 75289,
    "ppid": "17",
    "eventId": 4020,
    "eventCode": "E_1584710879488",
    "eventLabel": "Donor egg Collection_1584710879488",
    "visitId": 57899,
    "visitName": "17_Donor egg Collection_40340",
    "visitStatus": "Complete",
    "sprNo": null,
    "visitDate": 1584705725000,
    "cpShortTitle": "LCP 2",
    "reqId": 279206,
    "sortOrder": null,
    "label": "kspl-spec",
    "barcode": null,
    "type": "Fluid - Not Specified",
    "specimenClass": "Fluid",
    "lineage": "Derived",
    "anatomicSite": "Ovary",
    "laterality": "Left",
    "status": "Collected",
    "reqLabel": "Ovum conc",
    "pathology": "Clinically normal",
    "initialQty": 2,
    "availableQty": 2,
    "concentration": null,
    "parentId": 405401,
    "parentLabel": "17",
    "storageLocation": {
      "id": 383676,
      "name": "SS Child Care Center (Virtual)",
      "mode": "NONE",
      "positionX": null,
      "positionY": null,
      "position": null,
      "reservationId": null
    },
    "storageType": "Virtual",
    "collectionContainer": "28mm Tube",
    "collectionDate": 1584014520000,
    "storageSite": "SS Child Care Center",
    "activityStatus": "Active",
    "createdOn": 1585137720000,
    "createdBy"

...

  "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": 3143,
      "type": "SUPER",
      "firstName": "admin",
      "lastName": "S",
      "loginName": "admin",
      "domain": "openspecimen",
      "emailAddress": "admin@krishagni.com",
      "instituteName": "A1 - For Demo Users",
      "primarySite": null,
      "admin": true,
      "instituteAdmin": false,
      "manageForms": true,
      "cpCount": 0,
      "creationDate": 1577684606000,
      "activityStatus": "Active"
    },
    "code": null,
    "distributionStatus": null,
    "freezeThawCycles": null,
    "imageId": null,
    "externalIds": [],
    "collectionEvent": {
      "id": null,
      "time": 1584014520000,
      "user": {
        "id": 3143,
        "type": "SUPER",
        "firstName": "admin",
        "lastName": "S",
        "loginName": "admin",
        "domain": "openspecimen",
        "emailAddress": "admin@krishagni.com",
        "instituteName": "A1 - For Demo Users",
        "primarySite": null,
        "admin": true,
        "instituteAdmin": false,
        "manageForms": true,
        "cpCount": 0,
        "creationDate": 1577684606000,
        "activityStatus": "Active"
      },
      "comments": null,
      "specimenLabel": null,
      "specimenId": null,
      "procedure": "Collect",
      "container": "28mm Tube"
    },
    "receivedEvent": {
      "id": null,
      "time": 1585137720000,
      "user": {
        "id": 3247,
        "type": "NONE",
        "firstName": "Joel",
        "lastName": "Jolly",
        "loginName": "Jo",
        "domain": "openspecimen",
        "emailAddress": "dfhk.g@gmail.com",
        "instituteName": "Training Institute Shreya",
        "primarySite": "SS Child Care Center",
        "admin": false,
        "instituteAdmin": false,
        "manageForms": true,
        "cpCount": 0,
        "creationDate": 1579858226000,
        "activityStatus": "Active"
      },
      "comments": null,
      "specimenLabel": null,
      "specimenId": null,
      "receivedQuality": "To be Received"
    },
    "labelFmt": "%PSPEC_LABEL%-%PSPEC_UID%",
    "labelAutoPrintMode": "ON_COLLECTION",
    "biohazards": [],
    "comments": null,
    "children": null,
    "pooledSpecimenId": null,
    "pooledSpecimenLabel": null,
    "specimensPool": null,
    "poolSpecimen": null,
    "reqCode": "LO_1584710879488",
    "extensionDetail": {
      "id": 1104514,
      "objectId": 405402,
      "formId": 6426,
      "formCaption": "Demo",
      "attrs": [
        {
          "name": "FC2",
          "udn": "userName",
          "caption": "User Name",
          "value": "2351",
          "type": "userField",
          "displayValue": "A C"
        }
      ],
      "useUdn": false
    },
    "reserved": false,
    "uid": null,
    "parentUid": null,
    "dpId": null
  }
]



Specimen details provided specimen id.

GET openspecimen/rest/ng/specimens/{specimen_id}

Use this resource to get specimen details by specimen id.

Expand
titleClick here for more details


URLopenspecimen/rest/ng/specimens/405411
methodGET
Requestapplication/json
Response


Code Block
{
  "opComments": null,
  "id": 405411,
  "cpId": 3698,
  "cprId": 75484,
  "ppid": "18",
  "eventId": 4020,
  "eventCode": "E_1584710879488",
  "eventLabel": "Donor egg Collection_1584710879488",
  "visitId": 57903,
  "visitName": "18_Donor egg Collection_40343",
  "visitStatus": "Complete",
  "sprNo": null,
  "visitDate": 1584710831000,
  "cpShortTitle": "LCP 2",
  "reqId": 279205,
  "sortOrder": null,
  "label": "18",
  "barcode": null,
  "type": "Fluid - Not Specified",
  "specimenClass": "Fluid",
  "lineage": "New",
  "anatomicSite": "Ovary",
  "laterality": "Left",
  "status": "Collected",
  "reqLabel": "Egg Collection",
  "pathology": "Clinically normal",
  "initialQty": 5,
  "availableQty": 5,
  "concentration": null,
  "parentId": null,
  "parentLabel": null,
  "storageLocation": {
    "id": -1,
    "name": null,
    "mode": null,
    "positionX": null,
    "positionY": null,
    "position": null,
    "reservationId": null
  },
  "storageType": "Manual",
  "collectionContainer": "28mm Tube",
  "collectionDate": 1584710820000,
  "storageSite": null,
  "activityStatus": "Active",
  "createdOn": 1584710820000,
  "createdBy": null,
  "code": null,
  "distributionStatus": null,
  "freezeThawCycles": 2,
  "imageId": null,
  "externalIds": [],
  "collectionEvent": {
    "id": 1102224,
    "time": 1584710820000,
    "user": {
      "id": 3143,
      "type": "SUPER",
      "firstName": "admin",
      "lastName": "S",
      "loginName": "admin",
      "domain": "openspecimen",
      "emailAddress": "admin@krishagni.com",
      "instituteName": "A1 - For Demo Users",
      "primarySite": null,
      "admin": true,
      "instituteAdmin": false,
      "manageForms": true,
      "cpCount": 0,
      "creationDate": 1577684606000,
      "activityStatus": "Active"
    },
    "comments": null,
    "specimenLabel": null,
    "specimenId": null,
    "procedure": "Collect",
    "container": "28mm Tube"
  },
  "receivedEvent": {
    "id": 1102225,
    "time": 1584710820000,
    "user": {
      "id": 3247,
      "type": "NONE",
      "firstName": "Joel",
      "lastName": "Jolly",
      "loginName": "Jo",
      "domain": "openspecimen",
      "emailAddress": "dfhk.g@gmail.com",
      "instituteName": "Training Institute Shreya",
      "primarySite": "SS Child Care Center",
      "admin": false,
      "instituteAdmin": false,
      "manageForms": true,
      "cpCount": 0,
      "creationDate": 1579858226000,
      "activityStatus": "Active"
    },
    "comments": null,
    "specimenLabel": null,
    "specimenId": null,
    "receivedQuality": "To be Received"
  },
  "labelFmt": "%PPI%_%PSPEC_UID(2)%",
  "labelAutoPrintMode": "ON_COLLECTION",
  "biohazards": [],
  "comments": null,
  "children": [
    {
      "opComments": null,
      "id": 405412,
      "cpId": 3698,
      "cprId": 75484,
      "ppid": "18",
      "eventId": 4020,
      "eventCode": "E_1584710879488",
      "eventLabel": "Donor egg Collection_1584710879488",
      "visitId": 57903,
      "visitName": "18_Donor egg Collection_40343",
      "visitStatus": "Complete",
      "sprNo": null,
      "visitDate": 1584710831000,
      "cpShortTitle": "LCP 2",
      "reqId": 279206,
      "sortOrder": null,
      "label": "18-1",
      "barcode": null,
      "type": "Fluid - Not Specified",
      "specimenClass": "Fluid",
      "lineage": "Derived",
      "anatomicSite": "Ovary",
      "laterality": "Left",
      "status": "Collected",
      "reqLabel": "Ovum conc",
      "pathology": "Clinically normal",
      "initialQty": 2,
      "availableQty": 2,
      "concentration": null,
      "parentId": 405411,
      "parentLabel": "18",
      "storageLocation": {
        "id": -1,
        "name": null,
        "mode": null,
        "positionX": null,
        "positionY": null,
        "position": null,
        "reservationId": null
      },
      "storageType": "Virtual",
      "collectionContainer": "28mm Tube",
      "collectionDate": 1584710820000,
      "storageSite": null,
      "activityStatus": "Active",
      "createdOn": 1584710820000,
      "createdBy": {
        "id": 3143,
        "type": "SUPER",
        "firstName": "admin",
        "lastName": "S",
        "loginName": "admin",
        "domain": "openspecimen",
        "emailAddress": "admin@krishagni.com",
        "instituteName": "A1 - For Demo Users",
        "primarySite": null,
        "admin": true,
        "instituteAdmin": false,
        "manageForms": true,
        "cpCount": 0,
        "creationDate": 1577684606000,
        "activityStatus": "Active"
      },
      "code": null,
      "distributionStatus": null,
      "freezeThawCycles": 2,
      "imageId": null,
      "externalIds": [],
      "collectionEvent": {
        "id": null,
        "time": 1584710820000,
        "user": {
          "id": 3143,
          "type": "SUPER",
          "firstName": "admin",
          "lastName": "S",
          "loginName": "admin",
          "domain": "openspecimen",
          "emailAddress": "admin@krishagni.com",
          "instituteName": "A1 - For Demo Users",
          "primarySite": null,
          "admin": true,
          "instituteAdmin": false,
          "manageForms": true,
          "cpCount": 0,
          "creationDate": 1577684606000,
          "activityStatus": "Active"
        },
        "comments": null,
        "specimenLabel": null,
        "specimenId": null,
        "procedure": "Collect",
        "container": "28mm Tube"
      },
      "receivedEvent": {
        "id": null,
        "time": 1584710820000,
        "user": {
          "id": 3247,
          "type": "NONE",
          "firstName": "Joel",
          "lastName": "Jolly",
          "loginName": "Jo",
          "domain": "openspecimen",
          "emailAddress": "dfhk.g@gmail.com",
          "instituteName": "Training Institute Shreya",
          "primarySite": "SS Child Care Center",
          "admin": false,
          "instituteAdmin": false,
          "manageForms": true,
          "cpCount": 0,
          "creationDate": 1579858226000,
          "activityStatus": "Active"
        },
        "comments": null,
        "specimenLabel": null,
        "specimenId": null,
        "receivedQuality": "To be Received"
      },
      "labelFmt": "%PSPEC_LABEL%-%PSPEC_UID%",
      "labelAutoPrintMode": "ON_COLLECTION",
      "biohazards": [],
      "comments": null,
      "children": [],
      "pooledSpecimenId": null,
      "pooledSpecimenLabel": null,
      "specimensPool": null,
      "poolSpecimen": false,
      "reqCode": "LO_1584710879488",
      "extensionDetail": null,
      "reserved": false,
      "uid": null,
      "parentUid": null,
      "dpId": null
    }
  ],
  "pooledSpecimenId": null,
  "pooledSpecimenLabel": null,
  "specimensPool": null,
  "poolSpecimen": false,
  "reqCode": "EC_1584710879488",
  "extensionDetail": null,
  "reserved": false,
  "uid": null,
  "parentUid": null,
  "dpId": null
}




Error Cases :

code
Applies to
Status Message
200All resourcesSpecimens got successfully
401All requestsAuthorization failed, the user doesn’t have authority
500All requestsInternal server error, encountered server error while performing operations