{"id":44945,"library":"fhirpathpy","title":"fhirpathpy","description":"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.","status":"active","version":"2.2.0","language":"python","source_language":"en","source_url":"https://github.com/beda-software/fhirpath-py","tags":["fhir","fhirpath","healthcare","hl7"],"install":[{"cmd":"pip install fhirpathpy","lang":"bash","label":"pip install (default)"}],"dependencies":[],"imports":[{"note":"Old package name `fhirpath` was deprecated; new import is `fhirpathpy`","wrong":"from fhirpath import evaluate","symbol":"evaluate","correct":"from fhirpathpy import evaluate"}],"quickstart":{"code":"from fhirpathpy import evaluate\n\nresource = {\n    \"resourceType\": \"Patient\",\n    \"name\": [{\"family\": \"Doe\", \"given\": [\"John\"]}],\n    \"birthDate\": \"1970-01-01\"\n}\n\n# Evaluate FHIRPath expression\nresult = evaluate(resource, \"Patient.name.family\")\nprint(result)  # Output: ['Doe']","lang":"python","description":"Evaluates a FHIRPath expression against a FHIR resource (dict) and returns a list of values."},"warnings":[{"fix":"Extract values with `[match['value'] for match in result]` or use the `value` property.","message":"In version 2.0+, the `evaluate` function returns a list of matching nodes (each a dict with `value`, `path`, etc.) instead of raw values. Use the `result` fixture to get the 'value' field if you need the scalar.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Replace `parse(fhirpath_expr).evaluate(resource)` with `evaluate(resource, expr)`.","message":"The `fhirpathpy.parse` function was removed in v2.0. Use `evaluate` directly.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Upgrade Python to 3.10 or later, or pin to fhirpathpy<2.2.0 if you must stay on older Python.","message":"The `fhirpathpy` package no longer supports Python 3.9 and earlier (requires >=3.10).","severity":"deprecated","affected_versions":">=2.2.0"},{"fix":"Wrap the query with additional Python logic before/after evaluate() to inject custom behavior.","message":"The library does not support custom functions or extensions to the FHIRPath spec. If you need extensions, you must pre/post-process.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'2.2.0':12 '2024':15 'bug':29 'bump':19 'chang':25 'dict':40 'evalu':33 'express':34 'feb':14 'fhir':9,36,44 'fhirpath':7,23,45 'fhirpathpi':1 'fix':28 'follow':16 'fulli':30 'healthcar':46 'hl7':47 'implement':4 'minor':17 'model':43 'patch':26 'pydant':42 'python':3 'r4':10 'releas':13,27 'repres':38 'resourc':37 'spec':24 'specif':8 'support':32 'type':31 'upstream':22 'version':11,18","created_at":"2026-06-07T12:52:37.182677+00:00","updated_at":"2026-06-07T12:52:37.182677+00:00","problems":[{"fix":"Install `pip install fhirpathpy` and import as `from fhirpathpy import evaluate`.","cause":"Importing the wrong package name (fhirpath instead of fhirpathpy).","error":"AttributeError: module 'fhirpath' has no attribute 'evaluate'"},{"fix":"Remove custom functions or implement them as Python helpers before/after evaluate().","cause":"Trying to call a custom function not defined in the FHIRPath spec or in fhirpathpy's built-ins.","error":"fhirpathpy.exceptions.EvaluationException: Unknown function: myCustomFunc"},{"fix":"Use `.model_dump()` (Pydantic v2) or `.dict()` (Pydantic v1) to convert to dict before calling evaluate().","cause":"Passing a Pydantic model object directly instead of a dict.","error":"TypeError: Object of type Patient is not JSON serializable"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/beda-software/fhirpath-py.git","github":"https://github.com/beda-software/fhirpath-py.git","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["analytics"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}