fhirpath
fhirpath_pg · data type for jsonb inspection
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100218 | fhirpath | fhirpath_pg | 1.0 | FEAT | Unknown | C |
Usage
Sources:
fhirpath is a native C implementation of FHIRPath/FluentPath evaluation over PostgreSQL jsonb. Use it to compile a path into the fhirpath type and extract or normalize values from FHIR-shaped JSON documents. The upstream repository provides a small, low-level SQL surface rather than a complete application framework.
Core Workflow
Install the extension, cast a path expression to fhirpath, and pass it with a JSON document to an extractor:
The specialized accessors accept additional text arguments used by the implementation to select or normalize values. Verify their behavior against representative FHIR documents before embedding them in generated columns or indexes.
User-Facing Objects
fhirpath: variable-length type whose input parser compiles a path expression.fhirpath_extract(jsonb, fhirpath): returns the selected value asjsonb.fhirpath_as_string(jsonb, fhirpath, text): returns a selected value astext.fhirpath_as_token(jsonb, fhirpath, text)andfhirpath_as_reference(jsonb, fhirpath, text): returntext[]token or reference representations.fhirpath_as_number(jsonb, fhirpath, text, text): returnsnumeric.fhirpath_as_date(jsonb, fhirpath, text, text)andfhirpath_date_bound(text, text): returntimestamptzvalues.fhirpath_exists(jsonb, fhirpath, text): tests whether a selected value exists.
Operational Notes
The control file marks fhirpath relocatable and does not require preloading. Its SQL functions are declared STRICT IMMUTABLE, which makes them usable in expression indexes when their inputs are immutable. Upstream publishes no formal release and the README is primarily development material; it does not claim complete conformance with a particular FHIRPath specification release. Treat version 1.0 as an experimental API, test path grammar and edge cases directly, and pin the reviewed source revision.