# HG changeset patch # User Sebastien Jodogne # Date 1449845945 -3600 # Node ID 5e0a25642056015133a1d173bd3f1062e7e95766 # Parent 5be57564ffc4b1293712243e07a853de2c8c0f19 Fix range search if the lower or upper limit is absent diff -r 5be57564ffc4 -r 5e0a25642056 NEWS --- a/NEWS Fri Dec 11 15:43:33 2015 +0100 +++ b/NEWS Fri Dec 11 15:59:05 2015 +0100 @@ -3,6 +3,7 @@ * Fix of DICOMDIR generation with DCMTK 3.6.1, support of encodings * New function in plugin SDK: "OrthancPluginSendMultipartItem2()" +* Fix range search if the lower or upper limit is absent Version 0.9.6 (2015/12/08) diff -r 5be57564ffc4 -r 5e0a25642056 OrthancServer/Search/RangeConstraint.cpp --- a/OrthancServer/Search/RangeConstraint.cpp Fri Dec 11 15:43:33 2015 +0100 +++ b/OrthancServer/Search/RangeConstraint.cpp Fri Dec 11 15:59:05 2015 +0100 @@ -55,8 +55,15 @@ void RangeConstraint::Setup(LookupIdentifierQuery& lookup, const DicomTag& tag) const { - lookup.AddConstraint(tag, IdentifierConstraintType_GreaterOrEqual, lower_); - lookup.AddConstraint(tag, IdentifierConstraintType_SmallerOrEqual, upper_); + if (!lower_.empty()) + { + lookup.AddConstraint(tag, IdentifierConstraintType_GreaterOrEqual, lower_); + } + + if (!upper_.empty()) + { + lookup.AddConstraint(tag, IdentifierConstraintType_SmallerOrEqual, upper_); + } }