Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 29 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ First time here? Check out our [Docs](https://dotimplement.github.io/HealthChain


## Features
- [x] 🔌 **Gateway**: Connect to multiple EHR systems with [unified API](https://dotimplement.github.io/HealthChain/reference/gateway/gateway/) supporting FHIR, CDS Hooks, and SOAP/CDA protocols
- [x] 🔌 **Gateway**: Connect to multiple EHR systems with [unified API](https://dotimplement.github.io/HealthChain/reference/gateway/gateway/) supporting FHIR, CDS Hooks, and SOAP/CDA protocols (sync / async support)
- [x] 🔥 **Pipelines**: Build FHIR-native ML workflows or use [pre-built ones](https://dotimplement.github.io/HealthChain/reference/pipeline/pipeline/#prebuilt) for your healthcare NLP and AI tasks
- [x] 🔄 **InteropEngine**: Convert between FHIR, CDA, and HL7v2 with a [template-based engine](https://dotimplement.github.io/HealthChain/reference/interop/interop/)
- [x] 🔒 Type-safe healthcare data with full type hints and Pydantic validation for [FHIR resources](https://dotimplement.github.io/HealthChain/reference/utilities/fhir_helpers/)
- [x] ⚡ Event-driven architecture with real-time event handling and [audit trails](https://dotimplement.github.io/HealthChain/reference/gateway/events/) built-in
- [x] ⚡ Built-in event-driven logging and operation tracking for [audit trails](https://dotimplement.github.io/HealthChain/reference/gateway/events/)
- [x] 🚀 Deploy production-ready applications with [HealthChainAPI](https://dotimplement.github.io/HealthChain/reference/gateway/api/) and FastAPI integration
- [x] 🧪 Generate [synthetic healthcare data](https://dotimplement.github.io/HealthChain/reference/utilities/data_generator/) and [sandbox testing](https://dotimplement.github.io/HealthChain/reference/sandbox/sandbox/) utilities
- [x] 🖥️ Bootstrap configurations with CLI tools

## Why use HealthChain?
- **EHR integrations are manual and time-consuming** - **HealthChainAPI** abstracts away complexities so you can focus on AI development, not learning FHIR APIs, CDS Hooks, and authentication schemes.
Expand Down Expand Up @@ -86,6 +87,11 @@ app.register_service(notes)
# /fhir/* - Patient data, observations, etc.
# /cds/* - Real-time clinical alerts
# /soap/* - Clinical document processing

# Deploy with uvicorn
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, port=8888)
```

### FHIR Operations with AI Enhancement
Expand All @@ -99,23 +105,27 @@ gateway.add_source("epic", "fhir://fhir.epic.com/r4?...")

# Add AI transformations to FHIR data
@gateway.transform(Patient)
async def enhance_patient(id: str, source: str = None) -> Patient:
async with gateway.modify(Patient, id, source) as patient:
# Get lab results and process with AI
lab_results = await gateway.search(
Observation,
{"patient": id, "category": "laboratory"},
source
)
insights = nlp_pipeline.process(patient, lab_results)

# Add AI summary to patient record
patient.extension = patient.extension or []
patient.extension.append({
"url": "http://healthchain.org/fhir/summary",
"valueString": insights.summary
})
return patient
def enhance_patient(id: str, source: str = None) -> Patient:
patient = gateway.read(Patient, id, source)

# Get lab results and process with AI
lab_results = gateway.search(
Observation,
{"patient": id, "category": "laboratory"},
source
)
insights = nlp_pipeline.process(patient, lab_results)

# Add AI summary to patient record
patient.extension = patient.extension or []
patient.extension.append({
"url": "http://healthchain.org/fhir/summary",
"valueString": insights.summary
})

# Update the patient record
gateway.update(patient, source)
return patient

# Automatically available at: GET /fhir/transform/Patient/123?source=epic
```
Expand Down
44 changes: 8 additions & 36 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ HealthChain provides three core tools for healthcare AI integration: **Gateway**

### HealthChainAPI Gateway 🔌

The HealthChainAPI provides a unified interface for connecting your AI models to multiple healthcare systems through a single API. Handle FHIR, CDS Hooks, and SOAP/CDA protocols with OAuth2 authentication and connection pooling.
The HealthChainAPI provides a unified interface for connecting your AI models to multiple healthcare systems through a single API. Handle FHIR, CDS Hooks, and SOAP/CDA protocols with OAuth2 authentication.

[(Full Documentation on Gateway)](./reference/gateway/gateway.md)

```python
from healthchain.gateway import HealthChainAPI, FHIRGateway
from fhir.resources.patient import Patient

# Create your healthcare application
app = HealthChainAPI(title="My Healthcare AI App")
Expand All @@ -25,11 +26,12 @@ fhir.add_source("medplum", "fhir://api.medplum.com/fhir/R4/?client_id=...")

# Add AI transformations to FHIR data
@fhir.transform(Patient)
async def enhance_patient(id: str, source: str = None) -> Patient:
async with fhir.modify(Patient, id, source) as patient:
# Your AI logic here
patient.active = True
return patient
def enhance_patient(id: str, source: str = None) -> Patient:
patient = fhir.read(Patient, id, source)
# Your AI logic here
patient.active = True
fhir.update(patient, source)
return patient

# Register and run
app.register_gateway(fhir)
Expand Down Expand Up @@ -154,10 +156,6 @@ The HealthChain Interoperability module provides tools for converting between di

[(Full Documentation on Interoperability Engine)](./reference/interop/interop.md)


**Choose your setup based on your needs:**

✅ **Default configs** - For basic testing and prototyping only:
```python
from healthchain.interop import create_interop, FormatType

Expand All @@ -175,32 +173,6 @@ fhir_resources = engine.to_fhir(cda_xml, src_format=FormatType.CDA)
cda_document = engine.from_fhir(fhir_resources, dest_format=FormatType.CDA)
```

> ⚠️ **Default configs are limited** - Only supports problems, medications, and notes. No allergies, custom mappings, or organization-specific templates.

🛠️ **Custom configs** - **Required for real-world use**:
```bash
# Create editable configuration templates
healthchain init-configs ./my_configs
```

```python
# Use your customized configs
engine = create_interop(config_dir="./my_configs")

# Now you can customize:
# • Add experimental features (allergies, procedures)
# • Modify terminology mappings (SNOMED, LOINC codes)
# • Customize templates for your organization's CDA format
# • Configure validation rules and environments
```

**When you need custom configs:**
- 🏥 **Production healthcare applications**
- 🔧 **Organization-specific CDA templates**
- 🧪 **Experimental features** (allergies, procedures)
- 🗺️ **Custom terminology mappings**
- 🛡️ **Specific validation requirements**


## Utilities ⚙️

Expand Down
Loading