comparison 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
comparison
equal deleted inserted replaced
5827:976872a99d39 5828:7030fa489669
22 22
23 23
24 #pragma once 24 #pragma once
25 25
26 #include "../../../OrthancFramework/Sources/DicomFormat/DicomTag.h" 26 #include "../../../OrthancFramework/Sources/DicomFormat/DicomTag.h"
27 #include "../Search/DatabaseConstraints.h" 27 #include "../Search/DatabaseDicomTagConstraints.h"
28 #include "../Search/DatabaseMetadataConstraint.h"
28 #include "../Search/DicomTagConstraint.h" 29 #include "../Search/DicomTagConstraint.h"
29 #include "../Search/ISqlLookupFormatter.h" 30 #include "../Search/ISqlLookupFormatter.h"
30 #include "../ServerEnumerations.h" 31 #include "../ServerEnumerations.h"
31 #include "OrthancIdentifiers.h" 32 #include "OrthancIdentifiers.h"
32 33
230 231
231 private: 232 private:
232 // filter & ordering fields 233 // filter & ordering fields
233 ResourceType level_; // The level of the response (the filtering on tags, labels and metadata also happens at this level) 234 ResourceType level_; // The level of the response (the filtering on tags, labels and metadata also happens at this level)
234 OrthancIdentifiers orthancIdentifiers_; // The response must belong to this Orthanc resources hierarchy 235 OrthancIdentifiers orthancIdentifiers_; // The response must belong to this Orthanc resources hierarchy
235 DatabaseConstraints dicomTagConstraints_; // All tags filters (note: the order is not important) 236 DatabaseDicomTagConstraints dicomTagConstraints_; // All tags filters (note: the order is not important)
236 bool hasLimits_; 237 bool hasLimits_;
237 uint64_t limitsSince_; 238 uint64_t limitsSince_;
238 uint64_t limitsCount_; 239 uint64_t limitsCount_;
239 std::set<std::string> labels_; 240 std::set<std::string> labels_;
240 LabelsConstraint labelsConstraint_; 241 LabelsConstraint labelsConstraint_;
241 242
242 // TODO-FIND
243 std::deque<Ordering*> ordering_; // The ordering criteria (note: the order is important !) 243 std::deque<Ordering*> ordering_; // The ordering criteria (note: the order is important !)
244 std::deque<void*> /* TODO-FIND */ metadataConstraints_; // All metadata filters (note: the order is not important) 244 std::deque<DatabaseMetadataConstraint*> metadataConstraints_; // All metadata filters (note: the order is not important)
245 245
246 bool retrieveMainDicomTags_; 246 bool retrieveMainDicomTags_;
247 bool retrieveMetadata_; 247 bool retrieveMetadata_;
248 bool retrieveLabels_; 248 bool retrieveLabels_;
249 bool retrieveAttachments_; 249 bool retrieveAttachments_;
282 const OrthancIdentifiers& GetOrthancIdentifiers() const 282 const OrthancIdentifiers& GetOrthancIdentifiers() const
283 { 283 {
284 return orthancIdentifiers_; 284 return orthancIdentifiers_;
285 } 285 }
286 286
287 DatabaseConstraints& GetDicomTagConstraints() 287 DatabaseDicomTagConstraints& GetDicomTagConstraints()
288 { 288 {
289 return dicomTagConstraints_; 289 return dicomTagConstraints_;
290 } 290 }
291 291
292 const DatabaseConstraints& GetDicomTagConstraints() const 292 const DatabaseDicomTagConstraints& GetDicomTagConstraints() const
293 { 293 {
294 return dicomTagConstraints_; 294 return dicomTagConstraints_;
295 } 295 }
296 296
297 size_t GetMetadataConstraintsCount() const 297 size_t GetMetadataConstraintsCount() const
323 OrderingDirection direction); 323 OrderingDirection direction);
324 324
325 const std::deque<Ordering*>& GetOrdering() const 325 const std::deque<Ordering*>& GetOrdering() const
326 { 326 {
327 return ordering_; 327 return ordering_;
328 }
329
330 void AddMetadataConstraint(DatabaseMetadataConstraint* constraint);
331
332 const std::deque<DatabaseMetadataConstraint*>& GetMetadataConstraint() const
333 {
334 return metadataConstraints_;
328 } 335 }
329 336
330 void SetLabels(const std::set<std::string>& labels) 337 void SetLabels(const std::set<std::string>& labels)
331 { 338 {
332 labels_ = labels; 339 labels_ = labels;