// the find
smart-on-fhir/client-py
Python SMART on FHIR client
fhirclient is the official Python client for FHIR R4 servers from the SMART Health IT team at Boston Children's Hospital. It combines a network client with OAuth/SMART authorization and auto-generated Python model classes for every FHIR resource type. Aimed at health IT developers who need to read/write clinical data from EHR systems like Epic or Cerner.
The FHIR model classes are generated from the spec via fhir-parser, so they stay in sync with the standard rather than being hand-maintained. Validation on assignment (e.g., catching a string where a list is expected) catches schema errors at write time rather than at server rejection time. The `perform_resources_iter` pattern for search results handles bundle pagination without forcing you to manage it manually. SMART OAuth flow is baked in — `smart.authorize_url` and state management are handled for you, which is non-trivial to get right.
Frozen at FHIR R4 (4.0.1) — R4B and R5 are not supported, which is increasingly a problem as newer EHR deployments move to R5. No async support anywhere: every network call blocks, so you can't use this in an async web framework without running it in a thread pool. The README itself points you toward cumulus-fhir-support for 'more authentication options and built-in retries' — meaning retry logic and token refresh are either absent or thin here. The model generation via git submodule (fhir-parser) makes contributing or customizing the models awkward; you need to understand two repos to change one class.