Append-only clinical notes with amendment and cosign (SP7)

Featurekamo-shared-library
Shipped
August 25, 2026 at 5:22 PM UTC
Author
Kamo
Commit
517bf3f

Identity is split from content from the first row. ClinicalNote is what other records point at — an order raised from the note, an amendment to it, a disclosure of it — while every revision is a separate immutable ClinicalNoteVersion. Retrofitting append-only onto a mutable note table is a migration nightmare AND a live malpractice exposure for as long as it takes, so the split exists now rather than when someone asks for an audit trail. Amendments and addenda are different things and the distinction is legal. An addendum appends and the note stands. An amendment corrects, and it creates a new version WITH THE ORIGINAL RETAINED AND STILL RENDERABLE — a record that cannot show what it used to say is not a corrected record, it is an altered one, and that is how a chart stops being defensible. §164.526 patient-requested amendments are a third state again: the patient disagrees, the clinician may decoder, and either way both the request and the outcome become part of the record. Append-only is enforced by a throwing @PreUpdate/@PreRemove, never by @Column(updatable = false). Hibernate SILENTLY OMITS a non-updatable column from the UPDATE, so the write appears to succeed and the value just does not change — the worst of both worlds. The database half is a REVOKE, because entity callbacks are bypassed by bulk JPQL and native SQL. Cosign is modelled because a note pending a supervisor's countersignature is not a finished record, and under incident-to rules the supervision is also what makes the visit billable — so isFinal() is a clinical AND a financial predicate. aiAssisted is on the version because it cannot be backfilled: once a note is signed, nothing distinguishes what an ambient scribe drafted from what a clinician typed, and AB 3030-style rules require the disclosure. HPI, ROS and exam stay as prose on purpose — forcing narrative into discrete fields produces worse notes and worse data. Structure earns its place in the assessment and plan, where each problem links to its orders and its diagnosis, which is what makes the note, the order and the claim fall out of one act of documentation. 1742 tests green.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing