mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 21:10:59 +00:00
feat(timeline): serve lab markers as value lines
The timeline showed a lab report as an event on the axis, but the lines under the lanes could only be measurements. A lab marker can now be named in `values` as `lab:<biomarkerId>`, beside the measurement types and `MOOD`, so one choice, one request and one stored list carry every line. `GET /api/timeline` answers with `labSeries`, one entry per named marker with its readings in the window as single points (lab values come a few a year, so they are never averaged into buckets), each dated by the record's local day, judged against its own window and linked to the report it was read from when the caller may see documents. `availableLabs` lists every marker the record has a numeric reading for, so a client offers only those. A reading stored in another unit than its marker's is converted through the unit-conversion registry where the pair is known, and otherwise left out and counted in `excluded`, never drawn on a scale it is not in. A marker id that is not in the record yields no line instead of a 422, so a stored choice survives a deleted marker; ids are capped at 24 a request. Refs #1299
This commit is contained in:
1 parent
b1fe1f0597
commit
42b2c72e28
13 files changed
+1336
-36
No files matched your search
@@ -69,6 +69,7 @@ export const GET = apiHandler(async (request: Request) => {
|
||||
lanes: timeline.lanes.length,
|
||||
items: timeline.lanes.reduce((n, l) => n + l.items.length, 0),
|
||||
series: timeline.series.length,
|
||||
labSeries: timeline.labSeries.length,
|
||||
notable: timeline.notable.length,
|
||||
},
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user