comparison OrthancServer/Search/RangeConstraint.cpp @ 2697:e583478e0c6c jobs

New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 03 Jul 2018 15:59:17 +0200
parents 878b59270859
children 8fd203510d8b 4e43e67f8ecf
comparison
equal deleted inserted replaced
2696:1b736d151ea1 2697:e583478e0c6c
57 57
58 58
59 void RangeConstraint::Setup(LookupIdentifierQuery& lookup, 59 void RangeConstraint::Setup(LookupIdentifierQuery& lookup,
60 const DicomTag& tag) const 60 const DicomTag& tag) const
61 { 61 {
62 if (!lower_.empty()) 62 if (!lower_.empty() &&
63 !upper_.empty())
63 { 64 {
64 lookup.AddConstraint(tag, IdentifierConstraintType_GreaterOrEqual, lower_); 65 lookup.AddRange(tag, lower_, upper_);
65 } 66 }
67 else
68 {
69 if (!lower_.empty())
70 {
71 lookup.AddConstraint(tag, IdentifierConstraintType_GreaterOrEqual, lower_);
72 }
66 73
67 if (!upper_.empty()) 74 if (!upper_.empty())
68 { 75 {
69 lookup.AddConstraint(tag, IdentifierConstraintType_SmallerOrEqual, upper_); 76 lookup.AddConstraint(tag, IdentifierConstraintType_SmallerOrEqual, upper_);
77 }
70 } 78 }
71 } 79 }
72 80
73 81
74 bool RangeConstraint::Match(const std::string& value) const 82 bool RangeConstraint::Match(const std::string& value) const