Versions Compared

Key

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

...

This API is available for updating the specimen.

 


Parameters:

This API accepts the specimen ID in url and specimen details in JSON format.

The parameters for specimen details are as follows:

 

 



ParameterDetails
labelLabel of specimen
specimenClassClass of the specimen
typeType of the specimen. The specimen type should belong to specimen class.
anatomicSiteAnatomic site of the specimen.
pathologyPathology status of specimen.
visitIdThe visit ID under which the specimen is collected.
visitNameThe visit name of specimen either visitId or visitName should be provided.
lineageLineage of specimen.
initialQtyInitial quantity of specimen.
availableQtyAvailable quantity of specimen.
lateralityLaterality of specimen.
statusCollection status of specimen.
concentration [optional]Concentration of specimen.
parentId [optional]Parent specimen ID.
storageLocation [optional]The storage location in container where specimen will be stored. It is the JSON object containing following fields:
  • name: Name of the storage container
  • positionX [optional]: The X position in storage container.
  • positionY [optional]: The Y position in storage container.

If the positionX and positionY are not given, then the next available position in storage container will be selected.

If the storageLocation is not given for specimen, then the specimen will be made virtual.

storageType [optional]Storage type of the specimen container.
activityStatusActivity status of specimen.
createdOnThe date timestamp when the specimen is created.
biohazards [optional]Biohazards of specimen. This is the JSON array containing strings of biohazards values.
barcode [optional]The barcode of specimen.
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:

 


The result of API call is the updated specimen detail JSON object.

URLopenspecimen/rest/ng/specimens/2
Content-typeapplication/json
MethodPUT
Request JSON

{

  "id":2,

  "visitId":1,

  "visitName":"first visit",

  "label":"plasma1",

  "barcode":null,

  "type":"Plasma",

  "specimenClass":"Fluid",

  "lineage":"New",

  "anatomicSite":"Greater curvature of stomach, NOS",

  "laterality":"Left",

  "status":"Collected",

  "reqLabel":"blood plasma",

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

  "initialQty":250,

  "availableQty":250,

  "available":true,

  "concentration":10,

  "parentId":null,

  "storageLocation":{

    "id":1,

    "name":"Fluid Container",

    "positionX":"2",

    "positionY":"A"

  },

  "collectionContainer":null,

  "activityStatus":"Active",

  "createdOn":1442993220000,

  "biohazards":[

    "Hepatitis C",

    "Hepatitis B"

  ],

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

    }]
  }

}

Response

{

  "id": 2,

  "cpId": 1,

  "cprId": 1,

  "eventId": null,

  "visitId": 1,

  "visitName": "first visit",

  "cpShortTitle": "blood",

  "reqId": 2,

  "sortOrder": null,

  "label": "plasma1",

  "barcode": null,

  "type": "Plasma",

  "specimenClass": "Fluid",

  "lineage": "New",

  "anatomicSite": "Greater curvature of stomach, NOS",

  "laterality": "Left",

  "status": "Collected",

  "reqLabel": "blood plasma",

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

  "initialQty": 250,

  "availableQty": 250,

  "available": true,

  "concentration": 10,

  "parentId": null,

  "parentLabel": null,

  "storageLocation": {

    "id": 1,

    "name": "Fluid Container",

    "positionX": "2",

    "positionY": "A"

  },

  "storageType": "Auto",

  "collectionContainer": null,

  "activityStatus": "Active",

  "createdOn": 1442993220000,

  "code": null,

  "distributed": null,

  "collectionEvent": null,

  "receivedEvent": null,

  "labelFmt": null,

  "biohazards": [

    "Hepatitis C",

    "Hepatitis B"

  ],

  "comments": null,

  "closeAfterChildrenCreation": null,

  "children": [],

  "pooledSpecimenId": null,

  "pooledSpecimenLabel": null,

  "specimensPool": null,

  "closeParent": null,

  "poolSpecimen": false,

  "extensionDetail": 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_US_14146",
    "type": "stringTextField",
    "displayValue": null}]
  }

}


Error Cases :

code
Applies to
Status Message
200All resourcesSpecimen has been updated successfully
400All requestsInvalid parameters, e.g  duplicate label, duplicate barcode, invalid class Name etc
401All requestsAuthorization failed, User doesn’t have Authority to create specimen for the given collection protocol
404All requestsSpecimen not found, Specimen with the given identifier is not present in the system
500All requestsInternal server error, Encountered server error while performing operations

...