diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/DateRangeParam.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/DateRangeParam.java index 88c32914170..aa20383f423 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/DateRangeParam.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/DateRangeParam.java @@ -215,6 +215,15 @@ public class DateRangeParam implements IQueryParameterAnd { * 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"). + *

*/ public DateRangeParam setLowerBound(String theLowerBound) { setLowerBound(new DateParam(GREATERTHAN_OR_EQUALS, theLowerBound)); @@ -298,6 +307,15 @@ public class DateRangeParam implements IQueryParameterAnd { * 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"). + *

*/ public DateRangeParam setUpperBound(String theUpperBound) { setUpperBound(new DateParam(LESSTHAN_OR_EQUALS, theUpperBound)); @@ -618,6 +636,15 @@ public class DateRangeParam implements IQueryParameterAnd { return b.toString(); } + /** + * 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"). + */ private void validateAndSet(DateParam lowerBound, DateParam upperBound) { if (hasBound(lowerBound) && hasBound(upperBound)) { if (lowerBound.getValue().getTime() > upperBound.getValue().getTime()) { diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/4_2_0/changes.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/4_2_0/changes.yaml index e0c2bfd651c..751ab54a333 100644 --- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/4_2_0/changes.yaml +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/4_2_0/changes.yaml @@ -41,18 +41,27 @@ type: "fix" title: "A missing mandatory was added to the SNOMED CT CodeSystem that is uploaded when SCT is uploaded to the JPA server. Thanks to Anders Havn for the pull request!" - item: - issue: 1643 - type: fix + issue: "1643" + type: "fix" title: "When validating resources containing custom valuesets defined in PrePopulatedValidationSupport outside of the JPA server, sometimes code systems could not be found resulting in false negative errors." - item: - issue: 1588 - type: add + issue: "1588" + type: "add" title: "Support for several new operators has been added to the `_filter` support in the JPA server. Thanks to Anthony Sute for the Pull Request!" - item: - issue: 1650 - type: fix - title: Several misleading comments in documentation code snippets were fixed. Thanks to - Jafer Khan for the pull request! + issue: "1650" + type: "fix" + title: "Several misleading comments in documentation code snippets were fixed. Thanks to + Jafer Khan for the pull request!" +- item: + issue: "1645" + type: "add" + title: "The following utility methods have been added: +
    +
  • DateRangeParam#isDateWithinRange(Date theDate)
  • +
  • DateRangeParam#isDateWithinLowerBound(Date theDate)
  • +
  • DateRangeParam#isDateWithinUpperBound(Date theDate)
  • +
" diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 1a2eb9963f7..498233d327a 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -77,16 +77,6 @@ An issue with the HAPI FHIR CLI was corrected that prevented the upload of LOINC due to an error regarding the properties file. - - The following utility methods have been added: - -
  • DateRangeParam#isDateWithinRange(Date theDate)
  • -
  • DateRangeParam#isDateWithinLowerBound(Date theDate)
  • -
  • DateRangeParam#isDateWithinUpperBound(Date theDate)
  • - - ]]> -