diff OrthancServer/Sources/Database/FindRequest.h @ 5828:7030fa489669 find-refactoring

tools/find: QueryMetadata
author Alain Mazy <am@orthanc.team>
date Mon, 07 Oct 2024 15:19:26 +0200
parents 093a8693ba16
children
line wrap: on
line diff
--- a/OrthancServer/Sources/Database/FindRequest.h	Mon Oct 07 10:54:40 2024 +0200
+++ b/OrthancServer/Sources/Database/FindRequest.h	Mon Oct 07 15:19:26 2024 +0200
@@ -24,7 +24,8 @@
 #pragma once
 
 #include "../../../OrthancFramework/Sources/DicomFormat/DicomTag.h"
-#include "../Search/DatabaseConstraints.h"
+#include "../Search/DatabaseDicomTagConstraints.h"
+#include "../Search/DatabaseMetadataConstraint.h"
 #include "../Search/DicomTagConstraint.h"
 #include "../Search/ISqlLookupFormatter.h"
 #include "../ServerEnumerations.h"
@@ -232,16 +233,15 @@
     // filter & ordering fields
     ResourceType                         level_;                // The level of the response (the filtering on tags, labels and metadata also happens at this level)
     OrthancIdentifiers                   orthancIdentifiers_;   // The response must belong to this Orthanc resources hierarchy
-    DatabaseConstraints                  dicomTagConstraints_;  // All tags filters (note: the order is not important)
+    DatabaseDicomTagConstraints          dicomTagConstraints_;  // All tags filters (note: the order is not important)
     bool                                 hasLimits_;
     uint64_t                             limitsSince_;
     uint64_t                             limitsCount_;
     std::set<std::string>                labels_;
     LabelsConstraint                     labelsConstraint_;
 
-    // TODO-FIND
     std::deque<Ordering*>                ordering_;             // The ordering criteria (note: the order is important !)
-    std::deque<void*>   /* TODO-FIND */       metadataConstraints_;  // All metadata filters (note: the order is not important)
+    std::deque<DatabaseMetadataConstraint*>  metadataConstraints_;  // All metadata filters (note: the order is not important)
 
     bool                                 retrieveMainDicomTags_;
     bool                                 retrieveMetadata_;
@@ -284,12 +284,12 @@
       return orthancIdentifiers_;
     }
 
-    DatabaseConstraints& GetDicomTagConstraints()
+    DatabaseDicomTagConstraints& GetDicomTagConstraints()
     {
       return dicomTagConstraints_;
     }
 
-    const DatabaseConstraints& GetDicomTagConstraints() const
+    const DatabaseDicomTagConstraints& GetDicomTagConstraints() const
     {
       return dicomTagConstraints_;
     }
@@ -327,6 +327,13 @@
       return ordering_;
     }
 
+    void AddMetadataConstraint(DatabaseMetadataConstraint* constraint);
+
+    const std::deque<DatabaseMetadataConstraint*>& GetMetadataConstraint() const
+    {
+      return metadataConstraints_;
+    }
+
     void SetLabels(const std::set<std::string>& labels)
     {
       labels_ = labels;