Async/sync FHIR client for Python providing comprehensive API for CRUD operations over FHIR resources
Agent Success
Agent success rate when using this tile
68%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.08x
Baseline
Agent success rate without this tile
63%
Create a helper that gathers encounter data for one or more patients while preserving related resources returned by the server.
Retrieve encounters with forward includes that follow referenced resources iteratively so related participants stay attached to each bundle page.
@generates
async def build_encounter_bundle(
client,
patient_ids: list[str],
page_size: int = 50
) -> dict:
"""
Build a combined encounter bundle for the given patients using the provided FHIR-capable client.
Args:
client: Initialized client instance connected to a FHIR server.
patient_ids: Patient identifiers to filter encounters.
page_size: Page size to request per search page.
Returns:
Dict with keys:
- "bundle": raw Bundle dict containing encounters plus any related resources returned by the server.
- "summaries": list of per-encounter dicts with encounter id, patient reference, service provider reference, observation references, and any warnings.
"""Python FHIR client for performing searches with related resources and reference helpers.
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10