HealthChain is an open-source developer framework to build healthcare AI applications with native protocol understanding. Skip months of custom integration with built-in FHIR support, real-time EHR connectivity, and production-ready deployment - all in Python.
pip install healthchain
HealthChain is the quickest way for AI/ML engineers to integrate their models with real healthcare systems.
![]() β‘οΈ Real-Time Clinical Workflow Integration Build CDS alerts and automated coding tools that integrate directly into Epic workflows Getting Started β |
![]() π₯ FHIR Development Utilities Accelerate development with type-safe FHIR resource creation, validation helpers, and sandbox environments for testing clinical workflows Getting Started β |
![]() π Multi-EHR Data Aggregation Aggregate patient data from multiple FHIR sources into unified records with built-in NLP processing and automatic deduplication Getting Started β |
![]() π Healthcare Data Format Conversion Convert between FHIR and CDA formats with configuration-driven templates for unified data processing workflows Getting Started β |
π 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 β |
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
- Built-in NLP support - Extract structured data from clinical notes, output as FHIR
- Developer experience - Modular and extensible architecture works across any EHR system
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 fhir.resources.patient 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 = None) -> Patient:
"""Get patient data from any connected EHR and add AI enhancements"""
patient = fhir.read(Patient, id, source)
# Add AI processing metadata
patient.extension = patient.extension or []
patient.extension.append({
"url": "http://healthchain.org/fhir/ai-processed",
"valueString": f"Enhanced by HealthChain from {source}"
})
return patient
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)
- π Data provenance and audit trails tracking
- π HIPAA compliance and security
- π HL7v2 parsing, FHIR profile conversion and OMOP mapping support
- π Enhanced deployment support with observability and telemetry (Docker, Kubernetes, etc.)
- π Model performance monitoring with MLFlow integration
- π€ MCP server integration
We are always eager to hear feedback and suggestions, especially if you are a developer or researcher working with healthcare systems!
- π‘ Let's chat! Discord
- π οΈ Contribution Guidelines
This project builds on fhir.resources and CDS Hooks standards developed by HL7 and Boston Children's Hospital.