A Python implementation of the FHIRPath specification (FHIR R4), version 2.2.0, released Feb 2024. Follows minor version bumps when the upstream FHIRPath spec changes; patch releases fix bugs. Fully typed, supports evaluating expressions against FHIR resources represented as dicts or Pydantic models.
pip install fhirpathpyNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Evaluates a FHIRPath expression against a FHIR resource (dict) and returns a list of values.
Extract values with `[match['value'] for match in result]` or use the `value` property.
Replace `parse(fhirpath_expr).evaluate(resource)` with `evaluate(resource, expr)`.
Upgrade Python to 3.10 or later, or pin to fhirpathpy<2.2.0 if you must stay on older Python.
Wrap the query with additional Python logic before/after evaluate() to inject custom behavior.
Install `pip install fhirpathpy` and import as `from fhirpathpy import evaluate`.
Remove custom functions or implement them as Python helpers before/after evaluate().
Use `.model_dump()` (Pydantic v2) or `.dict()` (Pydantic v1) to convert to dict before calling evaluate().
No dependency data recorded yet.