comparison OrthancServer/Search/RangeConstraint.cpp @ 1887:5e0a25642056

Fix range search if the lower or upper limit is absent
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 11 Dec 2015 15:59:05 +0100
parents 03b030680e3d
children b1291df2f780
comparison
equal deleted inserted replaced
1885:5be57564ffc4 1887:5e0a25642056
53 53
54 54
55 void RangeConstraint::Setup(LookupIdentifierQuery& lookup, 55 void RangeConstraint::Setup(LookupIdentifierQuery& lookup,
56 const DicomTag& tag) const 56 const DicomTag& tag) const
57 { 57 {
58 lookup.AddConstraint(tag, IdentifierConstraintType_GreaterOrEqual, lower_); 58 if (!lower_.empty())
59 lookup.AddConstraint(tag, IdentifierConstraintType_SmallerOrEqual, upper_); 59 {
60 lookup.AddConstraint(tag, IdentifierConstraintType_GreaterOrEqual, lower_);
61 }
62
63 if (!upper_.empty())
64 {
65 lookup.AddConstraint(tag, IdentifierConstraintType_SmallerOrEqual, upper_);
66 }
60 } 67 }
61 68
62 69
63 bool RangeConstraint::Match(const std::string& value) const 70 bool RangeConstraint::Match(const std::string& value) const
64 { 71 {