For AI agents: the documentation index is at /docs/aidbox/llms.txt. A Markdown version of this page is available at /docs/aidbox/notebooks.md or by requesting it with the Accept: text/markdown header.
Aidbox Docs
All notebooks

Search API: _filter

Description

12 cells · updated Jul 17, 2023

This is a read-only view. Responses shown were saved when the notebook was published — open it in your own Aidbox to run the cells against live data.

_filter is a FHIR special search parameter. Aidbox offers the partial support of _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.

Filter patients with id 'pt-2'

REST Send Cells run only inside Aidbox. Use Run in Aidbox above to open this notebook in your own instance.
GET /fhir/Patient?_filter=id eq 'pt-2'

returns patients with name that contain specific substring e.g. Smith

REST Send Cells run only inside Aidbox. Use Run in Aidbox above to open this notebook in your own instance.
GET /fhir/Patient?_filter=name co 'smi'

returns patients with address.city starting with provided string, e.g. London

REST Send Cells run only inside Aidbox. Use Run in Aidbox above to open this notebook in your own instance.
GET /fhir/Patient?_filter=address-city sw 'Lon'

returns all patients with birthdate >= (<=) provided date

REST Send Cells run only inside Aidbox. Use Run in Aidbox above to open this notebook in your own instance.
GET /fhir/Patient?_filter=birthdate ge 1996-06-06
REST Send Cells run only inside Aidbox. Use Run in Aidbox above to open this notebook in your own instance.
GET /fhir/Patient?_filter=birthdate le 1996-06-06

Logical expression support

You can do composition of logical expressions with parentheses

REST Send Cells run only inside Aidbox. Use Run in Aidbox above to open this notebook in your own instance.
GET /fhir/Patient?_filter=(name co 'smi' or name co 'fed') or name co 'unex'
Response: Body
Status: 200
{
  "resourceType": "Bundle",
  "type": "searchset",
  "meta": {
    "versionId": "0"
  },
  "total": 0,
  "link": [
    {
      "relation": "first",
      "url": "/fhir/Patient?_filter=(name co 'smi' or name co 'fed') or name co 'unex'&page=1"
    },
    {
      "relation": "self",
      "url": "/fhir/Patient?_filter=(name co 'smi' or name co 'fed') or name co 'unex'&page=1"
    }
  ],
  "entry": []
}