Skip to content

PATCH — Correct Stored Attributes

The attribute-correction transaction uses the PATCH method to correct attributes of instances that are already stored, without re-sending them and without changing any UID.

A Kastoria Health extension

DICOM PS3.18 defines no Modify transaction for the Studies Service, so PATCH is a Kastoria Health extension rather than a standard DICOMweb capability. See the DICOM Conformance Statement.

Method Path Corrects
PATCH /studies/{study} Every instance of the study
PATCH /studies/{study}/series/{series} Every instance of the series
PATCH /studies/{study}/series/{series}/instances/{instance} One instance

A correction is all-or-nothing: every instance the path selects is corrected, or none is. UIDs never change, and the version of the study before the correction remains in its version history.

Authorization

PATCH is available when viewer JWT authorization is enabled. The bearer token must carry the dicomweb.modify capability in its scope claim and name the study in its studyInstanceUIDs claim. See Correction authority.

Request

The request body is application/dicom+json, at most 1 MB: a DICOM JSON Data Set (PS3.18 Annex F) naming the attributes to correct.

  • An attribute with a Value is added, or replaced if it is already present.
  • An attribute with "Value": [] is removed.
  • Attributes not named in the body are left unchanged.

Values are checked against their Value Representation before anything is written. A person name is sent as an object of component groups — {"Alphabetic": "DOE^JANE"}.

Which attributes can be corrected, and where

Attributes Corrected through
Patient Name, Patient ID, Patient Birth Date, Patient Sex, Study Date, Study Time, Study Description, Referring Physician Name, Accession Number, Study ID The study resource
Modality, Series Description, Series Number, Series Date, Series Time, Manufacturer, Institution Name, Manufacturer Model Name, Body Part Examined, Protocol Name, Performing Physician Name, Performed Procedure Step Start Date and Time, Request Attributes Sequence The study or series resource
Any other attribute Any of the three resources

UIDs, the attributes that describe the pixel data, Specific Character Set, File Meta attributes and private attributes cannot be corrected. The full list is in the DICOM Conformance Statement.

Response

A successful correction returns 200 (OK) with the same application/dicom+json body as a STOW-RS response: a ReferencedSOPSequence with one item per corrected instance. Search results and retrieved metadata show the corrected values once the study has been processed, as they do after a store.

Error responses carry a JSON body {"error": "<message>"}.

Status codes

Code Description
200 (OK) Every selected instance was corrected
400 (Bad Request) The body is not a valid patch, or names an attribute that cannot be corrected through this resource
401 (Unauthorized) No valid bearer token
403 (Forbidden) The token does not grant correction of this study
404 (Not Found) The study does not exist, or the path selects no instance
409 (Conflict) The study changed while the correction was being applied; nothing was changed
413 (Content Too Large) The body is larger than 1 MB
415 (Unsupported Media Type) The Content-Type is not application/dicom+json
422 (Unprocessable Content) The stored instance cannot take the correction; nothing was changed
500 (Internal Server Error) The server encountered an unexpected error
503 (Service Unavailable) The instance cannot be corrected in its stored transfer syntax, or storage was busy (with Retry-After)

Examples

Correct a patient name and remove a study description

curl -X PATCH "https://dicom.example.com/studies/1.2.840.113619.2.55.3.604688119.868.1234567890.1" \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9. ..." \
  -H "Content-Type: application/dicom+json" \
  -d '{
        "00100010": { "vr": "PN", "Value": [{ "Alphabetic": "DOE^JANE" }] },
        "00081030": { "vr": "LO", "Value": [] }
      }'

Correct the description of one series

curl -X PATCH "https://dicom.example.com/studies/1.2.840.113619.2.55.3.604688119.868.1234567890.1/series/1.2.840.113619.2.55.3.604688119.868.1234567890.2" \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9. ..." \
  -H "Content-Type: application/dicom+json" \
  -d '{ "0008103E": { "vr": "LO", "Value": ["AX T2 FLAIR"] } }'

Successful response

{
  "00081190": { "vr": "UR", "Value": ["https://dicom.example.com/studies/1.2.840.113619.2.55.3.604688119.868.1234567890.1"] },
  "00081199": {
    "vr": "SQ",
    "Value": [
      {
        "00081150": { "vr": "UI", "Value": ["1.2.840.10008.5.1.4.1.1.4"] },
        "00081155": { "vr": "UI", "Value": ["1.2.840.113619.2.55.3.12345.1"] },
        "00081190": {
          "vr": "UR",
          "Value": [
            "https://dicom.example.com/studies/1.2.840.113619.2.55.3.604688119.868.1234567890.1/series/1.2.840.113619.2.55.3.604688119.868.1234567890.2/instances/1.2.840.113619.2.55.3.12345.1"
          ]
        }
      }
    ]
  }
}

See also