Inspiration
An itemized hospital bill can run dozens of lines, and the part that decides what you owe is buried in codes, units, and adjustments. Most tools stop at a total and a scary number. I wanted to build the thing I wished existed when you are staring at one of those pages. A workbench that shows where a flag comes from, which exact lines raised it, and what to ask next. Every patient and bill in ClearBill is invented, so you can learn the reading skill without putting real health information anywhere.
What it does
ClearBill is a browser workbench for learning to read an itemized medical bill. It ships three fictional cases. The ER visit produces four review flags. Exact repeats, near repeats, a panel billed with its component, and imaging units over the selected reference. The outpatient imaging case flags a self-pay bill of $1,125 against a $650 written good faith estimate, a $475 difference. The routine follow-up is a negative control with four matching total checks and zero flags.
In the Audit view you click a finding and the bill lines that raised it outline, or click a line and its findings light up. You can make bounded edits to the fictional line items and watch the four integer-cent reconciliation checks. The Reference view shows a Medicare physician reference price with its work, practice expense, and malpractice inputs, plus a household guideline screener. The Worksheet prints a question checklist in English or Spanish. The Sensitivity lab compares a procedure across Houston, Manhattan, and Iowa, sweeps the inclusive $400 estimate screen and the 120-day window, and exports a digest-stamped brief. The AI Lab runs a deterministic four-stage reasoning trace with a what-if negotiation simulator, an appeal plan, and a draft dispute letter.
The app never sends anything in the background. There is no tracking, no sign-in, no analytics, and no external asset. It works offline after the first load.
How I built it
ClearBill is plain JavaScript ES modules, HTML, CSS, SVG, service workers, and Web Crypto with zero runtime dependencies and no build step. The Medicare math uses the CMS October 2026 RVU file and the 2026 GPCI file, multiplied by the non-QP factor $33.4009, computed in exact scaled integers with one round-half-up per unit. Localities are Houston 04412/18, Manhattan 13202/01, and Iowa 05102/00.
The audit engine is a set of small pure modules feeding one decision function. Repeats match biller, date, code, units, and modifiers, with a 5 percent or $25 near-repeat window. Four integer-cent checks reconcile billed, adjusted, plan paid, and patient amounts. Exports are CSV, a canonical JSON audit bundle, and an AES-256-GCM sealed summary whose key travels separately. The digest verifier replays the record and rejects mismatched bytes, rule versions, and digests.
Verification is part of the build. The Node suite has 1,303 tests covering independently calculated references, published unit limits, threshold boundaries, exact-cent reconciliation, hostile inputs, and both export formats. Three separate Chrome audits drive the real UI at desktop and phone sizes, including an offline reload, actual Letter PDF page counts in both languages, bookmark restore, and tamper rejection.
Challenges I ran into
The hard part was not adding numbers, it was not accusing anyone. A Medicare reference price is not what a hospital is allowed to charge, and a repeat candidate is not proof of a duplicate charge. I had to design every finding as a documentation note with its evidence attached, and make the reference comparison by itself never create a flag.
The second hard part was unit math. A line can have several units, and a repeat candidate can match on code and units while still being legitimate. I ended up separating daily unit limits from repeat candidates, then writing tests that pin both so a later change cannot quietly merge them.
The third was the bilingual print sheet. Fitting a full audit and a question checklist onto one Letter page in English and Spanish, with real page-count checks in the browser audit, took more layout passes than any other screen.
Accomplishments that I am proud of
- 1,303 Node tests pass locally, plus 22 browser checks, 18 sensitivity lab checks, and 16 AI lab checks.
- A finding and its bill lines are linked in both directions, so the evidence is one click away.
- The digest verifier is real replay, not a label. It rejects tampered bundles and mismatched rule versions.
- The whole app runs offline, in two languages, with no dependency and no network request.
- Every number on screen can be traced to a published source or a test.
What I learned
Citation-first design changes what you build. Once every flag has to carry its evidence, you stop writing vague warnings and start writing claims you can defend. I also learned that a good negative control is worth ten positive ones. The clean bill with zero flags caught more bugs than any of the dramatic cases.
What is next
Next I want to add more published source tables, a plain-language glossary for the codes, and a guided mode that walks a first-time reader from total to line item to question. I also want to make the printed checklist easier to hand to someone at a billing desk.
Development disclosure
ClearBill existed before this event. The audit engine, Medicare reference view, bilingual worksheet, sealed summary links, exports, offline service worker, sensitivity lab, and the original test and browser harnesses were built earlier. Built during the event window were the AI reasoning lab in src/ai-appeal-reasoning.js, its navigation view and panel in index.html, its styles in styles.css, tests/ai-appeal-reasoning.test.mjs, scripts/ai-lab-audit.mjs, the optional local sender scripts/llm-polish.mjs, the asset allowlist entry in scripts/serve.mjs, the service worker cache lineage through clearbill-2026q4-v7, docs/reasoning.png, and this documentation. A later pass in the same window restyled the lab and corrected modifier 91 repeat evidence, which changed the blood-collection code 36415 case and moved the ER high end to $163.00. The ruleset is clearbill-2026q4-v2.
AI disclosure
The app makes no model calls at runtime. All reasoning is local rules and integer math over invented data, and the optional endpoint adapter only builds a scrubbed request payload that the app never sends. I used AI coding assistants while building and reviewing the event changes, and I verified every change with the local test suites listed above.
Built With
- css3
- html5
- javascript
- node.js
- service-workers
- svg
- web-crypto