Open-source EHR write-back integration framework — closes the loop from analytics to clinical workflow via FHIR
Project description
ehr-writeback
Open-source EHR write-back integration framework. Closes the loop from healthcare analytics back to clinical workflow via FHIR.
What it does
Analytics platforms (Databricks, Spark, etc.) produce clinical insights — sepsis risk scores, readmission predictions, quality measures. This framework writes those results back into EHR systems (Epic, Cerner/Oracle Health, any FHIR R4 server) so clinicians see them in their workflow, not in a separate dashboard.
Architecture
Hexagonal (ports-and-adapters) design with two deployment targets:
- Databricks-native — Delta Live Tables, Lakeflow orchestration, Delta for idempotency
- Self-hosted — for orgs not on Databricks or needing fully on-prem
┌─────────────────────────────────────────────┐
│ Core Domain │
│ models · ports · business rules │
├──────────────┬──────────────────────────────┤
│ Adapters │ Infrastructure │
│ ├─ Epic │ ├─ IdempotencyStore (Delta) │
│ ├─ Cerner │ ├─ DeadLetterHandler │
│ └─ Generic │ └─ DeltaStore │
│ FHIR R4 │ │
└──────────────┴──────────────────────────────┘
Supported EHR Systems
| EHR | Status | Notes |
|---|---|---|
| Epic | In progress | FHIR R4 + Flowsheet API |
| Cerner/Oracle Health | In progress | FHIR R4 (Millennium) |
| Generic FHIR R4 | In progress | Any compliant server |
Quick Start
Install from PyPI:
pip install ehr-writeback
uv sync # install dependencies
uv run pytest # run unit tests
To publish a release, create a GitHub release for a v* tag whose version matches pyproject.toml. The release workflow builds the wheel and source distribution, publishes through PyPI trusted publishing, and verifies pip install ehr-writeback==<version> in a clean environment.
Run the sepsis risk score example
Generates synthetic patients, scores them for sepsis risk (SIRS + qSOFA), and writes the results to a public FHIR R4 test server:
uv run python examples/sepsis_risk_writeback.py
Output:
[1/4] Generating synthetic patient cohort...
[2/4] Scoring patients for sepsis risk...
🟢 Barbara Harris: LOW
🟡 Daniel Moore: MODERATE
🟠 Charles Harris: HIGH
🔴 Mary Thompson: CRITICAL
[3/4] Creating Patient resources on FHIR server...
[4/4] Writing sepsis scores to FHIR server...
Results:
Succeeded: 20
Success rate: 100%
With Databricks support
uv sync --extra databricks
Deploy to Databricks
pip install databricks-cli
databricks bundle deploy -t dev
Project Structure
src/ehr_writeback/
├── core/ # Domain models and port interfaces
├── adapters/ # EHR-specific implementations
│ ├── epic/
│ ├── cerner/
│ └── generic/
├── infrastructure/ # Idempotency, dead-letter, storage
└── pipelines/ # DLT pipeline definitions
License
Apache 2.0 — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ehr_writeback-0.1.0a1.tar.gz.
File metadata
- Download URL: ehr_writeback-0.1.0a1.tar.gz
- Upload date:
- Size: 110.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9be1670b3e29132e8080575f19814ccc0740e7d428dc2f905f27d6cbb38e3ecd
|
|
| MD5 |
a3934ddf1bbbf9073a141326591ad025
|
|
| BLAKE2b-256 |
e3848d6f806cf4d081ba9e4b08bf43442391d9a8ab9655cf1125c3a3e2966ec5
|
Provenance
The following attestation bundles were made for ehr_writeback-0.1.0a1.tar.gz:
Publisher:
release-publish.yml on slusset/databricks-ehr-integration-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ehr_writeback-0.1.0a1.tar.gz -
Subject digest:
9be1670b3e29132e8080575f19814ccc0740e7d428dc2f905f27d6cbb38e3ecd - Sigstore transparency entry: 1152996164
- Sigstore integration time:
-
Permalink:
slusset/databricks-ehr-integration-core@fbd9be2bf96603a0b5a57c342f4d1b5d0490526b -
Branch / Tag:
refs/tags/v0.1.0a1 - Owner: https://github.com/slusset
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-publish.yml@fbd9be2bf96603a0b5a57c342f4d1b5d0490526b -
Trigger Event:
push
-
Statement type:
File details
Details for the file ehr_writeback-0.1.0a1-py3-none-any.whl.
File metadata
- Download URL: ehr_writeback-0.1.0a1-py3-none-any.whl
- Upload date:
- Size: 28.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dec8445cca756347955d5a1bcadd2d442ae13cd96fd45516352e6e74fad3b1a9
|
|
| MD5 |
3b0746829d89cb59a76c62bcb6dade1f
|
|
| BLAKE2b-256 |
a814423d1bea3bdf6c14f82f4ba27c6a00498778660e6250f939d18e053341db
|
Provenance
The following attestation bundles were made for ehr_writeback-0.1.0a1-py3-none-any.whl:
Publisher:
release-publish.yml on slusset/databricks-ehr-integration-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ehr_writeback-0.1.0a1-py3-none-any.whl -
Subject digest:
dec8445cca756347955d5a1bcadd2d442ae13cd96fd45516352e6e74fad3b1a9 - Sigstore transparency entry: 1152996215
- Sigstore integration time:
-
Permalink:
slusset/databricks-ehr-integration-core@fbd9be2bf96603a0b5a57c342f4d1b5d0490526b -
Branch / Tag:
refs/tags/v0.1.0a1 - Owner: https://github.com/slusset
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-publish.yml@fbd9be2bf96603a0b5a57c342f4d1b5d0490526b -
Trigger Event:
push
-
Statement type: