Mercurial > hg > orthanc-stone
diff Framework/Oracle/ParseDicomFileCommand.cpp @ 1116:a08699daf78b broker
ParsedDicomFileCache
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 04 Nov 2019 15:54:35 +0100 |
parents | 3730956f41a5 |
children | a8bf81756839 |
line wrap: on
line diff
--- a/Framework/Oracle/ParseDicomFileCommand.cpp Thu Oct 31 18:38:26 2019 +0100 +++ b/Framework/Oracle/ParseDicomFileCommand.cpp Mon Nov 04 15:54:35 2019 +0100 @@ -28,39 +28,28 @@ namespace OrthancStone { ParseDicomFileCommand::SuccessMessage::SuccessMessage(const ParseDicomFileCommand& command, - DcmFileFormat& content) : - OriginMessage(command) + DcmFileFormat& content, + size_t fileSize) : + OriginMessage(command), + fileSize_(fileSize) { dicom_.reset(new Orthanc::ParsedDicomFile(content)); - } - - Orthanc::ParsedDicomFile& ParseDicomFileCommand::SuccessMessage::GetDicom() const - { - if (dicom_.get()) + if (!dicom_->GetTagValue(sopInstanceUid_, Orthanc::DICOM_TAG_SOP_INSTANCE_UID)) { - return *dicom_; - } - else - { - throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); + throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat, + "DICOM instance missing tag SOPInstanceUID"); } } - Orthanc::ParsedDicomFile* ParseDicomFileCommand::SuccessMessage::ReleaseDicom() + boost::shared_ptr<Orthanc::ParsedDicomFile> ParseDicomFileCommand::SuccessMessage::GetDicom() const { - if (dicom_.get()) - { - return dicom_.release(); - } - else - { - throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); - } + assert(dicom_.get() != NULL); + return dicom_; } - + std::string ParseDicomFileCommand::GetDicomDirPath(const std::string& dicomDirPath, const std::string& file) {