fix(labs): keep a reading's conversion record unless its value actually changes

The single-reading edit cleared sourceValue and sourceUnit whenever the body
carried a value, and the web edit sheet always sends one, so a date or note
edit erased the "converted from" hint. It is now cleared only when the value
differs from the stored one. The sheet also opened a converted reading at its
stored precision (100.90191999999999); it now starts from the value as the lab
surfaces show it and leaves an untouched value out of the request, so the
stored full-precision number is not replaced by its rounded display.
This commit is contained in:
Marc-André Bombeck committed 2026-10-14 19:15:33 +02:00
1 parent 47a91d6922
commit cd1449e63e
6 files changed
+118 -9

No files matched your search

+1 -1
View File
@@ -6152,7 +6152,7 @@ model LabResult {
sourceReferenceText String? @map("source_reference_text")
/// @pending-consumer(#1095) v1.42 — the value as printed on the source
/// report, kept when a write converted it into the biomarker's canonical
/// unit. NULL when no conversion happened. A later edit of `value` clears it.
/// unit. NULL when no conversion happened. An edit that changes `value` clears it.
sourceValue Float? @map("source_value")
/// @pending-consumer(#1095) v1.42 — the unit the source report printed,
/// paired with `sourceValue`.