Update Specimen
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:

 

 

Parameter

Details

label

Label of specimen

specimenClass

Class of the specimen

type

Type of the specimen. The specimen type should belong to specimen class.

anatomicSite

Anatomic site of the specimen.

pathology

Pathology status of specimen.

visitId

The visit ID under which the specimen is collected.

visitName

The visit name of specimen either visitId or visitName should be provided.

lineage

Lineage of specimen.

initialQty

Initial quantity of specimen.

availableQty

Available quantity of specimen.

laterality

Laterality of specimen.

status

Collection 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.

activityStatus

Activity status of specimen.

createdOn

The 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.

URL

openspecimen/rest/ng/specimens/2

Content-type

application/json

Method

PUT

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

200

All resources

Specimen has been updated successfully

400

All requests

Invalid parameters, e.g  duplicate label, duplicate barcode, invalid class Name etc

401

All requests

Authorization failed, User doesn’t have Authority to create specimen for the given collection protocol

404

All requests

Specimen not found, Specimen with the given identifier is not present in the system

500

All requests

Internal 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