Skip to main content

Open-source EHR write-back integration framework — closes the loop from analytics to clinical workflow via FHIR

Project description

ehr-writeback

PyPI version

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ehr_writeback-0.1.0a1.tar.gz (110.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ehr_writeback-0.1.0a1-py3-none-any.whl (28.4 kB view details)

Uploaded Python 3

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

Hashes for ehr_writeback-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 9be1670b3e29132e8080575f19814ccc0740e7d428dc2f905f27d6cbb38e3ecd
MD5 a3934ddf1bbbf9073a141326591ad025
BLAKE2b-256 e3848d6f806cf4d081ba9e4b08bf43442391d9a8ab9655cf1125c3a3e2966ec5

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ehr_writeback-0.1.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for ehr_writeback-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 dec8445cca756347955d5a1bcadd2d442ae13cd96fd45516352e6e74fad3b1a9
MD5 3b0746829d89cb59a76c62bcb6dade1f
BLAKE2b-256 a814423d1bea3bdf6c14f82f4ba27c6a00498778660e6250f939d18e053341db

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page