feat(labs): show the labs list under server-resolved categories

GET /api/labs/overview now answers categories and grouped next to the
markers. A marker's category is its panel: a catalog panel in any
shipped language folds to one key, any other panel becomes the
person's own category under an opaque hash key, and a marker without
a panel falls back to the catalog panel of its name. ALIAS_PANEL
places the ten analytes that have names but no seed. Each category
carries its label in the caller's language, its members, counts per
range status and one combined status (above wins over below; no
alarm tone). grouped is true only when grouping adds something.

The list renders this as given: with groupBy set to category it shows
a disclosure header per category in both views, the person's sort
applies inside each category, and groupsOpen decides which start open.
A category opened or closed by hand stays so in this browser until the
choice changes. Settings > Arrangement > Labs gets both choices. The
overview query key carries the locale, since the labels are localised.

Refs #1349
This commit is contained in:
Marc-André Bombeck committed 2026-11-06 17:49:38 +01:00
1 parent e2170115c7
commit 92638ec089
31 files changed
+2223 -348

No files matched your search

+75 -1
View File
@@ -17183,7 +17183,8 @@ paths:
summary: Per-marker overview of the caller's lab history
description: "One entry per biomarker over every live lab result, newest reading first: the newest reading, the reading
count and a short trend. Unlike `GET /api/labs` it is not paged, so a marker measured only long ago is never cut
off by a page size."
off by a page size. `categories` and `grouped` carry the list's categories, resolved server-side; their labels
follow the caller's locale (the language cookie, else the caller's stored language, else `Accept-Language`)."
parameters: []
responses:
"200":
@@ -76635,8 +76636,21 @@ components:
type: array
items:
$ref: "#/components/schemas/LabOverviewMarker"
categories:
type: array
items:
$ref: "#/components/schemas/LabOverviewCategory"
description: "The list's categories in display order: catalog panels in catalog order, then the person's own panels by
label, then `other`."
grouped:
type: boolean
description: "Whether grouping adds anything: true when there are two categories or more and at least one is not
`other`. A client that shows categories (the `groupBy` list preference) shows a flat list while this is
false."
required:
- markers
- categories
- grouped
additionalProperties: false
LabOverviewMarker:
type: object
@@ -76665,6 +76679,66 @@ components:
`analyte:<lower-cased name>` for a legacy unlinked one. `count` is every live reading of the marker. `trend`
holds the values of its newest readings (at most 50), oldest first, null for a qualitative reading. `latest` is
the newest reading, serialised exactly like a `GET /api/labs` row.
LabOverviewCategory:
type: object
properties:
key:
type: string
label:
type: string
markerKeys:
type: array
items:
type: string
counts:
$ref: "#/components/schemas/LabOverviewCategoryCounts"
status:
type: string
enum:
- in-range
- below
- above
- unknown
required:
- key
- label
- markerKeys
- counts
- status
additionalProperties: false
description: "One category of the labs list, resolved by the server. `key` is opaque: a catalog panel key,
`custom:<hash>` for the person's own panel, or `other`; it carries no user text and is stable, so a client may
key collapse state on it. `label` is rendered as given (a catalog panel in the caller's locale, the person's own
spelling, or the localised \"Other\"). `markerKeys` names the `markers[].key` values in the category. `status`
combines the members' newest readings: `above` when any is above its range, else `below` when any is below, else
`in-range` when any was assessed, else `unknown`. A client renders these values and never rebuilds the category,
the order or the status."
LabOverviewCategoryCounts:
type: object
properties:
inRange:
type: integer
minimum: -9007199254740991
maximum: 9007199254740991
below:
type: integer
minimum: -9007199254740991
maximum: 9007199254740991
above:
type: integer
minimum: -9007199254740991
maximum: 9007199254740991
unknown:
type: integer
minimum: -9007199254740991
maximum: 9007199254740991
required:
- inRange
- below
- above
- unknown
additionalProperties: false
description: How many members' newest readings are in range, below, above, or unassessed (qualitative, or no range).
GetLabResultResponse:
type: object
properties: