fix(labs): store the catalog slug as a marker's analyte key

The matcher stored the registry entry's key, so LDL and HDL markers were
recorded as total-cholesterol. The key now names what the marker is (the
catalog slug, or a registry-only key for an analyte with no seed), and the
registry resolves ldl and hdl to the cholesterol entry for the conversion as
before. A key already written in the old form is rewritten by the same fill
step that brings a stale key in line with its name, the first time a reading
needs it. The OpenAPI descriptions say what the key is and that it follows
the marker's name and unit.
This commit is contained in:
Marc-André Bombeck committed 2026-10-14 19:18:49 +02:00
1 parent cd1449e63e
commit 07f09e1b61
11 files changed
+91 -33

No files matched your search

+1 -1
View File
@@ -30,7 +30,7 @@ export interface OcrReviewRow {
* Save when it can be (see `readingConversion`) and cannot be saved when not.
*/
markerUnit: string | null;
/** Which analyte the matched marker is (conversion registry key), or null. */
/** Which analyte the matched marker is (catalog slug or registry-only key), or null. */
markerAnalyteKey: string | null;
/** Non-null when the server flagged a likely duplicate of a live reading. */
duplicateOf: string | null;
+1 -1
View File
@@ -75,7 +75,7 @@ export interface BiomarkerDto {
panel: string | null;
/**
* Which analyte the marker is, for converting a reading in another unit
* (the unit-conversion registry's key), or null when it is none that is known.
* (the catalog slug, e.g. `ldl`, or a registry-only key such as `urea`), or null when it is none that is known.
*/
analyteKey: string | null;
hasContext: boolean;