GET /fhir/Patient?name=Max&_elements=id, birthDAte
GET/Patient?name=Max&_elements=id, birthDAte
Special Parameters
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:
Depending on the value type, different modifiers can be applied.
Supported modifiers
Search with modifiers examples
:missing
GET/fhir/Entity?description:missing=true// For gender:missing=true,// server will return all resources that// don't have a value for the gender parameter.
GET/Entity?description:missing=true// For gender:missing=true,// server will return all resources that// don't have a value for the gender parameter.
:text
// Search for any patient with johndoe@mail.com emailGET/fhir/Patient?email:text=JoHnDoE@mail.com// Search for any patient with gmail or icloud emailGET/fhir/Patient?email:text=GMail.com,ICloud.com// Search for any patient which have "fhir" in any of their contact infoGET/fhir/Patient?telecom:text=fhir
// Search for any patient with johndoe@mail.com emailGET/Patient?email:text=JoHnDoE@mail.com// Search for any patient with gmail or icloud emailGET/Patient?email:text=GMail.com,ICloud.com// Search for any patient which have "fhir" in any of their contact infoGET/Patient?telecom:text=fhir
:exact
GET/fhir/Patient?name:exact=Alex
GET/Patient?name:exact=Alex
:not
//Search for any patient with a gender that does not have the code "male"//Note that for :not, the search does not return any resources that have a genGET/fhir/Patient?gender:not=male
//Search for any patient with a gender that does not have the code "male"//Note that for :not, the search does not return any resources that have a genGET/Patient?gender:not=male
i
// Search for patient with email which is Foo@Bar.BAZGET/fhir/Patient?email:i=foo@bar.baz// Note: this search won't find patient with emails like:// ffoo@bar.baz// foo@bar.bazz
// Search for patient with email which is Foo@Bar.BAZGET/Patient?email:i=foo@bar.baz// Note: this search won't find patient with emails like:// ffoo@bar.baz// foo@bar.bazz
in
//Search for any condition that is in the institutions list of cardiac conditions//Note: you must have Concept with valueset definedGET/fhir/Condition?code:in=/ValueSet/cardiac-conditions
//Search for any condition that is in the institutions list of cardiac conditions//Note: you must have Concept with valueset definedGET/Condition?code:in=/ValueSet/cardiac-conditions
Prefixes
For Numbers, Dates, and Quantities, we can use the following conditionals in a search:
eq - equal (default)
ne - non-equal
lt - less than
le - less or equal
gt - greater than
ge - greater or equal
For example, to search for patients, who were born before 1986-04-28:
GET/fhir/Patient?birthdate=lt1986-04-28
GET/Patient?birthdate=lt1986-04-28
Want to know more about Aidbox, FHIR, and search? Join our community chat .
Page links
Aidbox returns links in response in search requests:
GET /fhir/PatientresourceType:Bundletype:searchsetmeta:versionId:'0'total:0link: - relation:firsturl:/fhir/Patient?page=1 - relation:selfurl:/fhir/Patient?page=1entry: []
There are two options that can modify url param content:
AIDBOX_COMPLIANCE environment variable
X-Original-Uri header
AIDBOX_COMPLIANCE env
IF AIDBOX_COMPLIANCE env is enabled then AIDBOX_BASE_URL environment variable will be used like this: <AIDBOX_BASE_URL>/fhir/Patient?page=1. For example we set AIDBOX_BASE_URL to "https://example.com":
GET /fhir/PatientresourceType:Bundletype:searchsetmeta:versionId:'0'total:0link: - relation:firsturl:https://example.com/fhir/Patient?page=1 - relation:selfurl:https://example.com/fhir/Patient?page=1entry: []
X-Original-Uri header
This header allows you completely overwrite content of url param. Aidbox will automatically add page param to your link, or replace if it exists. For example:
GET /fhir/Patient?name=examplex-original-uri:https://example.com/fhir/Patient?page=4resourceType:Bundletype:searchsetmeta:versionId:'0'total:0link: - relation:firsturl:https://example.com/fhir/Patient?page=1 - relation:selfurl:https://example.com/fhir/Patient?page=4entry: []
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.