From fbbcaf4417f7fae9af90f393267a5dbe7a852ec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Wed, 11 Nov 2026 00:11:35 +0100 Subject: [PATCH] docs(api): keep the labs category status rule in the contract The description of a labs category lost the status rule and the sentence that a client never rebuilds the category, the order or the status. Both are back as they were, with one line added: a client that shows only the members matching a filter may summarise that subset by the same rule. --- docs/api/openapi.yaml | 11 ++++++----- src/lib/labs/marker-category.ts | 8 ++++---- src/lib/openapi/routes/labs.ts | 4 ++-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/docs/api/openapi.yaml b/docs/api/openapi.yaml index 2a57864ff..f3300ccaa 100644 --- a/docs/api/openapi.yaml +++ b/docs/api/openapi.yaml @@ -77272,9 +77272,11 @@ components: description: "One category of the labs list, resolved by the server. `key` is opaque: a catalog panel key, `custom:` 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. `counts` - and `status` describe the full category without filters; a client renders these values directly when unfiltered, - and may summarize the visible row subset client-side while filters are active." + 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. A client that shows only the members matching a filter may summarise that subset by the + same rule; without a filter it shows `counts` and `status` as sent." LabOverviewCategoryCounts: type: object properties: @@ -77300,8 +77302,7 @@ components: - above - unknown additionalProperties: false - description: How many members' newest readings are in range, below, above, or unassessed (qualitative, or no range) for - the full category without filters. + description: How many members' newest readings are in range, below, above, or unassessed (qualitative, or no range). GetLabResultResponse: type: object properties: diff --git a/src/lib/labs/marker-category.ts b/src/lib/labs/marker-category.ts index ca0993b72..9cb593e98 100644 --- a/src/lib/labs/marker-category.ts +++ b/src/lib/labs/marker-category.ts @@ -4,10 +4,10 @@ * A marker's category is its panel: the serialised `latest.panel`, which is * the biomarker's panel for a linked marker and the row's own for a legacy * unlinked one (the same value the card shows as its chip). The server - * resolves the category, its label, its order, and combined counts and status - * for the full category once; clients (the web list and the iOS app) render - * that as given when unfiltered, while the web list summarizes the visible - * subset client-side when filters are active. + * resolves the category, its label, its order and a combined status once; + * the web list and the iOS app render that as given and never rebuild it. + * While a filter hides some members, the web list summarises the matching + * ones by the same rule (`priorityReferenceRangeStatus`). * * Resolution, first match wins: * 1. the panel folds to a catalog panel label in any shipped locale diff --git a/src/lib/openapi/routes/labs.ts b/src/lib/openapi/routes/labs.ts index d2ea27ed3..f0ef1f760 100644 --- a/src/lib/openapi/routes/labs.ts +++ b/src/lib/openapi/routes/labs.ts @@ -149,7 +149,7 @@ export const labOverviewCategoryCounts = z .meta({ id: "LabOverviewCategoryCounts", description: - "How many members' newest readings are in range, below, above, or unassessed (qualitative, or no range) for the full category without filters.", + "How many members' newest readings are in range, below, above, or unassessed (qualitative, or no range).", }); export const labOverviewCategory = z @@ -163,7 +163,7 @@ export const labOverviewCategory = z .meta({ id: "LabOverviewCategory", description: - "One category of the labs list, resolved by the server. `key` is opaque: a catalog panel key, `custom:` 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. `counts` and `status` describe the full category without filters; a client renders these values directly when unfiltered, and may summarize the visible row subset client-side while filters are active.", + "One category of the labs list, resolved by the server. `key` is opaque: a catalog panel key, `custom:` 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. A client that shows only the members matching a filter may summarise that subset by the same rule; without a filter it shows `counts` and `status` as sent.", }); export const labOverviewResponse = z