SearchParameter

Define and use SearchParameter resource

SearchParameter is a special meta-resource, which describes which part of resource and how you want to make searchable. Aidbox is coming with predefined set of search params for different resource types, but you can define new search params on-fly.

Aidbox SearchParameter has its own, concise structure, which is not the same as FHIR SearchParameters. To import your own FHIR SearchParameters you have to convert them into Aidbox representation.

Here is example of Patient.name search parameter:

GET /SearchParameter/Patient.name

# 200
name: name
type: string
resource: {id: Patient, resourceType: Entity}
expression:
- [name]

Structure

All this attributes are required.

Types

Depending on the value type, different modifiers can be applied.

Expression

Expression is a set of elements, by which we want to search. Expression is logically very simple subset of FHIRPath (which can be efficiently implemented in database) expressed as data. Expression is array of PathArrays; PathArray is an array of strings, integers or objects, where each type has special meaning:

  • string - name of element

  • integer - index in collection

  • object - filter by pattern in collection

Examples:

  • PathArray ["name", "given"] extracts as array all given and family names and flatten into one collection. Equivalent FHIRPath expression is name.given | name.family.

  • PathArray [["name", 0, "given", 0]] extract only first given of first name (FHIRPath name.0.given.0

  • PathArray [["telecom", {"system": "phone"}, "value"]] extract all values of telecom collection filtered by system=phone (equivalent FHIRPath: telecom.where(system='phone').value )

Expression consists of array of PathArrays, all results of PathArray are concatinated into one collection.

Create Custom Search Parameter

Is described in

Last updated