From 2563690e4bcefcfe8d2b45e1fc1c8ffa6ef3dd83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 28 Jun 2026 16:15:48 +0200 Subject: [PATCH] fix(insights): add chart tokens for v1.25 clinical measurement types The PHQ-9 / GAD-7 screener totals and the physical clinical measures (grip strength, pain NRS, waist circumference, waist-to-height) are continuous numeric series. Register their metric: tokens so the chart-token drift guard passes and the AI insight prose can reference them through the generic chart renderer. --- src/lib/insights/chart-tokens.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib/insights/chart-tokens.ts b/src/lib/insights/chart-tokens.ts index fca9edb1f..df71e2e86 100644 --- a/src/lib/insights/chart-tokens.ts +++ b/src/lib/insights/chart-tokens.ts @@ -127,6 +127,16 @@ export const ALLOWED_CHART_TOKENS = [ // v1.19.0 — Oura resilience. A continuous daily ordinal series (1–5), so it // carries a `metric:` token and renders through the generic chart. "metric:RESILIENCE", + // v1.25.0 — clinical signals. Mental-health screener totals (PHQ-9 0–27, + // GAD-7 0–21) and the physical clinical measures are continuous numeric + // series, so each carries a `metric:` token and renders through the + // generic chart. + "metric:PHQ9_SCORE", + "metric:GAD7_SCORE", + "metric:GRIP_STRENGTH", + "metric:PAIN_NRS", + "metric:WAIST_CIRCUMFERENCE", + "metric:WAIST_TO_HEIGHT", ] as const; export type ChartToken = (typeof ALLOWED_CHART_TOKENS)[number];