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%
Utilities that read and modify FHIR resource dictionaries using dot-separated paths with numeric indexes. Functions may mutate the provided resource as long as the returned value reflects the requested changes.
name[0].family = "Doe" and address[0].city = "Springfield", reading {"family": "name.0.family", "city": "address.0.city", "missing": "address.1.city"} returns {"family": "Doe", "city": "Springfield", "missing": "Unknown"} when the default "Unknown" is supplied. @test"telecom.0.value" to "555-0000" replaces the phone number when the telecom list already has a first entry; the function returns the updated resource. @test"address.0.postalCode" to "12345" on a resource lacking an address array creates the intermediate containers and inserts the postal code. @test"address.0.city", copying that value to "contact.0.address.0.city" duplicates the city string; when the source is missing, the target path is left untouched. @test@generates
from typing import Any, Mapping
def read_paths(resource: dict[str, Any], paths: Mapping[str, str], default: Any | None = None) -> dict[str, Any]:
"""Return a mapping of labels to values from dotted paths; use default for missing segments."""
def set_path(resource: dict[str, Any], path: str, value: Any) -> dict[str, Any]:
"""Return the resource with value written at the dotted path, creating intermediate dict/list nodes as needed."""
def copy_path(resource: dict[str, Any], source_path: str, target_path: str) -> dict[str, Any]:
"""If the source path resolves to a non-None value, write it to the target path; otherwise leave the resource unchanged."""Enables nested path navigation helpers for FHIR resource dictionaries.
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10