Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 1.02 KB

.-expressions.md

File metadata and controls

33 lines (22 loc) · 1.02 KB
description
Search by arbitrary elements of resources

. expressions

{% hint style="warning" %} This is non-FHIR extension, incompatible with other FHIR servers {% endhint %}

With parameters started with . you can provide the exact path for the element, optionally provide coercing after :: using PostgreSQL types and the operator after $.

GET /Patient?.name.0.family=Johnson
=> WHERE resource#>>'{name,0,family}' = 'Jonhnson'

GET /Patient?.name.0.family$contains=Joh
=> WHERE resource#>>'{name,0,family}' ilike '%John%'

GET /Encounter?.start::timestamptz$gt=2015-01-01
=> WHERE (resource#>>'{start}')::timestamptz > '2015-01-01'

GET /Patient?.contact$isnull=true
=> WHERE resource#>>'{contact}' IS NULL

{% hint style="info" %} expressions with typecast require user input to be correct by PostgreSQL syntax.

e.g.: for timestamptz values must be formatted as specified in PostgreSQL date/time input doc {% endhint %}