Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: SI: Added custom-fields creation object in the JSON.

...

ParameterDetails
labelLabel given to specimen
specimenClassClass of the specimen.
typeSpecimen type of specimen. The specimen type should belong to specimen class.
pathologyPathology status of specimen.
anatomicSiteAnatomic site of the specimen.
lateralityLaterality of the specimen.
initialQtyInitial quantity of the specimen.
availableQtyAvailable quantity of the specimen.
lineageLineage of the specimen. For new specimen the value would be "New".
visitIdVisit ID of the participant under which the specimen will be collected.
statusStatus of the specimen. For collecting specimen the value would be "Collected".
storageLocation [optional]
Storage location to store the created specimen.
The location detail is also a JSON object, which contains :


 

nameName of Container
positionX [optional]X Position in container
positionY [optional]Y Position in container

 


  • As Position is optional, If not given then specimen will be stored virtually.
  • If only container name is given then first available position will be allocated in specified container.If position is not available then throws error message.
concentration [optional]Concentration of specimen.
biohazards [optional]Biohazards of that specimen.
comments [optional]Comments for that specimen.
collectionEvent

This is the JSON object containing the details of collection event.

It has below parameters:

  • user : The user who is creating the specimen. This is JSON object containing user details.
  • time : The timestamp on which the specimen is collected.
  • container [optional] : This is the container type in which the specimen will be collected.
  • procedure [optional] : The procedure of collecting the specimen.
receivedEvent

This is the JSON object containing the details of received event.

It has below parameters :

  • user : The user who received the specimen. This is JSON object containing user details.
  • time : Timestamp when specimen is received.
  • receivedQuality : Quality of specimen when it is received.
extensionDetail [optional]

This is the JSON object containing the details of custom-fields.

It has the below parameters:

  • formCaption: The caption of the extension form.
  • attrs: List of attribute details. This is a JSON object containing attribute details.
  • (attrs) name: This is the name of the attribute. This can be found in the exported form definition (wiki-page).
  • (attrs) caption: This is the caption of the attribute (Optional)
  • (attrs) value: This is the value of the custom field.


Result :

Response of this request contains the details of specimen.

...

URLopenspecimen/rest/ng/specimens
Request typeapplication/json
MethodPOST
json

{
  "lineage":"New",
  "visitId":1,
  "status":"Collected",
  "availableQty":"10",
  "storageLocation":{},
  "collectionEvent":{
    "user":{
      "id":1,
      "firstName":"Admin",
      "lastName":"Admin",
      "loginName":"admin@admin.com",
      "domain":"openspecimen",
      "emailAddress":"admin@admin.com",
      "admin":true,"cpCount":0,
      "creationDate":null
    },
    "time":"2015-12-04T04:14:36.333Z",
    "container":"Not Specified",
    "procedure":"Not Specified"
  },
  "receivedEvent":{
    "user":{
      "id":1,
      "firstName":"Admin",
      "lastName":"Admin",
      "loginName":"admin@admin.com",
      "domain":"openspecimen",
      "emailAddress":"admin@admin.com",
      "admin":true,
      "cpCount":0,
      "creationDate":null
    },
    "time":"2015-12-04T04:14:36.333Z",
    "receivedQuality":"Acceptable"
  },
  "initialQty":"10",
  "concentration":"",
  "label":"unplanned specimen 1",
  "specimenClass":"Fluid",
  "type":"Bone Marrow Plasma",
  "pathology":"Non-Malignant, Diseased",
  "anatomicSite":"External ear",
  "laterality":"Right",

  "extensionDetail": {
    "formCaption": "External Fields",
    "attrs": [{
    "name": "ST3",
    "caption": "External Laboratory Number",
    "value": "Ext_Lab_UK_12342"

    }]
  }
}

Response

{

  "id": 9,

  "cpId": 1,

  "cprId": 1,

  "eventId": null,

  "visitId": 1,

  "visitName": "first visit",

  "cpShortTitle": "blood",

  "reqId": null,

  "sortOrder": null,

  "label": "unplanned specimen 1",

  "barcode": null,

  "type": "Bone Marrow Plasma",

  "specimenClass": "Fluid",

  "lineage": "New",

  "anatomicSite": "External ear",

  "laterality": "Right",

  "status": "Collected",

  "reqLabel": null,

  "pathology": "Non-Malignant, Diseased",

  "initialQty": 10,

  "availableQty": 10,

  "available": true,

  "concentration": null,

  "parentId": null,

  "parentLabel": null,

  "storageLocation": {

    "id": -1,

    "name": null,

    "positionX": null,

    "positionY": null

  },

  "storageType": null,

  "collectionContainer": null,

  "activityStatus": "Active",

  "createdOn": 1449202440000,

  "code": null,

  "distributed": null,

  "collectionEvent": null,

  "receivedEvent": null,

  "labelFmt": null,

  "biohazards": [],

  "comments": null,

  "closeAfterChildrenCreation": null,

  "children": [],

  "pooledSpecimenId": null,

  "pooledSpecimenLabel": null,

  "specimensPool": null,

  "closeParent": null,

  "poolSpecimen": null, 

  "extensionDetail": {
  "id": 307,
  "objectId": 851,
  "formId": 201,
  "formCaption": "External Fields",
  "attrs": [{
    "name": "ST3",
    "udn": "usb_ext_lab_number",
    "caption": "External Laboratory Number",
    "value": "Ext_Lab_UK_12342",
    "type": "stringTextField",
    "displayValue": null}]
  }

...

}


Error Cases :

code
Applies to
Status Message
200All resourcesSpecimen has been created successfully
400All requestsInvalid parameters, e.g  duplicate label, invalid class Name etc
401All requestsAuthorization failed, User doesn’t have Authority to create specimen for the given visit.
500All requestsInternal server error, Encountered server error while performing operations

...