Mercurial > hg > orthanc
changeset 5680:68fc5af30c03
added container class DatabaseConstraints
line wrap: on
line diff
--- a/OrthancServer/Plugins/Engine/OrthancPluginDatabase.cpp Tue Jul 09 08:56:50 2024 +0200 +++ b/OrthancServer/Plugins/Engine/OrthancPluginDatabase.cpp Tue Jul 09 10:09:57 2024 +0200 @@ -564,7 +564,7 @@ virtual void ApplyLookupResources(std::list<std::string>& resourcesId, std::list<std::string>* instancesId, - const std::vector<DatabaseConstraint>& lookup, + const DatabaseConstraints& lookup, ResourceType queryLevel, const std::set<std::string>& labels, LabelsConstraint labelsConstraint, @@ -586,20 +586,20 @@ std::vector<OrthancPluginDatabaseConstraint> constraints; std::vector< std::vector<const char*> > constraintsValues; - constraints.resize(lookup.size()); - constraintsValues.resize(lookup.size()); + constraints.resize(lookup.GetSize()); + constraintsValues.resize(lookup.GetSize()); - for (size_t i = 0; i < lookup.size(); i++) + for (size_t i = 0; i < lookup.GetSize(); i++) { - lookup[i].EncodeForPlugins(constraints[i], constraintsValues[i]); + lookup.GetConstraint(i).EncodeForPlugins(constraints[i], constraintsValues[i]); } ResetAnswers(); answerMatchingResources_ = &resourcesId; answerMatchingInstances_ = instancesId; - CheckSuccess(that_.extensions_.lookupResources(that_.GetContext(), that_.payload_, lookup.size(), - (lookup.empty() ? NULL : &constraints[0]), + CheckSuccess(that_.extensions_.lookupResources(that_.GetContext(), that_.payload_, lookup.GetSize(), + (lookup.IsEmpty() ? NULL : &constraints[0]), Plugins::Convert(queryLevel), limit, (instancesId == NULL ? 0 : 1))); }
--- a/OrthancServer/Plugins/Engine/OrthancPluginDatabaseV3.cpp Tue Jul 09 08:56:50 2024 +0200 +++ b/OrthancServer/Plugins/Engine/OrthancPluginDatabaseV3.cpp Tue Jul 09 10:09:57 2024 +0200 @@ -798,7 +798,7 @@ virtual void ApplyLookupResources(std::list<std::string>& resourcesId, std::list<std::string>* instancesId, // Can be NULL if not needed - const std::vector<DatabaseConstraint>& lookup, + const DatabaseConstraints& lookup, ResourceType queryLevel, const std::set<std::string>& labels, LabelsConstraint labelsConstraint, @@ -812,16 +812,16 @@ std::vector<OrthancPluginDatabaseConstraint> constraints; std::vector< std::vector<const char*> > constraintsValues; - constraints.resize(lookup.size()); - constraintsValues.resize(lookup.size()); + constraints.resize(lookup.GetSize()); + constraintsValues.resize(lookup.GetSize()); - for (size_t i = 0; i < lookup.size(); i++) + for (size_t i = 0; i < lookup.GetSize(); i++) { - lookup[i].EncodeForPlugins(constraints[i], constraintsValues[i]); + lookup.GetConstraint(i).EncodeForPlugins(constraints[i], constraintsValues[i]); } - CheckSuccess(that_.backend_.lookupResources(transaction_, lookup.size(), - (lookup.empty() ? NULL : &constraints[0]), + CheckSuccess(that_.backend_.lookupResources(transaction_, lookup.GetSize(), + (lookup.IsEmpty() ? NULL : &constraints[0]), Plugins::Convert(queryLevel), limit, (instancesId == NULL ? 0 : 1))); CheckNoEvent();
--- a/OrthancServer/Plugins/Engine/OrthancPluginDatabaseV4.cpp Tue Jul 09 08:56:50 2024 +0200 +++ b/OrthancServer/Plugins/Engine/OrthancPluginDatabaseV4.cpp Tue Jul 09 10:09:57 2024 +0200 @@ -975,7 +975,7 @@ virtual void ApplyLookupResources(std::list<std::string>& resourcesId, std::list<std::string>* instancesId, // Can be NULL if not needed - const std::vector<DatabaseConstraint>& lookup, + const DatabaseConstraints& lookup, ResourceType queryLevel, const std::set<std::string>& labels, LabelsConstraint labelsConstraint, @@ -992,44 +992,46 @@ request.mutable_lookup_resources()->set_limit(limit); request.mutable_lookup_resources()->set_retrieve_instances_ids(instancesId != NULL); - request.mutable_lookup_resources()->mutable_lookup()->Reserve(lookup.size()); + request.mutable_lookup_resources()->mutable_lookup()->Reserve(lookup.GetSize()); - for (size_t i = 0; i < lookup.size(); i++) + for (size_t i = 0; i < lookup.GetSize(); i++) { - DatabasePluginMessages::DatabaseConstraint* constraint = request.mutable_lookup_resources()->add_lookup(); - constraint->set_level(Convert(lookup[i].GetLevel())); - constraint->set_tag_group(lookup[i].GetTag().GetGroup()); - constraint->set_tag_element(lookup[i].GetTag().GetElement()); - constraint->set_is_identifier_tag(lookup[i].IsIdentifier()); - constraint->set_is_case_sensitive(lookup[i].IsCaseSensitive()); - constraint->set_is_mandatory(lookup[i].IsMandatory()); + const DatabaseConstraint& source = lookup.GetConstraint(i); - constraint->mutable_values()->Reserve(lookup[i].GetValuesCount()); - for (size_t j = 0; j < lookup[i].GetValuesCount(); j++) + DatabasePluginMessages::DatabaseConstraint* target = request.mutable_lookup_resources()->add_lookup(); + target->set_level(Convert(source.GetLevel())); + target->set_tag_group(source.GetTag().GetGroup()); + target->set_tag_element(source.GetTag().GetElement()); + target->set_is_identifier_tag(source.IsIdentifier()); + target->set_is_case_sensitive(source.IsCaseSensitive()); + target->set_is_mandatory(source.IsMandatory()); + + target->mutable_values()->Reserve(source.GetValuesCount()); + for (size_t j = 0; j < source.GetValuesCount(); j++) { - constraint->add_values(lookup[i].GetValue(j)); + target->add_values(source.GetValue(j)); } - switch (lookup[i].GetConstraintType()) + switch (source.GetConstraintType()) { case ConstraintType_Equal: - constraint->set_type(DatabasePluginMessages::CONSTRAINT_EQUAL); + target->set_type(DatabasePluginMessages::CONSTRAINT_EQUAL); break; case ConstraintType_SmallerOrEqual: - constraint->set_type(DatabasePluginMessages::CONSTRAINT_SMALLER_OR_EQUAL); + target->set_type(DatabasePluginMessages::CONSTRAINT_SMALLER_OR_EQUAL); break; case ConstraintType_GreaterOrEqual: - constraint->set_type(DatabasePluginMessages::CONSTRAINT_GREATER_OR_EQUAL); + target->set_type(DatabasePluginMessages::CONSTRAINT_GREATER_OR_EQUAL); break; case ConstraintType_Wildcard: - constraint->set_type(DatabasePluginMessages::CONSTRAINT_WILDCARD); + target->set_type(DatabasePluginMessages::CONSTRAINT_WILDCARD); break; case ConstraintType_List: - constraint->set_type(DatabasePluginMessages::CONSTRAINT_LIST); + target->set_type(DatabasePluginMessages::CONSTRAINT_LIST); break; default:
--- a/OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp Tue Jul 09 08:56:50 2024 +0200 +++ b/OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp Tue Jul 09 10:09:57 2024 +0200 @@ -153,7 +153,7 @@ static void ApplyLevel(SetOfResources& candidates, IDatabaseWrapper::ITransaction& transaction, ILookupResources& compatibility, - const std::vector<DatabaseConstraint>& lookup, + const DatabaseConstraints& lookup, ResourceType level) { typedef std::set<const DatabaseConstraint*> SetOfConstraints; @@ -166,17 +166,19 @@ Identifiers identifiers; SetOfConstraints mainTags; - for (size_t i = 0; i < lookup.size(); i++) + for (size_t i = 0; i < lookup.GetSize(); i++) { - if (lookup[i].GetLevel() == level) + const DatabaseConstraint& constraint = lookup.GetConstraint(i); + + if (constraint.GetLevel() == level) { - if (lookup[i].IsIdentifier()) + if (constraint.IsIdentifier()) { - identifiers[lookup[i].GetTag()].insert(&lookup[i]); + identifiers[constraint.GetTag()].insert(&constraint); } else { - mainTags.insert(&lookup[i]); + mainTags.insert(&constraint); } } } @@ -306,7 +308,7 @@ void DatabaseLookup::ApplyLookupResources(std::list<std::string>& resourcesId, std::list<std::string>* instancesId, - const std::vector<DatabaseConstraint>& lookup, + const DatabaseConstraints& lookup, ResourceType queryLevel, size_t limit) { @@ -320,9 +322,9 @@ ResourceType upperLevel = queryLevel; ResourceType lowerLevel = queryLevel; - for (size_t i = 0; i < lookup.size(); i++) + for (size_t i = 0; i < lookup.GetSize(); i++) { - ResourceType level = lookup[i].GetLevel(); + ResourceType level = lookup.GetConstraint(i).GetLevel(); if (level < upperLevel) {
--- a/OrthancServer/Sources/Database/Compatibility/DatabaseLookup.h Tue Jul 09 08:56:50 2024 +0200 +++ b/OrthancServer/Sources/Database/Compatibility/DatabaseLookup.h Tue Jul 09 10:09:57 2024 +0200 @@ -46,7 +46,7 @@ void ApplyLookupResources(std::list<std::string>& resourcesId, std::list<std::string>* instancesId, - const std::vector<DatabaseConstraint>& lookup, + const DatabaseConstraints& lookup, ResourceType queryLevel, size_t limit); };
--- a/OrthancServer/Sources/Database/Compatibility/ILookupResources.cpp Tue Jul 09 08:56:50 2024 +0200 +++ b/OrthancServer/Sources/Database/Compatibility/ILookupResources.cpp Tue Jul 09 10:09:57 2024 +0200 @@ -35,7 +35,7 @@ ILookupResources& compatibility, std::list<std::string>& resourcesId, std::list<std::string>* instancesId, - const std::vector<DatabaseConstraint>& lookup, + const DatabaseConstraints& lookup, ResourceType queryLevel, size_t limit) {
--- a/OrthancServer/Sources/Database/Compatibility/ILookupResources.h Tue Jul 09 08:56:50 2024 +0200 +++ b/OrthancServer/Sources/Database/Compatibility/ILookupResources.h Tue Jul 09 10:09:57 2024 +0200 @@ -60,7 +60,7 @@ ILookupResources& compatibility, std::list<std::string>& resourcesId, std::list<std::string>* instancesId, - const std::vector<DatabaseConstraint>& lookup, + const DatabaseConstraints& lookup, ResourceType queryLevel, size_t limit); };
--- a/OrthancServer/Sources/Database/IDatabaseWrapper.h Tue Jul 09 08:56:50 2024 +0200 +++ b/OrthancServer/Sources/Database/IDatabaseWrapper.h Tue Jul 09 10:09:57 2024 +0200 @@ -37,7 +37,7 @@ namespace Orthanc { - class DatabaseConstraint; + class DatabaseConstraints; class ResourcesContent; class IDatabaseWrapper : public boost::noncopyable @@ -282,7 +282,7 @@ virtual void ApplyLookupResources(std::list<std::string>& resourcesId, std::list<std::string>* instancesId, // Can be NULL if not needed - const std::vector<DatabaseConstraint>& lookup, + const DatabaseConstraints& lookup, ResourceType queryLevel, const std::set<std::string>& labels, LabelsConstraint labelsConstraint,
--- a/OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp Tue Jul 09 08:56:50 2024 +0200 +++ b/OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp Tue Jul 09 10:09:57 2024 +0200 @@ -340,7 +340,7 @@ virtual void ApplyLookupResources(std::list<std::string>& resourcesId, std::list<std::string>* instancesId, - const std::vector<DatabaseConstraint>& lookup, + const DatabaseConstraints& lookup, ResourceType queryLevel, const std::set<std::string>& labels, LabelsConstraint labelsConstraint,
--- a/OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp Tue Jul 09 08:56:50 2024 +0200 +++ b/OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp Tue Jul 09 10:09:57 2024 +0200 @@ -405,12 +405,11 @@ LoadTags(ResourceType_Instance); } - void NormalizeLookup(std::vector<DatabaseConstraint>& target, + void NormalizeLookup(DatabaseConstraints& target, const DatabaseLookup& source, ResourceType queryLevel) const { - target.clear(); - target.reserve(source.GetConstraintsCount()); + target.Clear(); for (size_t i = 0; i < source.GetConstraintsCount(); i++) { @@ -429,7 +428,7 @@ level = ResourceType_Study; } - target.push_back(source.GetConstraint(i).ConvertToDatabaseConstraint(level, type)); + target.AddConstraint(source.GetConstraint(i).ConvertToDatabaseConstraint(level, type)); } } } @@ -1687,20 +1686,20 @@ DicomTagConstraint c(tag, ConstraintType_Equal, value, true, true); - std::vector<DatabaseConstraint> query; - query.push_back(c.ConvertToDatabaseConstraint(level, DicomTagType_Identifier)); + DatabaseConstraints query; + query.AddConstraint(c.ConvertToDatabaseConstraint(level, DicomTagType_Identifier)); class Operations : public IReadOnlyOperations { private: - std::vector<std::string>& result_; - const std::vector<DatabaseConstraint>& query_; - ResourceType level_; + std::vector<std::string>& result_; + const DatabaseConstraints& query_; + ResourceType level_; public: Operations(std::vector<std::string>& result, - const std::vector<DatabaseConstraint>& query, + const DatabaseConstraints& query, ResourceType level) : result_(result), query_(query), @@ -1986,7 +1985,7 @@ LabelsConstraint labelsConstraint, uint32_t limit) { - class Operations : public ReadOnlyOperationsT6<bool, const std::vector<DatabaseConstraint>&, ResourceType, + class Operations : public ReadOnlyOperationsT6<bool, const DatabaseConstraints&, ResourceType, const std::set<std::string>&, LabelsConstraint, size_t> { private: @@ -2032,7 +2031,7 @@ ServerToolbox::CheckValidLabel(*it); } - std::vector<DatabaseConstraint> normalized; + DatabaseConstraints normalized; assert(mainDicomTagsRegistry_.get() != NULL); mainDicomTagsRegistry_->NormalizeLookup(normalized, lookup, queryLevel);
--- a/OrthancServer/Sources/Database/StatelessDatabaseOperations.h Tue Jul 09 08:56:50 2024 +0200 +++ b/OrthancServer/Sources/Database/StatelessDatabaseOperations.h Tue Jul 09 10:09:57 2024 +0200 @@ -209,7 +209,7 @@ void ApplyLookupResources(std::list<std::string>& resourcesId, std::list<std::string>* instancesId, // Can be NULL if not needed - const std::vector<DatabaseConstraint>& lookup, + const DatabaseConstraints& lookup, ResourceType queryLevel, const std::set<std::string>& labels, // New in Orthanc 1.12.0 LabelsConstraint labelsConstraint, // New in Orthanc 1.12.0
--- a/OrthancServer/Sources/Search/DatabaseConstraint.cpp Tue Jul 09 08:56:50 2024 +0200 +++ b/OrthancServer/Sources/Search/DatabaseConstraint.cpp Tue Jul 09 10:09:57 2024 +0200 @@ -245,4 +245,43 @@ constraint.values = (tmpValues.empty() ? NULL : &tmpValues[0]); } #endif + + + void DatabaseConstraints::Clear() + { + for (size_t i = 0; i < constraints_.size(); i++) + { + assert(constraints_[i] != NULL); + delete constraints_[i]; + } + + constraints_.clear(); + } + + + void DatabaseConstraints::AddConstraint(DatabaseConstraint* constraint) + { + if (constraint == NULL) + { + throw OrthancException(ErrorCode_NullPointer); + } + else + { + constraints_.push_back(constraint); + } + } + + + const DatabaseConstraint& DatabaseConstraints::GetConstraint(size_t index) const + { + if (index >= constraints_.size()) + { + throw OrthancException(ErrorCode_ParameterOutOfRange); + } + else + { + assert(constraints_[index] != NULL); + return *constraints_[index]; + } + } }
--- a/OrthancServer/Sources/Search/DatabaseConstraint.h Tue Jul 09 08:56:50 2024 +0200 +++ b/OrthancServer/Sources/Search/DatabaseConstraint.h Tue Jul 09 10:09:57 2024 +0200 @@ -46,6 +46,8 @@ # endif #endif +#include <deque> + namespace Orthanc { enum ConstraintType @@ -78,7 +80,7 @@ // This class is also used by the "orthanc-databases" project - class DatabaseConstraint + class DatabaseConstraint : public boost::noncopyable { private: ResourceType level_; @@ -148,4 +150,33 @@ std::vector<const char*>& tmpValues) const; #endif }; + + + class DatabaseConstraints : public boost::noncopyable + { + private: + std::deque<DatabaseConstraint*> constraints_; + + public: + ~DatabaseConstraints() + { + Clear(); + } + + void Clear(); + + void AddConstraint(DatabaseConstraint* constraint); // Takes ownership + + bool IsEmpty() const + { + return constraints_.empty(); + } + + size_t GetSize() const + { + return constraints_.size(); + } + + const DatabaseConstraint& GetConstraint(size_t index) const; + }; }
--- a/OrthancServer/Sources/Search/DicomTagConstraint.cpp Tue Jul 09 08:56:50 2024 +0200 +++ b/OrthancServer/Sources/Search/DicomTagConstraint.cpp Tue Jul 09 10:09:57 2024 +0200 @@ -342,8 +342,8 @@ } - DatabaseConstraint DicomTagConstraint::ConvertToDatabaseConstraint(ResourceType level, - DicomTagType tagType) const + DatabaseConstraint* DicomTagConstraint::ConvertToDatabaseConstraint(ResourceType level, + DicomTagType tagType) const { bool isIdentifier, caseSensitive; @@ -379,7 +379,7 @@ } } - return DatabaseConstraint(level, tag_, isIdentifier, constraintType_, - values, caseSensitive, mandatory_); + return new DatabaseConstraint(level, tag_, isIdentifier, constraintType_, + values, caseSensitive, mandatory_); } }
--- a/OrthancServer/Sources/Search/DicomTagConstraint.h Tue Jul 09 08:56:50 2024 +0200 +++ b/OrthancServer/Sources/Search/DicomTagConstraint.h Tue Jul 09 10:09:57 2024 +0200 @@ -109,7 +109,7 @@ std::string Format() const; - DatabaseConstraint ConvertToDatabaseConstraint(ResourceType level, - DicomTagType tagType) const; + DatabaseConstraint* ConvertToDatabaseConstraint(ResourceType level, + DicomTagType tagType) const; }; }
--- a/OrthancServer/Sources/Search/ISqlLookupFormatter.cpp Tue Jul 09 08:56:50 2024 +0200 +++ b/OrthancServer/Sources/Search/ISqlLookupFormatter.cpp Tue Jul 09 10:09:57 2024 +0200 @@ -475,7 +475,10 @@ } - void ISqlLookupFormatter::GetLookupLevels(ResourceType& lowerLevel, ResourceType& upperLevel, const ResourceType& queryLevel, const std::vector<DatabaseConstraint>& lookup) + void ISqlLookupFormatter::GetLookupLevels(ResourceType& lowerLevel, + ResourceType& upperLevel, + const ResourceType& queryLevel, + const DatabaseConstraints& lookup) { assert(ResourceType_Patient < ResourceType_Study && ResourceType_Study < ResourceType_Series && @@ -484,9 +487,9 @@ lowerLevel = queryLevel; upperLevel = queryLevel; - for (size_t i = 0; i < lookup.size(); i++) + for (size_t i = 0; i < lookup.GetSize(); i++) { - ResourceType level = lookup[i].GetLevel(); + ResourceType level = lookup.GetConstraint(i).GetLevel(); if (level < upperLevel) { @@ -503,7 +506,7 @@ void ISqlLookupFormatter::Apply(std::string& sql, ISqlLookupFormatter& formatter, - const std::vector<DatabaseConstraint>& lookup, + const DatabaseConstraints& lookup, ResourceType queryLevel, const std::set<std::string>& labels, LabelsConstraint labelsConstraint, @@ -521,14 +524,16 @@ size_t count = 0; - for (size_t i = 0; i < lookup.size(); i++) + for (size_t i = 0; i < lookup.GetSize(); i++) { + const DatabaseConstraint& constraint = lookup.GetConstraint(i); + std::string comparison; - if (FormatComparison(comparison, formatter, lookup[i], count, escapeBrackets)) + if (FormatComparison(comparison, formatter, constraint, count, escapeBrackets)) { std::string join; - FormatJoin(join, lookup[i], count); + FormatJoin(join, constraint, count); joins += join; if (!comparison.empty()) @@ -614,7 +619,7 @@ void ISqlLookupFormatter::ApplySingleLevel(std::string& sql, ISqlLookupFormatter& formatter, - const std::vector<DatabaseConstraint>& lookup, + const DatabaseConstraints& lookup, ResourceType queryLevel, const std::set<std::string>& labels, LabelsConstraint labelsConstraint, @@ -631,15 +636,17 @@ std::vector<std::string> mainDicomTagsComparisons, dicomIdentifiersComparisons; - for (size_t i = 0; i < lookup.size(); i++) + for (size_t i = 0; i < lookup.GetSize(); i++) { + const DatabaseConstraint& constraint = lookup.GetConstraint(i); + std::string comparison; - if (FormatComparison2(comparison, formatter, lookup[i], escapeBrackets)) + if (FormatComparison2(comparison, formatter, constraint, escapeBrackets)) { if (!comparison.empty()) { - if (lookup[i].IsIdentifier()) + if (constraint.IsIdentifier()) { dicomIdentifiersComparisons.push_back(comparison); }
--- a/OrthancServer/Sources/Search/ISqlLookupFormatter.h Tue Jul 09 08:56:50 2024 +0200 +++ b/OrthancServer/Sources/Search/ISqlLookupFormatter.h Tue Jul 09 10:09:57 2024 +0200 @@ -34,7 +34,7 @@ namespace Orthanc { - class DatabaseConstraint; + class DatabaseConstraints; enum LabelsConstraint { @@ -64,11 +64,14 @@ **/ virtual bool IsEscapeBrackets() const = 0; - static void GetLookupLevels(ResourceType& lowerLevel, ResourceType& upperLevel, const ResourceType& queryLevel, const std::vector<DatabaseConstraint>& lookup); + static void GetLookupLevels(ResourceType& lowerLevel, + ResourceType& upperLevel, + const ResourceType& queryLevel, + const DatabaseConstraints& lookup); static void Apply(std::string& sql, ISqlLookupFormatter& formatter, - const std::vector<DatabaseConstraint>& lookup, + const DatabaseConstraints& lookup, ResourceType queryLevel, const std::set<std::string>& labels, // New in Orthanc 1.12.0 LabelsConstraint labelsConstraint, // New in Orthanc 1.12.0 @@ -76,7 +79,7 @@ static void ApplySingleLevel(std::string& sql, ISqlLookupFormatter& formatter, - const std::vector<DatabaseConstraint>& lookup, + const DatabaseConstraints& lookup, ResourceType queryLevel, const std::set<std::string>& labels, // New in Orthanc 1.12.0 LabelsConstraint labelsConstraint, // New in Orthanc 1.12.0
--- a/OrthancServer/UnitTestsSources/ServerIndexTests.cpp Tue Jul 09 08:56:50 2024 +0200 +++ b/OrthancServer/UnitTestsSources/ServerIndexTests.cpp Tue Jul 09 10:09:57 2024 +0200 @@ -166,8 +166,8 @@ DicomTagConstraint c(tag, type, value, true, true); - std::vector<DatabaseConstraint> lookup; - lookup.push_back(c.ConvertToDatabaseConstraint(level, DicomTagType_Identifier)); + DatabaseConstraints lookup; + lookup.AddConstraint(c.ConvertToDatabaseConstraint(level, DicomTagType_Identifier)); std::set<std::string> noLabel; transaction_->ApplyLookupResources(result, NULL, lookup, level, noLabel, LabelsConstraint_All, 0 /* no limit */); @@ -185,10 +185,10 @@ DicomTagConstraint c1(tag, type1, value1, true, true); DicomTagConstraint c2(tag, type2, value2, true, true); - - std::vector<DatabaseConstraint> lookup; - lookup.push_back(c1.ConvertToDatabaseConstraint(level, DicomTagType_Identifier)); - lookup.push_back(c2.ConvertToDatabaseConstraint(level, DicomTagType_Identifier)); + + DatabaseConstraints lookup; + lookup.AddConstraint(c1.ConvertToDatabaseConstraint(level, DicomTagType_Identifier)); + lookup.AddConstraint(c2.ConvertToDatabaseConstraint(level, DicomTagType_Identifier)); std::set<std::string> noLabel; transaction_->ApplyLookupResources(result, NULL, lookup, level, noLabel, LabelsConstraint_All, 0 /* no limit */);