mirror of
https://github.com/hapifhir/hapi-fhir.git
synced 2025-02-17 02:15:22 +00:00
Merge pull request #819 from splatch/issue-815
Support for negation in search operations
This commit is contained in:
commit
4f519e0528
@ -1219,7 +1219,11 @@ public class SearchBuilder implements ISearchBuilder {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(system)) {
|
if (StringUtils.isNotBlank(system)) {
|
||||||
singleCodePredicates.add(theBuilder.equal(theFrom.get("mySystem"), system));
|
if (modifier != null && modifier == TokenParamModifier.NOT) {
|
||||||
|
singleCodePredicates.add(theBuilder.notEqual(theFrom.get("mySystem"), system));
|
||||||
|
} else {
|
||||||
|
singleCodePredicates.add(theBuilder.equal(theFrom.get("mySystem"), system));
|
||||||
|
}
|
||||||
} else if (system == null) {
|
} else if (system == null) {
|
||||||
// don't check the system
|
// don't check the system
|
||||||
} else {
|
} else {
|
||||||
@ -1228,7 +1232,11 @@ public class SearchBuilder implements ISearchBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(code)) {
|
if (StringUtils.isNotBlank(code)) {
|
||||||
singleCodePredicates.add(theBuilder.equal(theFrom.get("myValue"), code));
|
if (modifier != null && modifier == TokenParamModifier.NOT) {
|
||||||
|
singleCodePredicates.add(theBuilder.notEqual(theFrom.get("myValue"), code));
|
||||||
|
} else {
|
||||||
|
singleCodePredicates.add(theBuilder.equal(theFrom.get("myValue"), code));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* As of HAPI FHIR 1.5, if the client searched for a token with a system but no specified value this means to
|
* As of HAPI FHIR 1.5, if the client searched for a token with a system but no specified value this means to
|
||||||
|
Loading…
x
Reference in New Issue
Block a user