コンテンツにスキップ
#0864
Sqlite

Amend the record, keep the audit, drop the old value

A patient exercises their right to amend. The old diagnosis line must go. The fact that a change happened must stay for six years. Most stores make you choose.

In hoody-sqlite the choice is a query parameter. The clinical value is written with PUT /kv/{key}?db=chart.db&history=false: no prior versions retained, so the amended text is the only text that exists. The ledger key beside it, chart:4729:amendments, is written with the default history=true: timestamp, prior value, new value, request token, every time.

When the compliance officer runs GET /kv/diff?from=…&to=… across the chart, the clinical keys come back under gap_keys with has_gaps: true. The gap isn't a defect. It's the documented shape of a record that keeps its audit and loses its ghosts.

Amend the record, keep the audit, drop the old value.