Async/sync FHIR client for Python providing comprehensive API for CRUD operations over FHIR resources
68
Create asynchronous helpers that assemble and execute FHIR queries for Observation and Patient resources using the package's fluent search capabilities.
since timestamp, and max_results=10, returns a bundle with at most 10 Observation entries sorted by most recent effective time first. @testsummary_only=True, Observation entries only include id, code, subject, effective[x], and value[x] fields while still embedding referenced Patient and Practitioner resources. @testsince timestamp, returns Patient resources that have matching Observations through a reverse-chained query instead of client-side filtering. @testinclude_observations=True, the bundle also contains the matching Observation resources alongside Patients. @test@generates
async def fetch_recent_observations(
client,
patient_ref: str,
codes: list[str],
since: str,
*,
max_results: int = 25,
summary_only: bool = False
) -> dict:
"""
Return a raw bundle of Observation resources for a patient, limited by code and time,
sorted newest-first, with related Patient and Practitioner resources included.
Element selection is applied when summary_only is True.
"""
async def find_patients_by_observation(
client,
code: str,
*,
since: str | None = None,
include_observations: bool = False,
performer_organization: str | None = None
) -> dict:
"""
Return Patient resources that have matching Observations,
optionally bundling the related Observations and restricting by performer organization.
"""FHIR client toolkit for building and executing FHIR queries.
Install with Tessl CLI
npx tessl i tessl/pypi-fhirpyevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10