Inspiration

Discharge instructions are often dense and time-sensitive. Asking “Do you understand?” does not reveal what a patient or caregiver missed, while unconstrained AI summaries can omit or alter important details. We wanted the clarity of AI without asking users to trust unsupported medical output.

What it does

CareLoop turns fictional or manually de-identified discharge instructions into five source-linked sections: medicines, follow-ups, self-care, restrictions, and warning signs. It then uses teach-back, asking the user to explain critical actions in their own words. Missing or conflicting details become questions for the care team instead of invented answers.

Try the public no-sign-in demo or inspect the reproducible evidence page.

How we built it

The interface uses Next.js 16, React 19, TypeScript, Tailwind CSS, Zod, and PDF.js on OpenAI Sites, Vinext, and Cloudflare Workers. PDFs are parsed in the browser and users must review and confirm text is fictional or de-identified before analysis.

Gemini 3.6 Flash is integrated as an untrusted structured extractor. A deterministic safety layer rejects unknown citations, non-matching excerpts, swapped number-unit pairings, invented clinical terms, and duplicate actions. Teach-back model prose is discarded; CareLoop generates visible feedback from verified source text. Exact-source mode keeps the full product usable without generative rewriting. The current public deployment uses that tested exact-source mode because no hosted Gemini key is configured.

Key features

  • Real text-PDF upload and in-browser extraction
  • Manual privacy review before analysis
  • Five-section source-linked action plan
  • Clarification state instead of invented details
  • Teach-back practice that detects incorrect numbers
  • Expandable source evidence, copy, and print output
  • Public evidence page covering 12 fictional documents and 48 hand-labelled actions
  • Public, account-free demo with a one-click verified sample

Validation

The verified baseline includes 20 Vitest safety/API tests and 20 Playwright checks across desktop Chromium and a Pixel 7 profile. The exact-source baseline correctly categorizes 48/48 expected actions, covers 2/2 clarification cases, and preserves exact source wording. These results demonstrate engineering behavior on fictional documents, not clinical effectiveness.

How we used Codex

Codex supported the project from scope to production: implementation, source validation, PDF workflow development, fixture design, desktop/mobile testing, submission artifacts, deployment hardening, public access, and production PDF-path validation.

What's next

Next comes supervised formative testing with adult patients, caregivers, and clinicians. CareLoop is an adult educational prototype—not a diagnostic tool, medical device, or replacement for the original instructions.

Built With

Share this project:

Updates