Got feedback or spotted a mistake?

Leave a comment at the end of this page or email contact@krishagni.com

Specimen Search

Specimen details provided multiple parameters.

GET openspecimen/rest/ng/specimens?label={label1}&label={label2}&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. 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 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 contain the details of the specimens. Below is the example of the get specimens:

 Click here for more details
URLopenspecimen/rest/ng/specimens?label=b1&label=b2
MethodGET
Requestapplication/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
  }
]

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.

 Click here for more details
URLopenspecimen/rest/ng/specimens?label=kspl-spec&exactMatch=true&includeExtensions=true
Method GET
Requestapplication/json
Response
[
  {
    "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": {
      "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.

 Click here for more details
URLopenspecimen/rest/ng/specimens/405411
methodGET
Requestapplication/json
Response
{
  "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
Got feedback or spotted a mistake?

Leave a comment at the end of this page or email contact@krishagni.com