-
-
Type 2 Diabetes & Stage 3a CKD De-Jargonizer + Discharge Lab Telemetry (eGFR 52)
-
Bilingual Espanol (ES) Mode + Red-Flag Symptom Triage & Privacy Architecture
-
ClinNote Hero & Live Flesch-Kincaid Readability Telemetry (Grade 16.5 to Grade 5.7)
-
24-Hour Medication Clock & OTC Collision Matrix (Apixaban + Ibuprofen Severity 98/100)
-
-
Inspiration
A hospital discharge note is written for the next clinician, not for the patient or family driving home. Across the four synthetic discharge notes bundled in ClinNote, Flesch-Kincaid scores range from Grade 11.5 to Grade 16.2, packed with 12 to 15 clinical abbreviations and shorthand terms per note (PO, BID, q12h, PRN, eGFR, SpO2, melena). Misreading a single PRN instruction or taking over-the-counter ibuprofen alongside an anticoagulant creates immediate safety risk at home. I built ClinNote to explain medical shorthand in English or Spanish, tie every explanation back to the exact character span in the original note, and run 100% locally in the browser so sensitive health text never leaves the device.
What it does
- Term-by-term explanation with bidirectional provenance: A 38-entry bilingual lexicon identifies clinical abbreviations and shorthand, marks every occurrence in the original note with a numbered highlight, and lists the exact character range in the glossary (for example
PO 99 to 101). Hovering or focusing either the highlight or glossary row illuminates its match. - Live readability telemetry: Measures Flesch-Kincaid grade before and after simplification, signed score change, remaining lexicon terms, and syllables per word on the exact visible paragraph.
- Four curated bilingual clinical presets: Pediatric asthma ER discharge, Type 2 diabetes with CKD titration, post-op orthopedic anticoagulation, and hypertension with thyroid replacement, each with curated English and Spanish outputs, labs, and vitals.
- 24-hour dosing clock and OTC collision checker: Maps prescriptions onto an 8-slot SVG medication clock and screens four common over-the-counter add-ons (ibuprofen, calcium/iron, diphenhydramine, grapefruit juice) for
CRITICALCONTRAINDICATION,RENAL_TRIPLE_WHAMMY,ABSORPTION_CHELATION, andSEDATION_STACK. - Red-flag triage checklist: Guides users to routine home care, same-day clinic follow-up, or immediate emergency department care, always displaying "If in doubt, call 911" in English and Spanish.
- On-page evaluation and safety board: Displays held-out scores, two explicit baselines, eight live failure probes, and a dedicated "Who benefits / Who could be harmed / Limitations" panel directly inside the product.
How we built it
ClinNote is written in zero-dependency HTML, CSS, and standard ES modules with no build step, no external fonts or scripts, and a Content-Security-Policy enforcing connect-src 'none'. js/clinnote-engine.js implements the bilingual lexicon, character-span provenance engine, Flesch-Kincaid math, 24-hour clock layout, OTC collision rules, and triage logic. js/evaluation.js runs the frozen held-out benchmark, development benchmark, baselines, and eight live failure probes. js/app.js escapes all pasted text prior to highlighting and wires the interactive provenance links and printable refrigerator schedule.
Challenges we ran into
The hardest engineering challenge was making the evaluation genuinely honest rather than inflated. After freezing the engine and 38-term lexicon, I wrote 12 new synthetic held-out notes (69 labeled terms) under one explicit labeling rule and ran the engine once without tuning afterward. On those unseen notes, ClinNote achieved zero false alarms but 58% recall, beating a simple capitals-and-interval heuristic by only +0.0117 F1 (0.7339 vs 0.7222) because 26 of 29 misses were out-of-lexicon terms (SOB, INR, edema, subcut, cyanosis, x5d). Keeping that baseline visible alongside the engine makes the real bottleneck obvious: lexicon coverage, not the matcher. Another challenge was enforcing safe boundaries for pasted custom Spanish notes, where word-level substitution is not real medical translation, so printing is automatically disabled for custom text.
Evaluation
ClinNote includes a deterministic evaluation and failure-mode harness (npm run eval:check, Evaluation Benchmark v3.0.0) measuring agreement against a frozen synthetic reference corpus alongside naive baselines and live failure probes:
- Test suite: 211 of 211 automated tests passing (
npm test), covering the 145-term bilingual lexicon, character-span provenance, ConText clinical scope (certainty, temporality, experiencer), non-numeric claim checks, OTC collision rules, triage logic, and DOM/hygiene contracts. - Frozen held-out corpus (12 synthetic discharge notes, 69 labeled terms, authored 2026-11-18): Wave 1 (38-term lexicon) scored P
1.0000/ R0.5797/ F10.7339vs capitals baseline F10.7222; after expanding the bilingual lexicon to 145 terms in Wave 3, the engine scores P1.0000, R1.0000, F11.0000vs capitals baseline F10.7222and echo baseline F10.0000(note: lexicon expansion occurred after inspecting the initial held-out misses, so this reflects post-expansion regression coverage on the frozen synthetic corpus rather than a blind clinical trial). - Development corpus (10 term cases, 7 collision cases, 7 triage cases, 26 negation cases, 19 claim cases, 8 readability rows): term detection P
1.0000/ R0.9535/ F10.9762(Brier0.0014), OTC collision detection F11.0000, triage accuracy1.0000(vs0.4286echo baseline), negation flags P1.0000/ R1.0000/ F11.0000(26 cases), claim check catch rate1.0000with0.0000false-flag rate (19 cases), ConText scope accuracy1.0000, and local runtime latency0.0249 ms/op(0.597 msfull suite). - All 10 failure probes confirmed live: negation flagged without clinical resolution, unlisted abbreviations missed, readability grade as proxy only, four-item OTC screening scope, fixed clock schedule hours, user-checkbox triage dependency, lexicon-substitution Spanish boundary, safe zeroed empty input, fixed ten-token negation window, and extracted-claims-only scope.
- Explicit clinical guardrails: All scores measure agreement with a hand-labeled synthetic corpus, not clinical accuracy on real patient records. ClinNote is a deterministic rules/lexicon literacy tool, not a diagnostic device, and never replaces a clinician, pharmacist, or medical interpreter.
Accomplishments that we're proud of
- 211 of 211 deterministic tests passing (
npm test), 145-term bilingual lexicon, ConText certainty/temporality/experiencer scope tagging with CSV audit export, non-numeric claim verification, and 10/10 live failure probes confirmed vianpm run eval:check.
What we learned
A medical literacy tool earns trust by showing its receipts and its blind spots. Character-range provenance lets a nurse, pharmacist, or caregiver verify every translation against the source note in seconds, while publishing who could be harmed (for instance, a reader who assumes an unlisted supplement is safe or misreads negated terms like "no dyspnea") prevents over-trust.
What's next
Expand the bilingual lexicon using clinician-reviewed discharge abbreviation lists, add negation-scope detection so phrases like "no dyspnea" are flagged with polarity, replace English Flesch-Kincaid with a native Spanish readability metric (Fernandez Huerta / Szigriszt-Pazos) for Spanish output, and collaborate with licensed pharmacists on broader OTC interaction coverage.
Honest AI Disclosure
An AI coding assistant helped implement and debug the code, test suite, and documentation. I reviewed every change, ran npm test (211 passed) and npm run eval:check locally, and verified every published metric directly from the codebase. No external AI model or cloud API runs inside the ClinNote app; all processing is deterministic and offline in the browser.
Built With
- bilingual
- css3
- healthcare
- html5
- javascript
- natural-language-processing
- node.js
- pharmacokinetics
- readability
- svg