# HG changeset patch # User Alain Mazy # Date 1664208663 -7200 # Node ID 0b27bbd19b1fa14f6f16fd86973daded01405ee8 # Parent 4366b4c414411b6320b35c3793f69489f54e83c0 loosen the sanity checks for DICOM modifications diff -r 4366b4c41441 -r 0b27bbd19b1f NEWS --- a/NEWS Wed Aug 31 10:36:38 2022 +0200 +++ b/NEWS Mon Sep 26 18:11:03 2022 +0200 @@ -1,3 +1,16 @@ +Pending changes in the mainline +=============================== + +REST API +-------- + +* Loosen the sanity checks for DICOM modifications: + - allow modification of PatientID at study level + - allow modification of PatientID, StudyInstanceUID at series level + - allow modification of PatientID, StudyInstanceUID, SeriesInstanceUID at instance level + - allow modification of a patient without changing her PatientID + + version 1.11.2 (2022-08-30) =========================== diff -r 4366b4c41441 -r 0b27bbd19b1f OrthancFramework/Sources/DicomParsing/DicomModification.cpp --- a/OrthancFramework/Sources/DicomParsing/DicomModification.cpp Wed Aug 31 10:36:38 2022 +0200 +++ b/OrthancFramework/Sources/DicomParsing/DicomModification.cpp Mon Sep 26 18:11:03 2022 +0200 @@ -926,12 +926,6 @@ bool isReplacedPatientId = (IsReplaced(DICOM_TAG_PATIENT_ID) || uids_.find(DICOM_TAG_PATIENT_ID) != uids_.end()); - if (level_ == ResourceType_Patient && !isReplacedPatientId) - { - throw OrthancException(ErrorCode_BadRequest, - "When modifying a patient, her PatientID is required to be modified"); - } - if (!allowManualIdentifiers_) { if (level_ == ResourceType_Patient && IsReplaced(DICOM_TAG_STUDY_INSTANCE_UID)) @@ -955,12 +949,6 @@ // Sanity checks at the study level - if (level_ == ResourceType_Study && isReplacedPatientId) - { - throw OrthancException(ErrorCode_BadRequest, - "When modifying a study, the parent PatientID cannot be manually modified"); - } - if (!allowManualIdentifiers_) { if (level_ == ResourceType_Study && IsReplaced(DICOM_TAG_SERIES_INSTANCE_UID)) @@ -978,18 +966,6 @@ // Sanity checks at the series level - if (level_ == ResourceType_Series && isReplacedPatientId) - { - throw OrthancException(ErrorCode_BadRequest, - "When modifying a series, the parent PatientID cannot be manually modified"); - } - - if (level_ == ResourceType_Series && IsReplaced(DICOM_TAG_STUDY_INSTANCE_UID)) - { - throw OrthancException(ErrorCode_BadRequest, - "When modifying a series, the parent StudyInstanceUID cannot be manually modified"); - } - if (!allowManualIdentifiers_) { if (level_ == ResourceType_Series && IsReplaced(DICOM_TAG_SOP_INSTANCE_UID)) @@ -999,26 +975,6 @@ } } - - // Sanity checks at the instance level - if (level_ == ResourceType_Instance && isReplacedPatientId) - { - throw OrthancException(ErrorCode_BadRequest, - "When modifying an instance, the parent PatientID cannot be manually modified"); - } - - if (level_ == ResourceType_Instance && IsReplaced(DICOM_TAG_STUDY_INSTANCE_UID)) - { - throw OrthancException(ErrorCode_BadRequest, - "When modifying an instance, the parent StudyInstanceUID cannot be manually modified"); - } - - if (level_ == ResourceType_Instance && IsReplaced(DICOM_TAG_SERIES_INSTANCE_UID)) - { - throw OrthancException(ErrorCode_BadRequest, - "When modifying an instance, the parent SeriesInstanceUID cannot be manually modified"); - } - // (0) Create a summary of the source file, if a custom generator // is provided if (identifierGenerator_ != NULL)