Search
Search API for FHIR resources
Aidbox provides a Search API for all stored resources. Aidbox Search API is a superset of the FHIR Search API.
There are two versions of API, which differ by the resources format:
search by
/[resourceType]
returns results in Aidbox Formatsearch by
/fhir/[resourceType]
returns data in FHIR Format
All data is stored and searched in Aidbox Format and converted on the fly to FHIR on FHIR endpoints!
A base search request is composed of the list of pairs param = value:
Where param can be one of:
Underscored parameter started with underscore, like
_sort
Name of search parameter
Chained parameter expression
Dotted expression - started with
.
Simple search by patient name:
Special Parameters
_security
FHIR
_has
FHIR
_tag
FHIR
Search Parameters
Search is defined in terms of "search parameters". SearchParameter is a meta-resource, which describes which part of the resource it is and how you can make it searchable.
Search parameter can be one of the following types:
Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported.
Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces.
Search parameter on a coded element or identifier. May be used to search through the text, displayname, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a "|", depending on the modifier used.
Depending on the value type, different modifiers can be applied.
Supported modifiers
missing
all
Tests whether the value in a resource is present (when the supplied parameter value is true
) or absent (when the supplied parameter value is false
)
text
string, token, reference, uri
Tests whether the textual value in a resource matches the supplied parameter value using basic string matching (begins with or is, case-insensitive)
below
uri
Tests whether the value in a resource is or is subsumed by the supplied parameter value (is-a, or hierarchical relationships)
contains
string
Case insensitive, partial match at start or end
ends, ew
string
Case insensitive, partial match at end
exact
string
No partial matches, case sensitive
starts, sw
string
Case insensitive, partial match at start
btw
date
Search between two dates
identifier
reference
Tests whether the Reference.identifier
in a resource (rather than the Reference.reference
) matches the supplied parameter value
not
reference, token, uri
Reverses the code matching: returns all resources that do not have a matching item.
i
token
Case insensitive, exact match of text associated with token or token itself
in
token
Tests whether the value in a resource is a member of the supplied parameter ValueSet
of-type
token (only Identifier)
Tests whether the Identifier
value in a resource matches the supplied parameter value
Search with modifiers examples
:missing
:missing
:text
:text
:exact
:exact
:not
:not
i
i
in
in
Prefixes
For Numbers, Dates, and Quantities, we can use the following conditionals in a search:
eq
- equal (default)ne
- non-equallt
- less thanle
- less or equalgt
- greater thange
- greater or equal
For example, to search for patients, who were born before 1986-04-28:
Last updated