changeset 5616:1e92fb051fd7 find-refactoring

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 09 May 2024 13:02:51 +0200
parents a10978a5e65c
children 8905ffa45fc2
files OrthancServer/Sources/Database/Compatibility/GenericFind.cpp OrthancServer/Sources/ResourceFinder.cpp
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/Sources/Database/Compatibility/GenericFind.cpp	Thu May 09 12:24:29 2024 +0200
+++ b/OrthancServer/Sources/Database/Compatibility/GenericFind.cpp	Thu May 09 13:02:51 2024 +0200
@@ -59,6 +59,7 @@
         }
       }
       else if (IsRequestWithoutContraint(request) &&
+               request.GetLevel() == ResourceType_Patient &&
                request.GetOrthancIdentifiers().HasPatientId() &&
                !request.GetOrthancIdentifiers().HasStudyId() &&
                !request.GetOrthancIdentifiers().HasSeriesId() &&
@@ -67,6 +68,7 @@
         identifiers.push_back(request.GetOrthancIdentifiers().GetPatientId());
       }
       else if (IsRequestWithoutContraint(request) &&
+               request.GetLevel() == ResourceType_Study &&
                !request.GetOrthancIdentifiers().HasPatientId() &&
                request.GetOrthancIdentifiers().HasStudyId() &&
                !request.GetOrthancIdentifiers().HasSeriesId() &&
@@ -75,6 +77,7 @@
         identifiers.push_back(request.GetOrthancIdentifiers().GetStudyId());
       }
       else if (IsRequestWithoutContraint(request) &&
+               request.GetLevel() == ResourceType_Series &&
                !request.GetOrthancIdentifiers().HasPatientId() &&
                !request.GetOrthancIdentifiers().HasStudyId() &&
                request.GetOrthancIdentifiers().HasSeriesId() &&
@@ -83,6 +86,7 @@
         identifiers.push_back(request.GetOrthancIdentifiers().GetSeriesId());
       }
       else if (IsRequestWithoutContraint(request) &&
+               request.GetLevel() == ResourceType_Instance &&
                !request.GetOrthancIdentifiers().HasPatientId() &&
                !request.GetOrthancIdentifiers().HasStudyId() &&
                !request.GetOrthancIdentifiers().HasSeriesId() &&
--- a/OrthancServer/Sources/ResourceFinder.cpp	Thu May 09 12:24:29 2024 +0200
+++ b/OrthancServer/Sources/ResourceFinder.cpp	Thu May 09 13:02:51 2024 +0200
@@ -546,6 +546,9 @@
 
           LOG(INFO) << "Will retrieve missing DICOM tags from instance: " << instancePublicId;
 
+          // TODO-FIND: What do we do if the DICOM has been removed since the request?
+          // Do we fail, or do we skip the resource?
+
           Json::Value tmpDicomAsJson;
           context.ReadDicomAsJson(tmpDicomAsJson, instancePublicId, missingTags /* ignoreTagLength */);