Skip to content

Repository files navigation

Result-Triage Worklist (SMART on FHIR, Epic) — Demo

An operational triage layer for the EHR in-basket. It pulls a clinician's messages and results over FHIR, ranks each item by explainable operational signals, routes it to the right staff role, and logs every decision on a tamper-evident chain. It prioritizes and routes; it never diagnoses. Synthetic data, no PHI.

Positioning (the whole point): Epic already ships AI in-basket draft replies (MyChart ART). ARFA does the layer Epic does NOT: "Epic drafts the reply. ARFA tells you which of 60 messages to open first, ties each to the patient's pending abnormal result, routes it to the right role, and proves why." See PRD.md.

What it does (verified working)

  • Completes a real SMART App Launch against Epic's public sandbox: OAuth2 authorization-code flow, PKCE token exchange, clinician/user scopes, access token received, and authenticated FHIR read succeeded.
  • Pulls live Epic sandbox data for verified Epic test patients, ranks abnormal-result work items, and can write back a DocumentReference triage note when a human acknowledges an item.
  • Loads a fallback real, queryable clinic in-basket (6 work items, 3 patients) seeded on the public HAPI server; citations link to the live resources.
  • Deterministic, explainable ranking (NOT AI, NOT diagnostic): critical/abnormal result, symptom in message, medication-related, open condition, age in queue. Each item shows its reason codes and a priority (CRITICAL / HIGH / ROUTINE).
  • Route-to-role: critical result or symptom message → Physician; abnormal/refill → RN/Pharmacy; routine/scheduling → Front desk/MA.
  • Human-in-the-loop: nothing is actioned until a person clicks Acknowledge & route.
  • SHA-256 hash-chained audit (NIST-verified) with a tamper test.
  • Real SMART App Launch (OAuth2 + PKCE) against Epic's sandbox (fhir.epic.com), with clinician/user scopes and live token-authorized FHIR reads.

What's real vs synthetic

  • Real: the Epic SMART App Launch, PKCE token exchange, authenticated FHIR read, DocumentReference write-back path, ranking engine, and SHA-256 audit run live.
  • Synthetic: all patients and records are sandbox/test data only. No PHI. The fallback inbox is seeded on HAPI for a coherent, reliable offline demo.

Epic gate status

Passed on 2026-06-04. The registered Epic sandbox redirect URI is http://localhost:8000/callback, and the callback at app/callback/index.html exchanges the authorization code for an access token using PKCE. After return to the worklist, the app uses the token to pull live Epic sandbox resources. If no token is present or Epic returns an error, it falls back to the seeded HAPI inbox.

Files

app/
  index.html
  css/styles.css        # reused from prior-auth + triage additions
  js/app.js             # ranking engine + worklist UI + SHA-256 audit + SMART App Launch (PKCE)
  js/config.js          # Epic SMART endpoints + public client_id (not a secret)
  js/anime.min.js
  callback/index.html   # PKCE token exchange + live Epic read proof
  data/seeded.js        # fallback seeded in-basket (window.SEEDED), with live HAPI refs
  assets/arfa-mark-navy.png
fhir/seed_hapi_inbox.py  # re-seed the inbox on HAPI any time
PRD.md

Run it

cd app && python -m http.server 8000   # open http://localhost:8000/index.html

Re-seed the inbox: python fhir/seed_hapi_inbox.py (rewrites app/data/seeded.js).

Remaining (gated / next)

  • Chrome extension side panel that runs the same pull + push next to the EHR workflow.
  • Production path research: confidential client, private_key_jwt, customer security review, BAA, and Epic Showroom / customer-sponsored onboarding.
  • Optional: an LLM one-line "why this is urgent" summary via the key-safe Worker pattern (default off).

Sources

About

SMART-on-FHIR result-triage worklist tested against Epic's public sandbox (OAuth2 + PKCE), with explainable ranking, human-in-the-loop, and a SHA-256 audit chain. Synthetic data only.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages