Skip to content

healthchainai/HealthChain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

143 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

HealthChain πŸ’« πŸ₯

HealthChain Logo

PyPI Version Stars Downloads

License Python Versions Build Status AI-Assisted Development

Substack Discord

Open-Source Framework for Productionizing Healthcare AI

HealthChain is an open-source SDK for production-ready healthcare AI. Skip months of custom integration work with built-in FHIR support, real-time EHR connectivity, and deployment tooling for healthcare AI/ML systems β€” all in Python.

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
HealthChain CLI demo

Edit app.py to add your model, and healthchain.yaml to configure compliance, security, and deployment settings.

See the CLI reference for all commands.

Core Features

HealthChain is the quickest way for AI engineers to connect their models to real healthcare data.

Multi-Source Integration

πŸ”Œ Multi-EHR Data Aggregation

Aggregate patient data from multiple FHIR sources into unified records with built-in NLP processing and automatic deduplication

Getting Started β†’

Deploy

πŸš€ Deploy ML Models as Healthcare APIs

Turn any trained model into a production-ready FHIR endpoint with OAuth2 authentication and type-safe healthcare data handling

Getting Started β†’

Clinical Integration

⚑️ Real-Time Clinical Workflow Integration

Deploy AI models as CDS services that integrate directly into EHR workflows β€” alerts, recommendations, and automated coding at the point of care

Getting Started β†’

FHIR Utilities

πŸ”₯ FHIR Development Utilities

Type-safe FHIR resource creation, validation helpers, and sandbox environments β€” skip the boilerplate and work with healthcare data natively

Getting Started β†’

Why HealthChain?

Electronic health record (EHR) data is specific, complex, and fragmented. Most healthcare AI projects require months of manual integration and custom validation on top of model development. This leads to fragile pipelines that break easily and consume valuable developer time.

HealthChain understands healthcare protocols and data formats natively, so you don't have to build that knowledge from scratch. Skip months of custom integration work and productionize your healthcare AI faster.

  • Optimized for real-time - Connect to live FHIR APIs and integration points instead of stale data exports
  • Automatic validation - Type-safe FHIR models prevent broken healthcare data
  • Native LLM + ML support - Wire up any model, from LLMs to scikit-learn, and output results as FHIR
  • Developer experience - Modular and extensible architecture works across any EHR system
  • Production-ready foundations - Dockerized deployment, configurable security and compliance settings, and an architecture designed for real-world healthcare environments

πŸ† Recognition & Community

Featured & Presented:

🀝 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

Building a Pipeline [Docs]

from healthchain.pipeline import Pipeline
from healthchain.pipeline.components.integrations import SpacyNLP
from healthchain.io import Document

# Create medical NLP pipeline
nlp_pipeline = Pipeline[Document]()
nlp_pipeline.add_node(SpacyNLP.from_model_id("en_core_web_sm"))

nlp = nlp_pipeline.build()
doc = Document("Patient presents with hypertension and diabetes.")
result = nlp(doc)

spacy_doc = result.nlp.get_spacy_doc()
print(f"Entities: {[(ent.text, ent.label_) for ent in spacy_doc.ents]}")
print(f"FHIR conditions: {result.fhir.problem_list}")  # Auto-converted to FHIR Bundle

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__":
    import uvicorn
    uvicorn.run(app, port=8000)

Testing with Sandbox [Docs]

from healthchain.gateway import HealthChainAPI, CDSHooksService

cds = CDSHooksService()
app = HealthChainAPI(title="Discharge Summarizer")
app.register_service(cds, path="/cds")

# Server lifecycle handled automatically
with app.sandbox("discharge-summary") as client:
    client.load_from_path("./data/patients", pattern="*_patient.json")
    responses = client.send_requests()
    client.save_results("./output/")

πŸ›£οΈ What we're building towards

  • πŸ”’ Production security and compliance β€” audit logging, API authentication, and governance config for NHS/HIPAA deployments
  • πŸ”Œ Deeper EHR connectivity β€” more FHIR sources, live data patterns, and real-world integration examples from pilot deployments
  • πŸ“Š Observability and Eval β€” model eval, deployment telemetry, and audit trails for clinical AI systems
  • πŸ€– AI agent ecosystem β€” MCP server, Claude skill for healthcare data workflows, and agentic integrations for the next generation of clinical AI tools

🀝 Contributing

HealthChain is built by and for AI engineers working with healthcare data. The best contributions come from people who have hit a real problem and have something specific to say about it.

Get started:

πŸ€— 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.

About

Open-source SDK for healthcare AI: FHIR endpoints, EHR integration, and deployment tooling in Python πŸ’« πŸ₯

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors