# HG changeset patch # User Alain Mazy # Date 1675178504 -3600 # Node ID a72e00a23191440604719ef2967f7d44b005cbbc # Parent 6ff13c95f62fee669ec01939e80be0ac346c1ee5 allow OtherPatientIDs as a valid tag name as an input since this name is still used in outputs diff -r 6ff13c95f62f -r a72e00a23191 OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp --- a/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp Mon Jan 30 11:31:12 2023 +0100 +++ b/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp Tue Jan 31 16:21:44 2023 +0100 @@ -1253,9 +1253,22 @@ } + static bool GetTagFromNameInternal(DicomTag& tag, const std::string& tagName) + { + // conversion from old tag names (ex: RETIRED_OtherPatientIDs is the new name for OtherPatientIDs that is still a valid name for DICOM_TAG_OTHER_PATIENT_IDS) + if (tagName == "OtherPatientIDs") + { + tag = DICOM_TAG_OTHER_PATIENT_IDS; + return true; + } + + return false; + } + std::string FromDcmtkBridge::GetTagName(const DicomTag& t, const std::string& privateCreator) { + DcmTag tag(t.GetGroup(), t.GetElement()); if (!privateCreator.empty()) @@ -1315,6 +1328,12 @@ } else { + DicomTag dcmTag(0, 0); + if (GetTagFromNameInternal(dcmTag, name)) + { + return dcmTag; + } + CLOG(INFO, DICOM) << "Unknown DICOM tag: \"" << name << "\""; throw OrthancException(ErrorCode_UnknownDicomTag, name, false); }