Skip to content
Open
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
16 changes: 16 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.git
.idea
.pytest_cache
.ruff_cache
__pycache__
*.pyc
*.pyo
*.pyd
.env
.env.*
tests/
docs/
notebooks/
output/
*.md
!README.md
48 changes: 48 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# HealthChain application Dockerfile
#
# Usage:
# Build: docker build -t my-healthcare-app .
# Run: docker run -p 8000:8000 --env-file .env my-healthcare-app
#
# Required environment variables (set in .env or pass via -e):
# APP_MODULE Python module path to your app, e.g. "myapp:app" (default: "app:app")
#
# FHIR source credentials (if connecting to Epic/Cerner):
# FHIR_BASE_URL, CLIENT_ID, CLIENT_SECRET or CLIENT_SECRET_PATH
#
# See docs: https://dotimplement.github.io/HealthChain/reference/gateway/gateway/

FROM python:3.11-slim

# Keeps Python from buffering stdout/stderr
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
APP_MODULE=app:app \
PORT=8000

WORKDIR /app

# Install system dependencies needed by lxml and spaCy
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
g++ \
&& rm -rf /var/lib/apt/lists/*

# Install healthchain from PyPI
RUN pip install --no-cache-dir healthchain

# Install any additional dependencies your application needs
# (copy requirements first to leverage Docker layer caching)
COPY requirements.txt* ./
RUN if [ -f requirements.txt ]; then pip install --no-cache-dir -r requirements.txt; fi

# Copy application code
COPY . .

# Run as non-root user
RUN useradd -m appuser && chown -R appuser /app
USER appuser

EXPOSE $PORT

CMD uvicorn $APP_MODULE --host 0.0.0.0 --port $PORT
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,25 @@

<div align="center">

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

</div>

## Installation

```bash
pip install healthchain

# Scaffold a new project
healthchain new my-app
cd my-app

# Run locally
healthchain serve
```

See the [CLI reference](https://dotimplement.github.io/HealthChain/cli/) for all commands.

## Core Features

HealthChain is the **quickest way for AI/ML engineers to integrate their models with real healthcare systems**.
Expand Down Expand Up @@ -232,7 +241,7 @@ client.save_results("./output/")
- [ ] πŸ” Data provenance and observability
- [ ] πŸ”’ Production security and compliance (Authentication, audit logging, HIPAA)
- [ ] πŸ”„ HL7v2 parsing, FHIR profile conversion and OMOP mapping support
- [ ] πŸš€ Enhanced deployment support (Docker, Kubernetes, telemetry)
- [ ] πŸš€ Kubernetes and telemetry support
- [ ] πŸ“Š Model performance monitoring with MLFlow integration
- [ ] πŸ€– MCP server integration

Expand Down
94 changes: 94 additions & 0 deletions docs/cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# CLI Reference

HealthChain ships with a CLI to help you scaffold, run, and customize projects.

```bash
healthchain --help
```

---

## `healthchain new`

Scaffold a new project directory with everything you need to get started.

```bash
healthchain new my-app
```

Creates:

```
my-app/
β”œβ”€β”€ app.py # your application entry point
β”œβ”€β”€ .env.example # FHIR credential template β€” copy to .env and fill in
β”œβ”€β”€ requirements.txt # add extra dependencies here
β”œβ”€β”€ Dockerfile
└── .dockerignore
```

---

## `healthchain serve`

Start your app locally with uvicorn.

```bash
healthchain serve # defaults to app:app on port 8000
healthchain serve app:app
healthchain serve app:app --port 8080
healthchain serve app:app --host 127.0.0.1 --port 8080
```

The `app_module` argument is the Python import path to your FastAPI app instance β€” `<module>:<variable>`. If your app is defined as `app = HealthChainAPI()` in `app.py`, the default `app:app` works as-is.

To run in Docker instead:

```bash
docker build -t my-app .
docker run -p 8000:8000 --env-file .env my-app
```

---

## `healthchain eject-templates`

Copy the built-in interop templates into your project so you can customize them.

```bash
healthchain eject-templates ./my_configs
```

Only needed if you're using the [InteropEngine](reference/interop/interop.md) and want to customize FHIR↔CDA conversion beyond the defaults. After ejecting:

```python
from healthchain.interop import create_interop

engine = create_interop(config_dir="./my_configs")
```

See [Interoperability](reference/interop/interop.md) for details.

---

## Typical workflow

```bash
# 1. Scaffold a new project
healthchain new my-cds-service
cd my-cds-service

# 2. Build your app in app.py
# See https://dotimplement.github.io/HealthChain/cookbook/ for examples

# 3. Set credentials
cp .env.example .env
# edit .env with your FHIR_BASE_URL, CLIENT_ID, CLIENT_SECRET

# 4. Run locally
healthchain serve

# 5. Ship it
docker build -t my-cds-service .
docker run -p 8000:8000 --env-file .env my-cds-service
```
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ HealthChain is an open-source Python toolkit that streamlines productionizing he

## Getting Started with Healthcare AI

HealthChain provides the missing middleware layer between healthcare systems and modern AI/ML development. Whether you're building clinical decision support tools, processing medical documents, or creating multi-system integrations, these docs will guide you through:
HealthChain is production-ready healthcare AI infrastructure: built-in FHIR support, real-time EHR connectivity, and deployment tooling for healthcare AI/ML systems. Skip months of custom integration work. Whether you're building clinical decision support tools, processing medical documents, or creating multi-system integrations, these docs will guide you through:

- **πŸ”§ Core concepts** - Understand FHIR resources, pipelines, and gateway patterns
- **πŸ“š Real examples** - Step-by-step tutorials for common healthcare AI use cases
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/interop/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ engine = create_interop(config_dir="/path/to/custom/configs")
To create editable configuration templates:

```bash
# Create customizable config templates
healthchain init-configs ./my_configs
# Eject built-in templates for customization
healthchain eject-templates ./my_configs

# Then use them in your code
engine = create_interop(config_dir="./my_configs")
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/interop/engine.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ engine = create_interop(validation_level="warn", environment="production")


> **πŸ’‘ Tip:**
> To create editable configuration templates, run:
> To eject the built-in templates for customization, run:
>
> ```bash
> healthchain init-configs ./my_configs
> healthchain eject-templates ./my_configs
> ```
> This will create a `my_configs` directory with editable default configuration templates.

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/interop/experimental.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This page tracks templates that are under development or have known issues. Use

1. Copy experimental files to your custom config:
```bash
# After running: healthchain init-configs my_configs
# After running: healthchain eject-templates my_configs
cp dev-templates/allergies/allergies.yaml my_configs/interop/cda/sections/
cp dev-templates/allergies/allergy_*.liquid my_configs/templates/cda_fhir/
cp dev-templates/allergies/allergy_*.liquid my_configs/templates/fhir_cda/
Expand Down
6 changes: 3 additions & 3 deletions docs/reference/interop/interop.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ cda_document = engine.from_fhir(fhir_resources, dest_format="cda")
```
### Custom Configs

The default templates that come with the package are limited to problems, medications, and notes and are meant for basic testing and prototyping. Use the `healthchain init-configs` command to create editable configuration templates:
The default templates that come with the package are limited to problems, medications, and notes and are meant for basic testing and prototyping. Use the `healthchain eject-templates` command to create editable configuration templates:

```bash
# Create editable configuration templates
healthchain init-configs ./my_configs
# Eject built-in templates for customization
healthchain eject-templates ./my_configs
```

Then use the `config_dir` parameter to specify the path to your custom configs:
Expand Down
Loading