_filter
Aidbox offers the partial support of FHIR _filter API. However, we tend to use other search capabilities like AidboxQuery, SearchQuery, or Search resource for complex queries. They offer better expressiveness with SQL and better performance.
Operation | String | Number | Date | Token | Reference | Quantity |
---|---|---|---|---|---|---|
eq | + | +** | + | +* | n/a | +*** |
ne | - | +** | + | - | n/a | +*** |
co | + | - | - | n/a | n/a | n/a |
sw | + | n/a | n/a | n/a | n/a | n/a |
ew | + | n/a | n/a | n/a | n/a | n/a |
gt/ge/lt/le | - | + | + | n/a | n/a | +*** |
po | n/a | n/a | - | n/a | n/a | n/a |
ss | n/a | n/a | n/a | - | n/a | n/a |
sb | n/a | n/a | n/a | - | n/a | n/a |
in | n/a | n/a | n/a | - | n/a | n/a |
re | n/a | n/a | n/a | n/a | - | n/a |
* token search is case sensitive
** number search doesn't support implicit precision
*** support only numbers, not system with code
Aidbox supports forward chained search parameters in _filter query and dot expressions.
# returns patient with specific id
GET /fhir/Patient?_filter=id eq 'pt-2'
# returns patients with name that contain specific substring e.g. Smith
GET /fhir/Patient?_filter=name co 'smi'
# returns patients with address.city starting with provided string, e.g. London
GET /fhir/Patient?_filter=address-city sw 'Lon'
# returns all patients with birthdate >= (<=) provided date
GET /fhir/Patient?_filter=birthdate ge 1996-06-06
GET /fhir/Patient?_filter=birthdate le 1996-06-06
You can compose logical expressions using parentheses
GET /fhir/Patient?_filter=(name co 'smi' or name co 'fed') or name co 'unex'
Aidbox requires to specify chain targets explicitly:
GET /fhir/Patient?_filter=(organization:Organization.name eq 'myorg')
GET /fhir/Patient?filter=.name.0.family eq 'Doe'
GET /fhir/Patient?filter=.name isnull true
Last modified 20d ago