Skip to main content
HealthChain

PyPI Version Stars Downloads

License Python Versions Build Status AI-Assisted Development DOI

Substack Discord

Open infrastructure for healthcare data applications.

Connect Python pipelines and applications to live FHIR APIs, build and validate structured output, and deliver it through REST, CDS Hooks, CDA, MCP, or LangChain.

Installation

pip install healthchain

What HealthChain Does

HealthChain puts a consistent FHIR boundary around your Python code: live data in, your own logic in the middle, and validated FHIR out. Built for research software, healthcare data, and AI teams.

Epic, Cerner, and other FHIR sources flow through FHIRGateway into one patient record

🔌 Connect to Live FHIR APIs

Connect to Epic, Cerner, Medplum, and other FHIR R4 servers through one interface that handles authentication, source routing, and common FHIR operations.

Getting Started →

Structured output goes through validate_resource, which reports any FHIR issues to correct

🔥 Build and Validate FHIR

Build typed resources without hand-writing deeply nested FHIR. Structured validation identifies failing fields and invalid required codes before delivery.

Getting Started →

FHIRToolkit serves typed FHIR tools to Claude over MCP and to LangChain agents

🤖 Use the Same Tools with Agents

Expose the same build, validate, read, and terminology operations over MCP or LangChain, with structured errors an agent can inspect and correct.

Getting Started →

A patient question plus the live FHIR record produces a grounded answer

💬 Build FHIR-Backed Applications

Use live or local FHIR data in research software, patient-facing applications, analytics, decision support, and AI-assisted workflows.

Getting Started →

Why HealthChain?

Every healthcare data team rebuilds the same integration layer. Whether your logic is rule-based, a logistic regression, or an agent, it needs authenticated access to real FHIR APIs and a reliable way to turn output into coded FHIR. Pipelines tied to one site's warehouse don't travel, and structural or coding errors may only be discovered downstream.

HealthChain handles that layer so you can focus on your logic and your domain.

  • Live data, not exports — Connect to live FHIR APIs instead of site-specific warehouse queries and stale extracts
  • Keep connection details out of pipeline logic — Load endpoints and credentials from environment-backed configuration
  • Build FHIR with less boilerplate — Use flat, typed helpers instead of manually assembling deeply nested resources
  • Catch errors early — Get structured validation reports with failing field paths and actionable diagnostics
  • Resolve codes instead of guessing them — Map free text through a swappable terminology lookup before building a resource
  • Choose how to deliver the result — Expose output through FHIR REST services, CDS Hooks, SOAP/CDA, MCP, or LangChain

🏆 Recognition & Community

Featured & Presented:

🤝 Pilots & Partnerships

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

Build a FHIR Service

Expose Multiple FHIR Sources [Docs]

from healthchain.gateway import HealthChainAPI, FHIRGateway
from healthchain.gateway.clients import FHIRAuthConfig
from healthchain.fhir.r4b import Bundle, Patient

# Create a FHIR-connected service
app = HealthChainAPI(title="Multi-EHR Patient Data")

# Credentials are loaded from EPIC_* and CERNER_* environment variables
fhir = FHIRGateway()
fhir.add_source("epic", FHIRAuthConfig.from_env("EPIC").to_connection_string())
fhir.add_source("cerner", FHIRAuthConfig.from_env("CERNER").to_connection_string())

@fhir.aggregate(Patient)
def patient_data(id: str, source: str) -> Bundle:
    """Fetch patient data from any configured FHIR source."""
    bundle = fhir.search(
        Patient,
        {"_id": id},
        source,
        add_provenance=True,
        provenance_tag="healthchain-source",
    )
    return bundle

app.register_gateway(fhir)

# Available at: GET /fhir/aggregate/Patient?id=123&sources=epic&sources=cerner

if __name__ == "__main__":
    app.run(port=8888)

Scaffold with the CLI

Turn a working pipeline into a configurable FHIR service:

healthchain new my-app -t fhir-gateway
cd my-app
healthchain serve
HealthChain CLI scaffolding and running a FHIR Gateway service

Add your logic in app.py. Use healthchain.yaml to configure FHIR sources and service settings while keeping credentials in environment variables. See the CLI reference for all commands.

Agent and Assistant Workflows

Give 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 serve the tools straight from the terminal:

healthchain mcp --bundle patient_bundle.json

Build with an AI Assistant

Install the HealthChain plugin to give Claude Code or Codex the current API, CLI, and recipes:

# Claude Code
/plugin marketplace add healthchainai/HealthChain
/plugin install healthchain@healthchain

# Codex
codex plugin marketplace add healthchainai/HealthChain
codex plugin add healthchain@healthchain

Or point any assistant at llms.txt for a map of the current API docs.

🛣️ What we're building towards

  • 🔌 Deeper FHIR connectivity — more authentication patterns, write workflows, and real-world examples from pilot deployments
  • 🧪 Broader validation — cover more resource types and value-set bindings, with clearer correction reports and optional server-backed profile validation
  • 🧭 Terminology integrations — connect the TerminologyLookup interface to FHIR terminology servers and licensed vocabularies
  • 🔎 Traceable data movement — carry provenance, validation results, and source errors through transformations and downstream delivery
  • 🧱 Reusable data workflows — strengthen the patterns for moving research extracts, claims, and application data behind consistent FHIR interfaces

🤝 Contributing

🤗 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.

Metadata

Release files for healthchain 0.17.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for healthchain 0.17.0
File Size Uploaded Provenance Actions
healthchain-0.17.0.tar.gz 3.5 MB With provenance Details for healthchain-0.17.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for healthchain 0.17.0
File Interpreter ABI Platform Actions
healthchain-0.17.0-py3-none-any.whl Python 3 none any Details for healthchain-0.17.0-py3-none-any.whl

Total release size: 3.8 MB

Release files / healthchain-0.17.0.tar.gz

Download URL healthchain-0.17.0.tar.gz
Size 3.5 MB
Tags Source
SHA-256 checksum
How to use checksums
a5c952c4ca2f2963c3249b4a75560c7b5442331560b6b6e323dc0c8b91e561ba
BLAKE2b-256 checksum
How to use checksums
caeec0627dc7b42fcad6469aa508b1021e7c7f7771f9852af9d2090260323683
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / healthchain-0.17.0-py3-none-any.whl

Download URL healthchain-0.17.0-py3-none-any.whl
Size 261.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dcd907a71021276e5dcf3b6a7adc8f44138c117854bdbffa0c18a43d6c814c80
BLAKE2b-256 checksum
How to use checksums
f1cac7927678130007a9aa1bc324afa0841ee7a7df849c1b5528ccbf59a60c92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Security for healthchain 0.17.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for healthchain-0.17.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.17.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page