comparison 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
comparison
equal deleted inserted replaced
1979:9e0f408db796 1980:ebce5f456b8e
574 574
575 void ParsedDicomFile::Insert(const DicomTag& tag, 575 void ParsedDicomFile::Insert(const DicomTag& tag,
576 const Json::Value& value, 576 const Json::Value& value,
577 bool decodeDataUriScheme) 577 bool decodeDataUriScheme)
578 { 578 {
579 if (pimpl_->file_->getDataset()->tagExists(ToDcmtkBridge::Convert(tag)))
580 {
581 throw OrthancException(ErrorCode_AlreadyExistingTag);
582 }
583
579 InvalidateCache(); 584 InvalidateCache();
580 585
581 std::auto_ptr<DcmElement> element(FromDcmtkBridge::FromJson(tag, value, decodeDataUriScheme, GetEncoding())); 586 std::auto_ptr<DcmElement> element(FromDcmtkBridge::FromJson(tag, value, decodeDataUriScheme, GetEncoding()));
582 InsertInternal(*pimpl_->file_->getDataset(), element.release()); 587 InsertInternal(*pimpl_->file_->getDataset(), element.release());
583 } 588 }