# HG changeset patch # User Alain Mazy # Date 1757420811 -7200 # Node ID 88b7494557f29c0ec06c471e6ca513978dd636cd # Parent 27fe473be5b7b0986cadec58451aa274413c86a0 show a warning when adding an existing Patient MainDicomTags in the ExtraMainDicomTags at study level diff -r 27fe473be5b7 -r 88b7494557f2 OrthancFramework/Sources/DicomFormat/DicomMap.cpp --- a/OrthancFramework/Sources/DicomFormat/DicomMap.cpp Tue Sep 09 12:54:00 2025 +0200 +++ b/OrthancFramework/Sources/DicomFormat/DicomMap.cpp Tue Sep 09 14:26:51 2025 +0200 @@ -258,6 +258,16 @@ throw OrthancException(ErrorCode_MainDicomTagsMultiplyDefined, tag.Format() + " is already defined", false); } + if (level == ResourceType_Study) // all patients main dicom tags are also copied at study level + { + std::set& patientLevelTags = GetMainDicomTagsByLevelInternal(ResourceType_Patient); + + if (patientLevelTags.find(tag) != patientLevelTags.end()) + { + throw OrthancException(ErrorCode_MainDicomTagsMultiplyDefined, tag.Format() + " is already defined", false); + } + } + existingLevelTags.insert(tag); allMainDicomTags_.insert(tag);