Built for Healthcare · Next.js 16 · TypeScript · OpenAI · Neon Postgres
SmartClaim AI
A web app for wound-care providers. A six-step checklist captures a wound's documentation, an AI model judges each of 46 criteria against Medicare's LCD L35041 for skin substitutes, and the report lists what passes and what fails, with the reason, before a claim is billed. Built with Next.js 16, Auth.js accounts, Neon Postgres and OpenAI structured output, with a rate limit on every route.
Checklist Form → Zod Validation → Model Verdict → Report View

Role
Full-Stack Developer & AI Engineer
Duration
6 weeks
Tech Stack
The Problem
Medicare pays for skin substitutes on chronic wounds only when the chart shows that specific conditions were met first: the wound lasted at least four weeks, it did not shrink by half under standard care, it is clean, circulation is adequate, and so on. These rules sit in a coverage policy (LCD L35041), and a claim whose notes miss one of them can be denied after the work is done.
The goal was a checkpoint before billing: let a provider enter the facts of a case in a structured form and get back, criterion by criterion, what meets the policy, what does not, and why.
My Approach
- One checklist. A six-step wizard (General Wound Information, Diabetic Foot Ulcers, Venous Stasis Ulcers, Other Wound Types, Smoking Status, Additional Notes) with 46 fields. The fields are defined once, and the form, the validation and the model request all derive from that single list. An earlier version kept three copies that had already drifted apart.
- Evaluation. A server route validates and size-limits the request, then asks the OpenAI Responses API for structured output: exactly one pass or fail verdict with a reason per field, checked against a Zod schema. Case data is passed to the model as data, with an instruction to ignore any instructions inside it, and the provider is told not to keep it.
- Report. The page shows the pass rate, the failed criteria first with their reasons, and a step-by-step view of the answers, in light and dark themes.
- Accounts. Auth.js with email verification, password reset, hashed single-use tokens, bcrypt passwords, and a rate limit on every route (sign-in, sign-up, forgot-password, contact, chat and evaluate).
- Data. SQL on Neon Postgres for accounts and limits; each evaluation is stored in Supabase.
- Chat assistant. A streamed assistant on the home page with fixed instructions, so it cannot be used as a general chatbot.
- Hardening. The first version asked the model API for a model named 'LLM', which does not exist, so every evaluation failed, and the form blamed a full free tier. That and the other defects found (unlimited routes, verification emails that did nothing, verification tokens kept in plain text, a last-step click that submitted the form twice, low-contrast text) were fixed and covered by tests.
Results & Impact
Recorded in the repository's work-done.md and README after the hardening pass: - 416 automated tests in 30 files, with 99.1% statement and 89.7% branch coverage. - A mutation check that put 90 defects back one at a time (no sign-in limit, plain-text tokens, unescaped email, a wrong password signing in, a weaker CSP and others); the tests failed for all 90. - npm audit with 0 vulnerabilities in production dependencies; the build passes with only placeholder settings. - A real-browser run of 66 checks on the production build against stand-ins for the services.
Re-run on 2026-11-14 in a scratch copy: 415 of the 416 tests pass (the 416th reads the .env.example file, which was not copied into the scratch copy). The app was also run locally the same day, signed in as a demo user, and a fictional case went through all six steps to a report of 42 of 46 criteria passed. That report came from a rule-based stand-in for the model, so its reasons are marked 'Sample result' and show the interface, not clinical output.
Not verified: any real call to OpenAI, Neon, Supabase, Resend or the AI Gateway; whether the model judges a chart correctly against LCD L35041, which is a clinical question; which commit the deployed site runs. No compliance assessment (HIPAA or otherwise) has been done.