comparison Framework/Plugins/IndexBackend.cpp @ 401:a8774581adfc db-protobuf

replaced "WithLabels" and "WithoutLabels", by "Labels" and "LabelsConstraint"
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 07 Apr 2023 22:32:15 +0200
parents 897253c21208
children 82921a29349a
comparison
equal deleted inserted replaced
400:897253c21208 401:a8774581adfc
20 **/ 20 **/
21 21
22 22
23 #include "IndexBackend.h" 23 #include "IndexBackend.h"
24 24
25 #include "../../Resources/Orthanc/Databases/ISqlLookupFormatter.h"
26 #include "../Common/BinaryStringValue.h" 25 #include "../Common/BinaryStringValue.h"
27 #include "../Common/Integer64Value.h" 26 #include "../Common/Integer64Value.h"
28 #include "../Common/Utf8StringValue.h" 27 #include "../Common/Utf8StringValue.h"
29 #include "DatabaseBackendAdapterV2.h" 28 #include "DatabaseBackendAdapterV2.h"
30 #include "DatabaseBackendAdapterV3.h" 29 #include "DatabaseBackendAdapterV3.h"
2063 // New primitive since Orthanc 1.5.2 2062 // New primitive since Orthanc 1.5.2
2064 void IndexBackend::LookupResources(IDatabaseBackendOutput& output, 2063 void IndexBackend::LookupResources(IDatabaseBackendOutput& output,
2065 DatabaseManager& manager, 2064 DatabaseManager& manager,
2066 const std::vector<Orthanc::DatabaseConstraint>& lookup, 2065 const std::vector<Orthanc::DatabaseConstraint>& lookup,
2067 OrthancPluginResourceType queryLevel, 2066 OrthancPluginResourceType queryLevel,
2068 const std::set<std::string>& withLabels, 2067 const std::set<std::string>& labels,
2069 const std::set<std::string>& withoutLabels, 2068 Orthanc::LabelsConstraint labelsConstraint,
2070 uint32_t limit, 2069 uint32_t limit,
2071 bool requestSomeInstance) 2070 bool requestSomeInstance)
2072 { 2071 {
2073 LookupFormatter formatter(manager.GetDialect()); 2072 LookupFormatter formatter(manager.GetDialect());
2074 2073
2075 std::string sql; 2074 std::string sql;
2076 Orthanc::ISqlLookupFormatter::Apply( 2075 Orthanc::ISqlLookupFormatter::Apply(sql, formatter, lookup, Orthanc::Plugins::Convert(queryLevel),
2077 sql, formatter, lookup, Orthanc::Plugins::Convert(queryLevel), 2076 labels, labelsConstraint, limit);
2078 withLabels, withoutLabels, limit);
2079 2077
2080 if (requestSomeInstance) 2078 if (requestSomeInstance)
2081 { 2079 {
2082 // Composite query to find some instance if requested 2080 // Composite query to find some instance if requested
2083 switch (queryLevel) 2081 switch (queryLevel)