changeset 5612:599ce5ed126c find-refactoring

added more tolerance to behave like previous releases
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 09 May 2024 11:31:05 +0200
parents d4b570834d3a
children f1ce8dd361b7
files OrthancServer/Sources/ResourceFinder.cpp
diffstat 1 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/Sources/ResourceFinder.cpp	Thu May 09 10:36:03 2024 +0200
+++ b/OrthancServer/Sources/ResourceFinder.cpp	Thu May 09 11:31:05 2024 +0200
@@ -404,8 +404,10 @@
     {
       if (request_.GetLevel() == ResourceType_Patient)
       {
-        throw OrthancException(ErrorCode_ParameterOutOfRange, "Requested tag " + tag.Format() +
-                               " is only available at the study/series/instance levels");
+        LOG(WARNING) << "Requested tag " << tag.Format()
+                     << " should only be read at the study, series, or instance level";
+        requestedTagsFromFileStorage_.insert(tag);
+        request_.SetRetrieveOneInstanceIdentifier(true);
       }
       else
       {
@@ -419,8 +421,10 @@
       if (request_.GetLevel() == ResourceType_Patient ||
           request_.GetLevel() == ResourceType_Study)
       {
-        throw OrthancException(ErrorCode_ParameterOutOfRange, "Requested tag " + tag.Format() +
-                               " is only available at the series/instance levels");
+        LOG(WARNING) << "Requested tag " << tag.Format()
+                     << " should only be read at the series or instance level";
+        requestedTagsFromFileStorage_.insert(tag);
+        request_.SetRetrieveOneInstanceIdentifier(true);
       }
       else
       {
@@ -435,8 +439,10 @@
           request_.GetLevel() == ResourceType_Study ||
           request_.GetLevel() == ResourceType_Series)
       {
-        throw OrthancException(ErrorCode_ParameterOutOfRange, "Requested tag " + tag.Format() +
-                               " is only available at the instance level");
+        LOG(WARNING) << "Requested tag " << tag.Format()
+                     << " should only be read at the instance level";
+        requestedTagsFromFileStorage_.insert(tag);
+        request_.SetRetrieveOneInstanceIdentifier(true);
       }
       else
       {