NT
  • Home
  • Work
  • About
  • Skills
  • Experience
  • Achievements
  • Contact
zz
← All work

Case study · 03

ChartHaven

A patient app for requesting your own medical records and getting them back, from MyChart, an upload link, email or fax, without the server keeping them.

Role
Co-founder & IT Lead · side venture
Status
TestFlight beta
Read
2 min
Stack
SwiftUISwiftDataCryptoKitNode / ExpressPostgreSQLSupabaseFHIRAsteriskXcode CloudSemgrepGitHub Actions

24 h

longest a returned record is held before it's deleted

Jump toProblemApproachResultsNext

Problem

Getting your own records still means portals, release forms, faxes and waiting, and every service that collects them for you becomes one more place they're stored.

Approach

  1. 01It starts from the provider. The patient picks where the records are, then how they should come back: a MyChart sign-in, a one-time upload link, email, or fax.
  2. 02It routes records, it doesn't store them. Each return is matched to the patient by a unique identifier, encrypted on arrival, and held for at most 24 hours before it is deleted on pickup or expiry. The API sweeps expired records at start-up and then every hour, so the privacy policy is enforced in code.
  3. 03Fax without a fax vendor: a self-hosted gateway sits behind the backend, and a match key on the outgoing release form lets a faxed reply find its patient.
  4. 04On the phone, records are end-to-end encrypted with a Secure Enclave key (P-256 → ECDH/HKDF/AES-GCM). The sealing code was verified standalone, including rejection of a wrong key, before any on-device test.
  5. 05The backend holds accounts and auth only: bcrypt, TOTP MFA, row-level security on every table, a least-privilege database role and an audit log.
  6. 06A security pipeline on every change: pre-commit secret scanning, Semgrep SAST, dependency audits, a coverage gate, a weekly DAST run (ZAP, Nuclei and authorization probes against a throwaway database), Dependabot, and an iOS build check in CI. Every job runs on self-hosted runners on my own Mac.
  7. 07An earlier prototype answered questions from the patient's records with a self-hosted model. We retired it to focus on getting records to patients, but the evaluation work behind it shaped how I test models (below).
It routes records, it doesn't store them.

Results

Fact-extraction F1: the synthetic test flattered the model
  • Fine-tuned, synthetic test set

    0.988
  • Same model, real de-identified records

    0.13
  • Generator rebuilt from real vocabulary

    0.62
Fact-extraction F1: the synthetic test flattered the model
Fine-tuned, synthetic test set0.988
Same model, real de-identified records0.13
Generator rebuilt from real vocabulary0.62
  • On TestFlight, with every merge to main built and shipped by Xcode Cloud.
  • A waitlist-gated proof of concept for about 100 users, with a records-first website and privacy policy.
  • Lesson from the retired prototype: a fine-tuned extractor scored F1 0.988 on synthetic data but 0.13 on a real, de-identified gold set. Rebuilding the generator from real vocabulary reached 0.62, and a 14B base model with no fine-tuning beat the fine-tuned 7B on 4 of 4 checks, so the adapter was retired.
  • Also from that prototype: retrieval recall@5 rose from 0.929 to 1.000 with bge-large, and truncating context was dropped after it lost facts and induced a made-up blood pressure.
  • An uncached key store was re-running the full decrypt chain on every render. An in-memory cache removed the lag app-wide.

What I'd do next

  • →Put the fax line live and finish Epic's production review for MyChart.
  • →Invite the first testers from the waitlist.

A side venture I run with a co-founder, in a TestFlight beta.

← Previous

Warehouse migration MCP tool

Next →

AI hospital routing