diff OrthancServer/ParsedDicomFile.cpp @ 1980:ebce5f456b8e

new error code: ErrorCode_AlreadyExistingTag
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 22 Apr 2016 08:57:33 +0200
parents 9e0f408db796
children 4b545a8b1f95
line wrap: on
line diff
--- a/OrthancServer/ParsedDicomFile.cpp	Fri Apr 22 08:47:43 2016 +0200
+++ b/OrthancServer/ParsedDicomFile.cpp	Fri Apr 22 08:57:33 2016 +0200
@@ -576,6 +576,11 @@
                                const Json::Value& value,
                                bool decodeDataUriScheme)
   {
+    if (pimpl_->file_->getDataset()->tagExists(ToDcmtkBridge::Convert(tag)))
+    {
+      throw OrthancException(ErrorCode_AlreadyExistingTag);
+    }
+
     InvalidateCache();
 
     std::auto_ptr<DcmElement> element(FromDcmtkBridge::FromJson(tag, value, decodeDataUriScheme, GetEncoding()));