# HG changeset patch # User Sebastien Jodogne # Date 1623320138 -7200 # Node ID a08ef46c95a1a5a66584da33ce7984eba68610d9 # Parent 13efc0967cea81ab0490b52587e08189153f1b98 applying modifications to subsequences after all the other modifications diff -r 13efc0967cea -r a08ef46c95a1 OrthancFramework/Sources/DicomParsing/DicomModification.cpp --- a/OrthancFramework/Sources/DicomParsing/DicomModification.cpp Thu Jun 10 11:21:22 2021 +0200 +++ b/OrthancFramework/Sources/DicomParsing/DicomModification.cpp Thu Jun 10 12:15:38 2021 +0200 @@ -964,24 +964,7 @@ DicomReplaceMode_InsertIfAbsent, privateCreator_); } - // (6) New in Orthanc 1.9.4: Apply modifications to subsequences - for (ListOfPaths::const_iterator it = removeSequences_.begin(); - it != removeSequences_.end(); ++it) - { - assert(it->GetPrefixLength() > 0); - toModify.RemovePath(*it); - } - - for (SequenceReplacements::const_iterator it = sequenceReplacements_.begin(); - it != sequenceReplacements_.end(); ++it) - { - assert(*it != NULL); - assert((*it)->GetPath().GetPrefixLength() > 0); - toModify.ReplacePath((*it)->GetPath(), (*it)->GetValue(), true /* decode data URI scheme */, - DicomReplaceMode_InsertIfAbsent, privateCreator_); - } - - // (7) Update the DICOM identifiers + // (6) Update the DICOM identifiers if (level_ <= ResourceType_Study && !IsReplaced(DICOM_TAG_STUDY_INSTANCE_UID)) { @@ -1021,7 +1004,7 @@ } } - // (8) Update the "referenced" relationships in the case of an anonymization + // (7) Update the "referenced" relationships in the case of an anonymization if (isAnonymization_) { RelationshipsVisitor visitor(*this); @@ -1035,6 +1018,23 @@ visitor.RemoveRelationships(toModify); } } + + // (8) New in Orthanc 1.9.4: Apply modifications to subsequences + for (ListOfPaths::const_iterator it = removeSequences_.begin(); + it != removeSequences_.end(); ++it) + { + assert(it->GetPrefixLength() > 0); + toModify.RemovePath(*it); + } + + for (SequenceReplacements::const_iterator it = sequenceReplacements_.begin(); + it != sequenceReplacements_.end(); ++it) + { + assert(*it != NULL); + assert((*it)->GetPath().GetPrefixLength() > 0); + toModify.ReplacePath((*it)->GetPath(), (*it)->GetValue(), true /* decode data URI scheme */, + DicomReplaceMode_InsertIfAbsent, privateCreator_); + } } void DicomModification::SetAllowManualIdentifiers(bool check)