Skip to main content

fhir_client

FHIR Client implementation.

Classes

FHIRClient

class FHIRClient(    url: str,    authorization: Union[str, None] = None,    extra_headers: Union[dict[str, Any], None] = None,    requests_config: Union[dict[str, Any], None] = None,    *,    dump_resource: Callable[[Any], dict[str, Any]] = <function FHIRClient.<lambda>>,):

Implementation of FHIR Client for error handling.

dump kwarg is a function that is called for all CRUD operations. It's needed for custom typing model like pydantic

Ancestors

Methods


set_authorization

def set_authorization(self, token: str, expires: datetime | None = None)> None:

Set the bearer token (and optional expiry) for EHR requests.

Call this when using externally managed JWT so the client can log fingerprint and expiry on request failure. Also sets .authorization as required by the parent class.