OpenSolaDosis
Every hospital has clinical calculators: dosing tools, unit converters, infusion rate sheets — small apps that do math a pharmacist could do by hand. Almost all of them are black boxes. They give you a number and don’t show how they got it.
The problem with black-box math
When a clinician calculates a dose, the work matters as much as the answer. Which formula? What values went in? Where did it round? Pharmacy boards require this. So does the FDA’s 2026 CDS guidance: Criterion 4, transparency, the ability for a healthcare professional to independently review the basis for the output. Showing your work is a regulatory requirement.
Most clinical calculators fail that test. The ones that pass are locked to specific substances, tied to vendor platforms, or both. Institutions end up choosing between transparency and flexibility, and nobody should have to make that choice when the math determines how much of something goes into a person.
What OpenSolaDosis does
It runs protocols.
A protocol is a declarative JSON file with inputs, expressions, gates, constraints, and outputs. The engine doesn’t know or care what substance it’s calculating for. Grape juice or gentamicin, the math is the same. Institutions author their own protocols, and the engine:
- validates them at build time,
- hashes them with SHA-256 for integrity, and
- interprets them at runtime with decimal arithmetic, so there’s no IEEE 754 floating point anywhere near the dosing math.
Every calculation produces a full transcript: the formula as written, every substituted value, every branch decision, and every rounding step. The output is ready to copy into the medical record. The clinician sees exactly how the number was derived and makes the clinical judgment. The tool leaves that to them.
The architecture bet
It’s a static SPA with no backend. No patient data touches a server, because there is no server. It’s stateless by design, which is meant to keep the tool outside HIPAA, 21 CFR Part 11, and EPCS scope. The architecture handles those concerns up front, so the compliance department doesn’t have to paper over them after the fact. An institution still has to make that call for itself.
Protocols are immutable once confirmed. Test vectors are required, and the build fails without them. The test suite runs on every push and every release. IEC 62304 is technically optional for non-device software, but we follow it voluntarily. The standard exists for a reason, and adopting it costs very little compared to wishing later that we had.
The demo protocols are fake on purpose
The repo ships with three demo protocols that calculate fictional beverage servings, plus one intake form. They’re deliberately fictional, with no real medications and no placeholder doses, because institutions must author, validate, and take responsibility for their own protocols. The engine is the infrastructure. The clinical knowledge lives in the protocol files, owned by the people who understand the medicine.
The stack
TypeScript in strict mode, Preact, Vite, Zod for schema validation, and Decimal.js for arithmetic. The expression parser is a hand-written recursive descent parser, so there’s no third-party eval library to trust. Intermediate values stay unrounded and only the final output is rounded. The protocol sets the rounding mode and increment for each output, because those are clinical choices. The source is about 6,000 lines, tests included, and the production bundle is 36 KB of gzipped JavaScript. Claude Code wrote most of the TypeScript, the tests, and the protocol files, and the design decisions are mine. All 38 commits carry its co-author trailer.
Where it stands
The engine, parser, UI, and build pipeline are feature-complete. It’s published on GitHub under AGPL v3, and the history runs from February to November 2026. I’m waiting on a friend to circle back for clinic-specific protocol adaptation, which is the part where it stops being a demo and becomes useful in a room with actual patients.
The regulatory guidance report might be useful on its own: Regulatory guidance: when a dose calculator is a medical device. There wasn’t a good single document that maps FDA clinical decision support criteria, IEC 62304 practices, and the records a calculation has to support onto the architecture of a stateless clinical calculator, so we wrote one. The November 2026 version is a rewrite from primary sources, including what our own red team found in the engine. It was drafted with AI assistance, and no outside lawyer or regulatory expert has reviewed it. It isn’t legal advice.