Mercurial > hg > orthanc
diff Core/DicomParsing/DicomModification.cpp @ 2521:6db878376018
support anonymization of CurrentRequestedProcedureEvidenceSequence
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 09 Apr 2018 17:59:16 +0200 |
parents | b94ed97508e6 |
children | d3476d90dcb7 |
line wrap: on
line diff
--- a/Core/DicomParsing/DicomModification.cpp Thu Mar 29 16:14:10 2018 +0200 +++ b/Core/DicomParsing/DicomModification.cpp Mon Apr 09 17:59:16 2018 +0200 @@ -125,15 +125,33 @@ ValueRepresentation vr, const std::string& value) { - if ((tag == DICOM_TAG_FRAME_OF_REFERENCE_UID || - tag == DICOM_TAG_REFERENCED_FRAME_OF_REFERENCE_UID || - tag == DICOM_TAG_REFERENCED_SOP_INSTANCE_UID || - tag == DICOM_TAG_RELATED_FRAME_OF_REFERENCE_UID) && - IsEnabled(tag)) + if (!IsEnabled(tag)) + { + return Action_None; + } + else if (tag == DICOM_TAG_FRAME_OF_REFERENCE_UID || + tag == DICOM_TAG_REFERENCED_FRAME_OF_REFERENCE_UID || + tag == DICOM_TAG_REFERENCED_SOP_INSTANCE_UID || + tag == DICOM_TAG_RELATED_FRAME_OF_REFERENCE_UID) { newValue = that_.MapDicomIdentifier(Toolbox::StripSpaces(value), ResourceType_Instance); return Action_Replace; } + else if (parentTags.size() == 1 && + parentTags[0] == DICOM_TAG_CURRENT_REQUESTED_PROCEDURE_EVIDENCE_SEQUENCE && + tag == DICOM_TAG_STUDY_INSTANCE_UID) + { + newValue = that_.MapDicomIdentifier(Toolbox::StripSpaces(value), ResourceType_Study); + return Action_Replace; + } + else if (parentTags.size() == 2 && + parentTags[0] == DICOM_TAG_CURRENT_REQUESTED_PROCEDURE_EVIDENCE_SEQUENCE && + parentTags[1] == DICOM_TAG_REFERENCED_SERIES_SEQUENCE && + tag == DICOM_TAG_SERIES_INSTANCE_UID) + { + newValue = that_.MapDicomIdentifier(Toolbox::StripSpaces(value), ResourceType_Series); + return Action_Replace; + } else { return Action_None;