Class DateRangeParam

    • Constructor Detail

      • 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

      • 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 ge and le respectively, the resulting prefix is effectively eq where only a single date is provided - as required by the FHIR specificiation (i.e. "If no prefix is present, the prefix eq is assumed").

      • getLowerBoundAsDateInteger

        public Integer getLowerBoundAsDateInteger()
        Return the current lower bound as an integer representative of the date. e.g. 2019-02-22T04:22:00-0500 -> 20120922
      • getUpperBoundAsDateInteger

        public Integer getUpperBoundAsDateInteger()
        Return the current upper bound as an integer representative of the date e.g. 2019-02-22T04:22:00-0500 -> 2019122
      • 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 ge and le respectively, the resulting prefix is effectively eq where only a single date is provided - as required by the FHIR specificiation (i.e. "If no prefix is present, the prefix eq is assumed").

      • 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.