Case 01 · 2026 · Deployed
MediVault
A patient-owned health record vault with clinical AI, emergency access and tamper-evident consent.
01 / The brief
A patient-owned health record with clinical AI, emergency access and tamper-evident consent.
Why it existed
Records are scattered across paper files, hospital portals and phone photos. A clinician needs a fast, consent-scoped read during an emergency, not after it.
What shipped
Emergency QR access under 500ms, dual-provider AI fallback under 2s, and SHA-256 document hashes notarised on-chain. The break-glass pass is cached to work without a cellular connection.
02 / Context
The constraint came first.
Medical history is usually scattered across paper files, hospital portals and phone photos. MediVault gives a patient one portable record and gives a clinician a fast, consent-scoped way to read it in an emergency.
- Clinical data had to stay consent-scoped across object storage, Postgres and an on-chain notary.
- AI extraction could not become a single point of failure.
- Emergency access had to be fast without exposing the full record.
03 / What I owned
My hands were on these.
- System architecture across Next.js, Express, PostgreSQL, MinIO and FastAPI
- Dual-provider AI pipeline with explicit fallback and audit logging
- Break-glass QR pass and the consent-scoped audit event model
- Polygon Amoy notarisation for document hashes and consent grants
04 / Decisions
Four choices that mattered.
- Dual-provider AI with explicit fallbackGemini 3.1 Flash Lite handles primary extraction; NVIDIA NIM Llama 3.2 11B Vision is the fallback. The pipeline degrades instead of failing when one provider does.
- Break-glass access with a narrow payloadThe emergency QR pass exposes blood group, allergies and vitals only. Every read writes an audit event, so speed does not remove accountability.
- Hash on-chain, store off-chainPolygon Amoy carries SHA-256 document hashes and consent grants. The record itself never leaves encrypted object storage.
- An emergency page that survives the networkThe PWA caches the break-glass pass so it remains reachable in a disaster zone with no cellular connection.
05 / Architecture
How the pieces fit.
06 / Evidence
What can be measured.
Metrics state their source on the receipts ledger.
07 / Reflection
What broke, and what I would change.
I would move document ingestion onto a durable queue with idempotent workers. The request-bound pipeline is fine for demos and small uploads, but it is the first thing that breaks under batch use. I would also add contract tests around consent grants before touching the policy layer again.
08 / Stack and fit