Class DateRangeParam
- java.lang.Object
-
- ca.uhn.fhir.rest.param.DateRangeParam
-
- All Implemented Interfaces:
IQueryParameterAnd<DateParam>,Serializable
public class DateRangeParam extends Object implements IQueryParameterAnd<DateParam>
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DateRangeParam()Basic constructor.DateRangeParam(DateParam theDateParam)Sets the range from a single date param.DateRangeParam(DateParam theLowerBound, DateParam theUpperBound)Constructor which takes two Dates representing the lower and upper bounds of the range (inclusive on both ends)DateRangeParam(String theLowerBound, String theUpperBound)Constructor which takes two strings representing the lower and upper bounds of the range (inclusive on both ends)DateRangeParam(Date theLowerBound, Date theUpperBound)Constructor which takes two Dates representing the lower and upper bounds of the range (inclusive on both ends)DateRangeParam(IPrimitiveType<Date> theLowerBound, IPrimitiveType<Date> theUpperBound)Constructor which takes two Dates representing the lower and upper bounds of the range (inclusive on both ends)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)DateParamgetLowerBound()DategetLowerBoundAsInstant()DateParamgetUpperBound()DategetUpperBoundAsInstant()List<DateParam>getValuesAsQueryTokens()See FHIR specification 2.2.2 Search SearchParameter Types for information on the token formatinthashCode()booleanisEmpty()DateRangeParamsetLowerBound(DateParam theLowerBound)DateRangeParamsetLowerBound(String theLowerBound)Sets the lower bound using a string that is compliant with FHIR dateTime format (ISO-8601).DateRangeParamsetLowerBoundExclusive(Date theLowerBound)Sets the lower bound to be greaterthan to the given dateDateRangeParamsetLowerBoundInclusive(Date theLowerBound)Sets the lower bound to be greaterthan or equal to the given datevoidsetRangeFromDatesInclusive(DateParam theLowerBound, DateParam theUpperBound)Sets the range from a pair of dates, inclusive on both endsvoidsetRangeFromDatesInclusive(String theLowerBound, String theUpperBound)Sets the range from a pair of dates, inclusive on both endsvoidsetRangeFromDatesInclusive(Date theLowerBound, Date theUpperBound)Sets the range from a pair of dates, inclusive on both endsvoidsetRangeFromDatesInclusive(IPrimitiveType<Date> theLowerBound, IPrimitiveType<Date> theUpperBound)Sets the range from a pair of dates, inclusive on both ends.DateRangeParamsetUpperBound(DateParam theUpperBound)DateRangeParamsetUpperBound(String theUpperBound)Sets the upper bound using a string that is compliant with FHIR dateTime format (ISO-8601).DateRangeParamsetUpperBoundExclusive(Date theUpperBound)Sets the upper bound to be greaterthan to the given dateDateRangeParamsetUpperBoundInclusive(Date theUpperBound)Sets the upper bound to be greaterthan or equal to the given datevoidsetValuesAsQueryTokens(FhirContext theContext, String theParamName, List<QualifiedParamList> theParameters)See FHIR specification 2.2.2 Search SearchParameter Types for information on the token formatStringtoString()
-
-
-
Constructor Detail
-
DateRangeParam
public DateRangeParam()
Basic constructor. Values must be supplied by callingsetLowerBound(DateParam)andsetUpperBound(DateParam)
-
DateRangeParam
public DateRangeParam(Date theLowerBound, Date theUpperBound)
Constructor which takes two Dates representing the lower and upper bounds of the range (inclusive on both ends)- Parameters:
theLowerBound- A qualified date param representing the lower date bound (optionally may include time), e.g. "2011-02-22" or "2011-02-22T13:12:00Z". Will be treated inclusively. Either theLowerBound or theUpperBound may both be populated, or one may be null, but it is not valid for both to be null.theUpperBound- A qualified date param representing the upper date bound (optionally may include time), e.g. "2011-02-22" or "2011-02-22T13:12:00Z". Will be treated inclusively. Either theLowerBound or theUpperBound may both be populated, or one may be null, but it is not valid for both to be null.
-
DateRangeParam
public DateRangeParam(DateParam theDateParam)
Sets the range from a single date param. If theDateParam has no qualifier, treats it as the lower and upper bound (e.g. 2011-01-02 would match any time on that day). If theDateParam has a qualifier, treats it as either the lower or upper bound, with no opposite bound.
-
DateRangeParam
public DateRangeParam(DateParam theLowerBound, DateParam theUpperBound)
Constructor which takes two Dates representing the lower and upper bounds of the range (inclusive on both ends)- Parameters:
theLowerBound- A qualified date param representing the lower date bound (optionally may include time), e.g. "2011-02-22" or "2011-02-22T13:12:00Z". Will be treated inclusively. Either theLowerBound or theUpperBound may both be populated, or one may be null, but it is not valid for both to be null.theUpperBound- A qualified date param representing the upper date bound (optionally may include time), e.g. "2011-02-22" or "2011-02-22T13:12:00Z". Will be treated inclusively. Either theLowerBound or theUpperBound may both be populated, or one may be null, but it is not valid for both to be null.
-
DateRangeParam
public DateRangeParam(IPrimitiveType<Date> theLowerBound, IPrimitiveType<Date> theUpperBound)
Constructor which takes two Dates representing the lower and upper bounds of the range (inclusive on both ends)- Parameters:
theLowerBound- A qualified date param representing the lower date bound (optionally may include time), e.g. "2011-02-22" or "2011-02-22T13:12:00Z". Will be treated inclusively. Either theLowerBound or theUpperBound may both be populated, or one may be null, but it is not valid for both to be null.theUpperBound- A qualified date param representing the upper date bound (optionally may include time), e.g. "2011-02-22" or "2011-02-22T13:12:00Z". Will be treated inclusively. Either theLowerBound or theUpperBound may both be populated, or one may be null, but it is not valid for both to be null.
-
DateRangeParam
public DateRangeParam(String theLowerBound, String theUpperBound)
Constructor which takes two strings representing the lower and upper bounds of the range (inclusive on both ends)- Parameters:
theLowerBound- An unqualified date param representing the lower date bound (optionally may include time), e.g. "2011-02-22" or "2011-02-22T13:12:00Z". Either theLowerBound or theUpperBound may both be populated, or one may be null, but it is not valid for both to be null.theUpperBound- An unqualified date param representing the upper date bound (optionally may include time), e.g. "2011-02-22" or "2011-02-22T13:12:00Z". Either theLowerBound or theUpperBound may both be populated, or one may be null, but it is not valid for both to be null.
-
-
Method Detail
-
getLowerBound
public DateParam getLowerBound()
-
setLowerBound
public DateRangeParam setLowerBound(DateParam theLowerBound)
-
setLowerBound
public DateRangeParam setLowerBound(String theLowerBound)
Sets the lower bound using a string that is compliant with FHIR dateTime format (ISO-8601).This lower bound is assumed to have a
ge(greater than or equals) modifier.Note: An operation can take a DateRangeParam. If only a single date is provided, it will still result in a DateRangeParam where the lower and upper bounds are the same value. As such, even though the prefixes for the lower and upper bounds default to
geandlerespectively, the resulting prefix is effectivelyeqwhere only a single date is provided - as required by the FHIR specificiation (i.e. "If no prefix is present, the prefixeqis assumed").
-
setLowerBoundInclusive
public DateRangeParam setLowerBoundInclusive(Date theLowerBound)
Sets the lower bound to be greaterthan or equal to the given date
-
setUpperBoundInclusive
public DateRangeParam setUpperBoundInclusive(Date theUpperBound)
Sets the upper bound to be greaterthan or equal to the given date
-
setLowerBoundExclusive
public DateRangeParam setLowerBoundExclusive(Date theLowerBound)
Sets the lower bound to be greaterthan to the given date
-
setUpperBoundExclusive
public DateRangeParam setUpperBoundExclusive(Date theUpperBound)
Sets the upper bound to be greaterthan to the given date
-
getLowerBoundAsInstant
public Date getLowerBoundAsInstant()
-
getUpperBound
public DateParam getUpperBound()
-
setUpperBound
public DateRangeParam setUpperBound(String theUpperBound)
Sets the upper bound using a string that is compliant with FHIR dateTime format (ISO-8601).This upper bound is assumed to have a
le(less than or equals) modifier.Note: An operation can take a DateRangeParam. If only a single date is provided, it will still result in a DateRangeParam where the lower and upper bounds are the same value. As such, even though the prefixes for the lower and upper bounds default to
geandlerespectively, the resulting prefix is effectivelyeqwhere only a single date is provided - as required by the FHIR specificiation (i.e. "If no prefix is present, the prefixeqis assumed").
-
setUpperBound
public DateRangeParam setUpperBound(DateParam theUpperBound)
-
getUpperBoundAsInstant
public Date getUpperBoundAsInstant()
-
getValuesAsQueryTokens
public List<DateParam> getValuesAsQueryTokens()
Description copied from interface:IQueryParameterAndSee FHIR specification 2.2.2 Search SearchParameter Types for information on the token format
- Specified by:
getValuesAsQueryTokensin interfaceIQueryParameterAnd<DateParam>
-
isEmpty
public boolean isEmpty()
-
setRangeFromDatesInclusive
public void setRangeFromDatesInclusive(Date theLowerBound, Date theUpperBound)
Sets the range from a pair of dates, inclusive on both ends- Parameters:
theLowerBound- A qualified date param representing the lower date bound (optionally may include time), e.g. "2011-02-22" or "2011-02-22T13:12:00Z". Will be treated inclusively. Either theLowerBound or theUpperBound may both be populated, or one may be null, but it is not valid for both to be null.theUpperBound- A qualified date param representing the upper date bound (optionally may include time), e.g. "2011-02-22" or "2011-02-22T13:12:00Z". Will be treated inclusively. Either theLowerBound or theUpperBound may both be populated, or one may be null, but it is not valid for both to be null.
-
setRangeFromDatesInclusive
public void setRangeFromDatesInclusive(DateParam theLowerBound, DateParam theUpperBound)
Sets the range from a pair of dates, inclusive on both ends- Parameters:
theLowerBound- A qualified date param representing the lower date bound (optionally may include time), e.g. "2011-02-22" or "2011-02-22T13:12:00Z". Will be treated inclusively. Either theLowerBound or theUpperBound may both be populated, or one may be null, but it is not valid for both to be null.theUpperBound- A qualified date param representing the upper date bound (optionally may include time), e.g. "2011-02-22" or "2011-02-22T13:12:00Z". Will be treated inclusively. Either theLowerBound or theUpperBound may both be populated, or one may be null, but it is not valid for both to be null.
-
setRangeFromDatesInclusive
public void setRangeFromDatesInclusive(IPrimitiveType<Date> theLowerBound, IPrimitiveType<Date> theUpperBound)
Sets the range from a pair of dates, inclusive on both ends. Note that if theLowerBound is after theUpperBound, thie method will automatically reverse the order of the arguments in order to create an inclusive range.- Parameters:
theLowerBound- A qualified date param representing the lower date bound (optionally may include time), e.g. "2011-02-22" or "2011-02-22T13:12:00Z". Will be treated inclusively. Either theLowerBound or theUpperBound may both be populated, or one may be null, but it is not valid for both to be null.theUpperBound- A qualified date param representing the upper date bound (optionally may include time), e.g. "2011-02-22" or "2011-02-22T13:12:00Z". Will be treated inclusively. Either theLowerBound or theUpperBound may both be populated, or one may be null, but it is not valid for both to be null.
-
setRangeFromDatesInclusive
public void setRangeFromDatesInclusive(String theLowerBound, String theUpperBound)
Sets the range from a pair of dates, inclusive on both ends- Parameters:
theLowerBound- A qualified date param representing the lower date bound (optionally may include time), e.g. "2011-02-22" or "2011-02-22T13:12:00Z". Will be treated inclusively. Either theLowerBound or theUpperBound may both be populated, or one may be null, but it is not valid for both to be null.theUpperBound- A qualified date param representing the upper date bound (optionally may include time), e.g. "2011-02-22" or "2011-02-22T13:12:00Z". Will be treated inclusively. Either theLowerBound or theUpperBound may both be populated, or one may be null, but it is not valid for both to be null.
-
setValuesAsQueryTokens
public void setValuesAsQueryTokens(FhirContext theContext, String theParamName, List<QualifiedParamList> theParameters) throws InvalidRequestException
Description copied from interface:IQueryParameterAndSee FHIR specification 2.2.2 Search SearchParameter Types for information on the token format
- Specified by:
setValuesAsQueryTokensin interfaceIQueryParameterAnd<DateParam>- Parameters:
theContext- TODOtheParamName- TODO- Throws:
InvalidRequestException
-
-