Python SDK for building AI in real healthcare systems — type-safe FHIR, real-time EHR connectivity, and production deployment
Project description
Open-Source Python SDK for Healthcare AI
The model is the easy part — the integration that blocks it from ever reaching production is the hard part. HealthChain handles it, giving your models and agents tools they can trust: type-safe FHIR resources, real-time EHR connectivity, and production-ready deployment. So what you build holds up outside the demo.
Installation
pip install healthchain
Quick Start
# Scaffold a FHIR Gateway project
healthchain new my-app -t fhir-gateway
cd my-app
# Run locally
healthchain serve
Edit app.py to add your model, and healthchain.yaml to configure deployment settings.
See the CLI reference for all commands.
Building with an AI assistant? Point it at llms.txt for a map of the current API docs.
Core Features
The quickest way for AI developers and researchers to ship healthcare AI — everything you need out of the box, built to scale with you.
|
🔌 Multi-EHR Data Aggregation Connect to live FHIR APIs across Epic, Cerner, and more — and move research pipelines off manual database extracts onto data infrastructure that scales past one site Getting Started → |
🔥 FHIR as a Superpower Type-safe FHIR resources, validation that catches broken data before it ships, and terminology lookups — the strict schema that turns healthcare data into a built-in unit test Getting Started → |
|
🤖 Tools Your Agents Can Trust Hand any agent typed, validated FHIR tools from one toolkit — served to Claude over MCP or dropped into LangChain, so what your agent writes is valid and correctly coded Getting Started → |
💬 FHIR-Grounded Patient Q&A Answer patient questions from their live clinical record — the foundational pattern for portal chatbots and care-plan assistants, with a schema for truth Getting Started → |
Why HealthChain?
Every serious healthcare AI project builds the same integration infrastructure from scratch. Whether you're deploying a logistic regression, a 70B-parameter model, or an agentic workflow, the wall between a trained model and a live clinical system is the same: real FHIR APIs, multi-site deployments, auditable governance. No off-the-shelf solution exists, and engineers who understand both AI and healthcare protocols are scarce and hard to retain.
HealthChain handles that complexity so you can focus on what actually matters: the model and the patient.
- Optimized for real-time - Connect to live FHIR APIs and integration points instead of stale data exports
- Validation built in - Type-safe FHIR resources and validation reports that catch broken data before it ships — including spec-invalid clinical codes that type checks alone let through
- No invented facts - Helpers never add clinical claims you didn't pass: no auto-generated timestamps, no guessed statuses — what enters the record is exactly what your model produced
- Bring any model or agent - LLMs, agents, or classical ML — and output validated FHIR
- Works with your existing stack - Integrates with FastAPI, MCP, and LangChain
- Production-ready foundations - Dockerized deployment, configurable security, and an architecture built for NHS and HIPAA environments
🏆 Recognition & Community
Featured & Presented:
- Featured in TLDR AI Newsletter (900K+ developers)
- Featured by Medplum for open source integration with Epic
- Presented at NHS Python Open Source Conference (watch talk)
- Built from NHS AI deployment experience – read the origin story
🤝 Partnerships & Production Use
Exploring HealthChain for your product or organization? Get in touch to discuss integrations, pilots, or collaborations, or join our Discord to connect with the community.
Usage Examples
Creating a Gateway [Docs]
from healthchain.gateway import HealthChainAPI, FHIRGateway
from healthchain.fhir.r4b import Patient
# Create healthcare application
app = HealthChainAPI(title="Multi-EHR Patient Data")
# Connect to multiple FHIR sources
fhir = FHIRGateway()
fhir.add_source("epic", "fhir://fhir.epic.com/r4?client_id=epic_client_id")
fhir.add_source("cerner", "fhir://fhir.cerner.com/r4?client_id=cerner_client_id")
@fhir.aggregate(Patient)
def enrich_patient_data(id: str, source: str) -> Patient:
"""Get patient data from any connected EHR and add AI enhancements"""
bundle = fhir.search(
Patient,
{"_id": id},
source,
add_provenance=True,
provenance_tag="ai-enhanced",
)
return bundle
app.register_gateway(fhir)
# Available at: GET /fhir/transform/Patient/123?source=epic
# Available at: GET /fhir/transform/Patient/123?source=cerner
if __name__ == "__main__":
app.run(port=8888)
Giving an Agent FHIR Tools [Docs]
from healthchain.tools import FHIRToolkit
# One toolkit: build, validate, read, and code FHIR — as typed agent tools
kit = FHIRToolkit(bundle="patient_bundle.json")
kit.as_mcp().run() # serve to Claude or any MCP client
tools = kit.as_langchain() # or drop into a LangChain agent
Or straight from the terminal, no code:
healthchain mcp --bundle patient_bundle.json
🛣️ What we're building towards
- 🔒 Security foundations — API-key authentication, audit logging, and TLS, configured via
healthchain.yamland enforced by the gateway middleware - 📋 Governance as config — clinical safety, data access agreements, and compliance standards for NHS/HIPAA deployments as a first-class deployment artifact in
healthchain.yaml - 🔌 Deeper EHR connectivity — more FHIR sources, live data patterns, and real-world integration examples from pilot deployments
- 📊 Observability — deployment telemetry and audit trails for healthcare systems
- 🤖 A toolkit for clinical AI agents — typed FHIR tools with validation and terminology built in, served over MCP and LangChain
🤝 Contributing
HealthChain is built by and for the next generation of healthcare developers — researchers moving models from retrospective data into live systems, AI developers who don't want to spend months learning FHIR before they can ship anything. The best contributions come from people who have hit a real problem and have something specific to say about it.
Get started:
- Working with healthcare or research data? Contribute a cookbook — bring your use case, I'll personally support you through it
- Read CONTRIBUTING.md for guidelines
- Technical questions and ideas → GitHub Discussions
- Pilots and partnerships → email
🤗 Acknowledgements
This project builds on fhir.resources and CDS Hooks standards developed by HL7 and Boston Children's Hospital.
© 2024–2026 dotimplement ai. HealthChain is an open source project maintained by dotimplement ai.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file healthchain-0.16.0.tar.gz.
File metadata
- Download URL: healthchain-0.16.0.tar.gz
- Upload date:
- Size: 3.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29ea573baf760a84f44137efe123be26b1ae7e72981d64009b49e629e495ab89
|
|
| MD5 |
4c121c786c079d85185e3a7c4f9d57da
|
|
| BLAKE2b-256 |
2759a67abc7c5e460384887f39334c578aff13ffc73c3d66ad4100a5d373753f
|
Provenance
The following attestation bundles were made for healthchain-0.16.0.tar.gz:
Publisher:
publish.yml on healthchainai/HealthChain
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
healthchain-0.16.0.tar.gz -
Subject digest:
29ea573baf760a84f44137efe123be26b1ae7e72981d64009b49e629e495ab89 - Sigstore transparency entry: 2152014274
- Sigstore integration time:
-
Permalink:
healthchainai/HealthChain@35a7cd890c065af3e626ea326ec82bbf6772d8a0 -
Branch / Tag:
refs/tags/0.16.0 - Owner: https://github.com/healthchainai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@35a7cd890c065af3e626ea326ec82bbf6772d8a0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file healthchain-0.16.0-py3-none-any.whl.
File metadata
- Download URL: healthchain-0.16.0-py3-none-any.whl
- Upload date:
- Size: 257.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33ae0b679c28ad376929af9a8c85eca196d9ff2256a9eb6d41c577d628284093
|
|
| MD5 |
c848f729400eb615ae1851c8fe710d4b
|
|
| BLAKE2b-256 |
e72f4e0d20065face045a35f99458f0a12cca629eaa7d19e1a435905c0a4a30a
|
Provenance
The following attestation bundles were made for healthchain-0.16.0-py3-none-any.whl:
Publisher:
publish.yml on healthchainai/HealthChain
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
healthchain-0.16.0-py3-none-any.whl -
Subject digest:
33ae0b679c28ad376929af9a8c85eca196d9ff2256a9eb6d41c577d628284093 - Sigstore transparency entry: 2152014352
- Sigstore integration time:
-
Permalink:
healthchainai/HealthChain@35a7cd890c065af3e626ea326ec82bbf6772d8a0 -
Branch / Tag:
refs/tags/0.16.0 - Owner: https://github.com/healthchainai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@35a7cd890c065af3e626ea326ec82bbf6772d8a0 -
Trigger Event:
release
-
Statement type: