# HG changeset patch # User Sebastien Jodogne # Date 1623931234 -7200 # Node ID 651f069c7f77ff6cfe17012522d42702a31acc58 # Parent da1edb7d6332a1ad68c8fa9e7e1a63876f54faf3 fix error if overriding existing tag in the DICOM dictionary diff -r da1edb7d6332 -r 651f069c7f77 OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp --- a/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp Wed Jun 16 17:37:47 2021 +0200 +++ b/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp Thu Jun 17 14:00:34 2021 +0200 @@ -452,13 +452,17 @@ { DictionaryLocker locker; - if (locker->findEntry(name.c_str())) + if (locker->findEntry(DcmTagKey(tag.GetGroup(), tag.GetElement()), + privateCreator.empty() ? NULL : privateCreator.c_str())) { throw OrthancException(ErrorCode_AlreadyExistingTag, - "Cannot register two tags with the same symbolic name \"" + name + "\""); + "Cannot register twice the tag (" + tag.Format() + + "), whose symbolic name is \"" + name + "\""); } - - locker->addEntry(entry.release()); + else + { + locker->addEntry(entry.release()); + } } }