diff OrthancServer/Sources/Database/Compatibility/GenericFind.cpp @ 5677:dc96401dbe88 find-refactoring

starting the refactoring of /tools/find
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 08 Jul 2024 19:03:23 +0200
parents b744a2cf408a
children 77875b51cf95
line wrap: on
line diff
--- a/OrthancServer/Sources/Database/Compatibility/GenericFind.cpp	Sat Jul 06 15:04:28 2024 +0200
+++ b/OrthancServer/Sources/Database/Compatibility/GenericFind.cpp	Mon Jul 08 19:03:23 2024 +0200
@@ -114,8 +114,15 @@
     }
 
     void GenericFind::ExecuteFind(std::list<std::string>& identifiers,
-                                  const FindRequest& request)
+                                  const FindRequest& request,
+                                  const IDatabaseWrapper::Capabilities& capabilities)
     {
+      if (!request.GetLabels().empty() &&
+          !capabilities.HasLabelsSupport())
+      {
+        throw OrthancException(ErrorCode_NotImplemented, "The database backend doesn't support labels");
+      }
+
       if (IsRequestWithoutContraint(request) &&
           !request.GetOrthancIdentifiers().HasPatientId() &&
           !request.GetOrthancIdentifiers().HasStudyId() &&
@@ -203,7 +210,8 @@
       }
       else
       {
-        throw OrthancException(ErrorCode_NotImplemented);  // Not supported
+        printf("?????????????????????????\n");
+        throw OrthancException(ErrorCode_NotImplemented);
       }
     }