Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: SI: Did review changes

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

...

List of mandatory fields:

  1. Label
  2. TissueSite
  3. TissueSide
  4. PathologicalStatus
  5. Lineage
  6. InitialQuantity
  7. collectionStatus
  8. SpecimenClass
  9. SpecimenType
  10. ActivityStatus
  11. Barcode
  12. Comment
  13. CreatedOn
  14. scgId
Method
URL
PUTcatissuecorespecimen.
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.

Request{ "activityStatusspecimenTypeFecestissueSide "tissueSite" : "Nasal cavity"

}

URLopenspecimen/rest/ng/specimens/{specimen_id}2
Content-typeapplication/json
jsonMethodPUT
Request JSON

{

  "id":2,

  "visitId":1,

  "visitName":"first visit",

  "label":"Activeplasma1",

  "barcode": "245095132null,

  "type":"Plasma",

  "specimenClass":"Fluid",

  "lineage":"New",

  "biohazardDetailsanatomicSite": [  ]"Greater curvature of stomach, NOS",

  "laterality":"Left",

  "collectionStatusstatus":"Collected",

  "reqLabel":"blood plasma",

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

  "initialQty":250,

  "commentavailableQty":250,

  "available": "creating an adhoc specimen."true,

  "concentration":10,

  "parentId":null,

  "createdOnstorageLocation":{

    "id"May 1, 2014 11:21:45 AM":1,

    "name":"Fluid Container",

    "positionX":"2",

    "positionY":"A"

  },

  "collectionContainer":null,

  "activityStatus":"Active",

  "createdOn":1442993220000,

  "externalIdentifierDetailsbiohazards":[

    "Hepatitis C",

    "Hepatitis B"

  ],

  "extensionDetail": {
    "initialQuantityuseUdn": 2.0,

  "label" : "sample_123",

  "lineage" : "New",

  "pathologicalStatus" : "Metastatic",

  "scgId" : 1,

  "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",

 

Response

 

{ "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,

  "barcodereceivedEvent": null,

  "245095132labelFmt": null,

  "biohazardDetailsbiohazards": [

    "Hepatitis C",

    "Hepatitis B"

  ],

  "comments": null,

  "collectionStatus" : "Collected"closeAfterChildrenCreation": null,

  "children": [],

  "pooledSpecimenId": null,

  "pooledSpecimenLabel": null,

  "specimensPool": null,

  "commentcloseParent": "creating an adhoc specimen.",  "createdOn" : "May 1, 2014 11:21:45 AMnull,

  "poolSpecimen": false,

  "extensionDetail": {
    "id": 1302,
    "objectId": 850,
     "formId": 201,
    "formCaption": "External Fields",
    "externalIdentifierDetailsattrs": [  ]{
      "name": "ST3",
      "idudn": 2"usb_ext_lab_number",
      "initialQuantitycaption": 2.0"External Laboratory Number",
      "labelvalue": "sample_123Ext_Lab_USA_12342",
      "type": "stringTextField",
      "lineagedisplayValue": "New"Ext_Lab_USA_12342"
    },
  "pathologicalStatus  {
      "name": "MetastaticMLB4",
      "scgIdudn": 1"visited",
      "specimenClasscaption": "FluidVisited",
      "specimenTypevalue": "Feces"["India", "USA", "Spain"],
      "tissueSidetype": "LeftmultiSelectListbox",
      "tissueSitedisplayValue": "Nasal cavityIndia, USA, Spain"

    }],
    "useUdn": false
  }

}


Error Cases :

code
Applies to
Status Message
200All resourcesSpecimen has been created 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

...