Got feedback or spotted a mistake?

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

Update Specimen

PUT openspecimen/rest/ng/specimens/{specimenId}

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:

  • useUdn: This allows the usage of attributes UDN name.
  • attrsMap: This is a map of the attribute name-value.

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": {
    "useUdn": true,
    "attrsMap": {
      "usb_ext_lab_number": "Ext_Lab_USA_12342",
      "visited": ["India", "USA", "Spain"]
    }
  }

}

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": {
    "id": 1302,
    "objectId": 850,
     "formId": 201,
    "formCaption": "External Fields",
    "attrs": [{
      "name": "ST3",
      "udn": "usb_ext_lab_number",
      "caption": "External Laboratory Number",
      "value": "Ext_Lab_USA_12342",
      "type": "stringTextField",
      "displayValue": "Ext_Lab_USA_12342"
    },
    {
      "name": "MLB4",
      "udn": "visited",
      "caption": "Visited",
      "value": ["India", "USA", "Spain"],
      "type": "multiSelectListbox",
      "displayValue": "India, USA, Spain"

    }],
    "useUdn": false
  }

}


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
Got feedback or spotted a mistake?

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