# HG changeset patch # User Sebastien Jodogne # Date 1578424922 -3600 # Node ID a8248b08115cc524a0ece2f97f1728db2406bd3b # Parent 964c89e15e7e79a479575752bccdd79c9a31aaf2 LoadedDicomResources::MergeResource() diff -r 964c89e15e7e -r a8248b08115c Framework/Loaders/DicomResourcesLoader.cpp --- a/Framework/Loaders/DicomResourcesLoader.cpp Tue Jan 07 14:23:24 2020 +0100 +++ b/Framework/Loaders/DicomResourcesLoader.cpp Tue Jan 07 20:22:02 2020 +0100 @@ -648,12 +648,12 @@ } - void DicomResourcesLoader::ScheduleWado(boost::shared_ptr target, - int priority, - const DicomSource& source, - const std::string& uri, - const std::set& includeTags, - Orthanc::IDynamicObject* userPayload) + void DicomResourcesLoader::ScheduleGetDicomWeb(boost::shared_ptr target, + int priority, + const DicomSource& source, + const std::string& uri, + const std::set& includeTags, + Orthanc::IDynamicObject* userPayload) { boost::shared_ptr protection(userPayload); diff -r 964c89e15e7e -r a8248b08115c Framework/Loaders/DicomResourcesLoader.h --- a/Framework/Loaders/DicomResourcesLoader.h Tue Jan 07 14:23:24 2020 +0100 +++ b/Framework/Loaders/DicomResourcesLoader.h Tue Jan 07 20:22:02 2020 +0100 @@ -148,21 +148,21 @@ virtual boost::shared_ptr Create(ILoadersContext::ILock& stone); }; - void ScheduleWado(boost::shared_ptr target, - int priority, - const DicomSource& source, - const std::string& uri, - const std::set& includeTags, - Orthanc::IDynamicObject* userPayload); + void ScheduleGetDicomWeb(boost::shared_ptr target, + int priority, + const DicomSource& source, + const std::string& uri, + const std::set& includeTags, + Orthanc::IDynamicObject* userPayload); - void ScheduleWado(boost::shared_ptr target, - int priority, - const DicomSource& source, - const std::string& uri, - Orthanc::IDynamicObject* userPayload) + void ScheduleGetDicomWeb(boost::shared_ptr target, + int priority, + const DicomSource& source, + const std::string& uri, + Orthanc::IDynamicObject* userPayload) { std::set includeTags; - ScheduleWado(target, priority, source, uri, includeTags, userPayload); + ScheduleGetDicomWeb(target, priority, source, uri, includeTags, userPayload); } void ScheduleQido(boost::shared_ptr target, diff -r 964c89e15e7e -r a8248b08115c Framework/Loaders/LoadedDicomResources.cpp --- a/Framework/Loaders/LoadedDicomResources.cpp Tue Jan 07 14:23:24 2020 +0100 +++ b/Framework/Loaders/LoadedDicomResources.cpp Tue Jan 07 20:22:02 2020 +0100 @@ -100,6 +100,23 @@ } + void LoadedDicomResources::MergeResource(Orthanc::DicomMap& target, + const std::string& id) const + { + Resources::const_iterator it = resources_.find(id); + + if (it == resources_.end()) + { + throw Orthanc::OrthancException(Orthanc::ErrorCode_InexistentItem); + } + else + { + assert(it->second != NULL); + target.Merge(*it->second); + } + } + + bool LoadedDicomResources::LookupStringValue(std::string& target, const std::string& id, const Orthanc::DicomTag& tag) const diff -r 964c89e15e7e -r a8248b08115c Framework/Loaders/LoadedDicomResources.h --- a/Framework/Loaders/LoadedDicomResources.h Tue Jan 07 14:23:24 2020 +0100 +++ b/Framework/Loaders/LoadedDicomResources.h Tue Jan 07 20:22:02 2020 +0100 @@ -72,6 +72,9 @@ { return resources_.find(id) != resources_.end(); } + + void MergeResource(Orthanc::DicomMap& target, + const std::string& id) const; bool LookupStringValue(std::string& target, const std::string& id, diff -r 964c89e15e7e -r a8248b08115c Framework/Loaders/SeriesMetadataLoader.cpp --- a/Framework/Loaders/SeriesMetadataLoader.cpp Tue Jan 07 14:23:24 2020 +0100 +++ b/Framework/Loaders/SeriesMetadataLoader.cpp Tue Jan 07 20:22:02 2020 +0100 @@ -258,9 +258,10 @@ { boost::shared_ptr target (new LoadedDicomResources(Orthanc::DICOM_TAG_SOP_INSTANCE_UID)); - loader_->ScheduleWado(target, priority, source, - "/studies/" + studyInstanceUid + "/series/" + seriesInstanceUid + "/metadata", - NULL /* TODO PAYLOAD */); + loader_->ScheduleGetDicomWeb( + target, priority, source, + "/studies/" + studyInstanceUid + "/series/" + seriesInstanceUid + "/metadata", + NULL /* TODO PAYLOAD */); scheduled_[seriesInstanceUid] = priority; }