Date search
Search by date in Aidbox
Last updated
Was this helpful?
Search by date in Aidbox
Last updated
Was this helpful?
As mentioned in , Date parameters may be used with the date
, dateTime
, instant
, Period
, or Timing
data types. Every date in search matches yyyy-mm-ddThh:mm:ss[Z|(+|-)hh:mm]
format.
for date search supported:
eq
- equal (default)
ne
- non-equal
lt
- less than
le
- less or equal
gt
- greater than
ge
- greater or equal
sa
- starts after
eb
- ends before
By default, search by date in Aidbox does not confirm to FHIR spec due historical reasons. We highly recommend to use FHIR compliant date search. Turn it on with:
All date comparisons in FHIR are range-based. Range consists of lower bound and upper bound.
FHIR dateTIme value can be incomplete datetime. E.g. 2020
is a FHIR dateTime but it is an incomplete datetime, since it doesn't specify month, day, etc.
Lower bound of the FHIR dateTime is the earliest complete datetime, which matches the FHIR dateTime value. For 2020
the lower bound is 2020-01-01T00:00:00Z
.
Vice versa the upper bound of the FHIR dateTime is the latest complete datetime.
For FHIR Period lower bound is the lower bound of the Period.start, similarly for the upper bound. Missing start or end in Period is treated as infinity.
Searching by date is done by comparing search range and resource (target) range.
Search range is the range of the search value.
For example, searching GET /fhir/Patient?birthdate=2020
means that the search range is 2020-01-01T00:00:00Z
—2020-12-31T23:59:59Z
.
Resource range is the range of the target resource value.
For example, if Patient resource contains birthDate 2020-01-01
, the resource range is 2020-01-01T00:00:00Z
—2020-01-01T23:59:59Z
.
Description of Aidbox search operators.
Description of FHIR search operators
Let be the search range; be the resource range.
eq
- equal (default). Formula:
ne
- not equal. Formula:
lt
- less than. Formula:
le
- less than or equal. Formula:
gt
- greater than. Formula:
ge
- greater than or equal. Formula:
Let be the search range; be the resource range.
eq
- equal. Formula:
ne
- not equal. Formula:
lt
- less than. Formula:
le
- less than or equal. Formula:
gt
- greater than. Formula:
ge
- greater than or equal. Formula:
sa
- starts after. Formula:
eb
- ends before. Formula: