public DateRangeParam getLastUpdated() { if (myLastUpdatedLow == null && myLastUpdatedHigh == null) { return null; } else { return new DateRangeParam(myLastUpdatedLow, myLastUpdatedHigh); } }
@Override public boolean matches(IQueryParameterType theParam) { if (!(theParam instanceof DateParam)) { return false; } DateParam date = (DateParam) theParam; DateRangeParam range = new DateRangeParam(date); Date lowerBound = range.getLowerBoundAsInstant(); Date upperBound = range.getUpperBoundAsInstant(); if (lowerBound == null && upperBound == null) { // should never happen return false; } boolean result = true; if (lowerBound != null) { result &= (myValueLow.after(lowerBound) || myValueLow.equals(lowerBound)); result &= (myValueHigh.after(lowerBound) || myValueHigh.equals(lowerBound)); } if (upperBound != null) { result &= (myValueLow.before(upperBound) || myValueLow.equals(upperBound)); result &= (myValueHigh.before(upperBound) || myValueHigh.equals(upperBound)); } return result; }
private Predicate createPredicateDate(IQueryParameterType theParam, String theResourceName, String theParamName, CriteriaBuilder theBuilder, From<?, ResourceIndexedSearchParamDate> theFrom) { Predicate p; if (theParam instanceof DateParam) { DateParam date = (DateParam) theParam; if (!date.isEmpty()) { DateRangeParam range = new DateRangeParam(date); p = createPredicateDateFromRange(theBuilder, theFrom, range); } else { // TODO: handle missing date param? p = null; } } else if (theParam instanceof DateRangeParam) { DateRangeParam range = (DateRangeParam) theParam; p = createPredicateDateFromRange(theBuilder, theFrom, range); } else { throw new IllegalArgumentException("Invalid token type: " + theParam.getClass()); } return combineParamIndexPredicateWithParamNamePredicate(theResourceName, theParamName, theFrom, p); }
parameters.add(QualifiedParamList.singleton(paramValues[1])); DateRangeParam dateRangeParam = new DateRangeParam(); FhirContext ctx = theRequest.getServer().getFhirContext(); dateRangeParam.setValuesAsQueryTokens(ctx, myName, parameters);
protected DateRangeParam processSinceOrAt(Date theSince, DateRangeParam theAt) { boolean haveAt = theAt != null && (theAt.getLowerBoundAsInstant() != null || theAt.getUpperBoundAsInstant() != null); if (haveAt && theSince != null) { String msg = getContext().getLocalizer().getMessage(BaseJpaProvider.class, "cantCombintAtAndSince"); throw new InvalidRequestException(msg); } if (haveAt) { return theAt; } return new DateRangeParam(theSince, null); }
throw new InvalidRequestException("Failed to parse match URL[" + theMatchUrl + "] - Can not have more than 2 " + Constants.PARAM_LASTUPDATED + " parameter repetitions"); } else { DateRangeParam p1 = new DateRangeParam(); p1.setValuesAsQueryTokens(myContext, nextParamName, paramList); paramMap.setLastUpdated(p1);
public DateRangeParam getLastUpdated() { if (myLastUpdatedLow == null && myLastUpdatedHigh == null) { return null; } else { return new DateRangeParam(myLastUpdatedLow, myLastUpdatedHigh); } }
private Predicate createPredicateDate(IQueryParameterType theParam, String theResourceName, String theParamName, CriteriaBuilder theBuilder, From<?, ResourceIndexedSearchParamDate> theFrom) { Predicate p; if (theParam instanceof DateParam) { DateParam date = (DateParam) theParam; if (!date.isEmpty()) { DateRangeParam range = new DateRangeParam(date); p = createPredicateDateFromRange(theBuilder, theFrom, range); } else { // TODO: handle missing date param? p = null; } } else if (theParam instanceof DateRangeParam) { DateRangeParam range = (DateRangeParam) theParam; p = createPredicateDateFromRange(theBuilder, theFrom, range); } else { throw new IllegalArgumentException("Invalid token type: " + theParam.getClass()); } return combineParamIndexPredicateWithParamNamePredicate(theResourceName, theParamName, theFrom, p); }
parameters.add(QualifiedParamList.singleton(paramValues[1])); DateRangeParam dateRangeParam = new DateRangeParam(); FhirContext ctx = theRequest.getServer().getFhirContext(); dateRangeParam.setValuesAsQueryTokens(ctx, myName, parameters);
protected DateRangeParam processSinceOrAt(Date theSince, DateRangeParam theAt) { boolean haveAt = theAt != null && (theAt.getLowerBoundAsInstant() != null || theAt.getUpperBoundAsInstant() != null); if (haveAt && theSince != null) { String msg = getContext().getLocalizer().getMessage(BaseJpaProvider.class, "cantCombintAtAndSince"); throw new InvalidRequestException(msg); } if (haveAt) { return theAt; } return new DateRangeParam(theSince, null); }
.include(Patient.INCLUDE_CAREPROVIDER.asNonRecursive()) .revInclude(Provenance.INCLUDE_TARGET) .lastUpdated(new DateRangeParam("2011-01-01", null)) .sort().ascending(Patient.BIRTHDATE) .sort().descending(Patient.NAME).limitTo(123)