fix(insights): wire grip / pain / waist / waist-to-height across web and MCP

Grip strength, pain (0–10 NRS), waist circumference, and waist-to-height
existed in the measurement enum, signal registry, and FHIR export but had
no web entry, no detail page, single non-sex-aware bands, and a split-brain
MCP exposure. This closes those gaps.

Web capture: the four signals join the manual measurement form, so a
web-only self-hoster can log them (the iOS client and the measurements API
already could).

Detail pages: flip detailPage on for the four signals and mount each on the
shared HealthKit metric template (chart, stat strip, Coach-read strip,
assessment card) via routed sub-pages and tab-strip pills, the same detail
spine every other metric carries.

Sex-aware bands: grip strength (EWGSOP2 men 27 / women 16 kg) and waist
(WHO men 94 / women 80 cm) now classify by the profile sex through the
age/sex norm resolver the assessment already threads; the resolver also
returns a sex-specific, age-independent band when no date of birth is set.
Fix the waist-to-height boundary so the NICE >= 0.5 rule is correct (the
last in-range value is 0.49).

MCP single source of truth: decouple the registry mcp facet from the Coach
snapshot — a signal can be MCP-readable without being on the Coach surface.
Mark the four physical signals mcp:true, derive the MCP rich-reads clinical
set from the registry flag instead of a duplicate allowlist, and relax the
invariant to coachSnapshot implies mcp (not the reverse). PHQ-9 / GAD-7 and
the environmental signals stay mcp:false and unreachable. compare_metric and
detect_changepoints now advertise clinical-signal support to match
get_metric_baseline.
This commit is contained in:
Marc-André Bombeck committed 2026-06-28 18:33:53 +02:00
1 parent 4f39058629
commit a69697b50f
25 files changed
+726 -62

No files matched your search

+14 -2
View File
@@ -6086,6 +6086,10 @@ paths:
- AVERAGE_HEART_RATE
- MAX_HEART_RATE
- ENERGY_EXPENDITURE_KJ
- GRIP_STRENGTH
- PAIN_NRS
- WAIST_CIRCUMFERENCE
- WAIST_TO_HEIGHT
description: "HealthKit metric id to assess (e.g. RESTING_HEART_RATE, SLEEP_DURATION). Closed enum: an unknown id 422s.
The seven specialised metrics are served by their own routes and are not accepted here."
required: true
@@ -10273,7 +10277,7 @@ components:
- order
tiles:
minItems: 1
maxItems: 50
maxItems: 61
type: array
items:
type: object
@@ -10287,6 +10291,7 @@ components:
- oxygen
- body-temperature
- respiratory-rate
- pain
- weight
- bmi
- body-water
@@ -10296,6 +10301,8 @@ components:
- muscle-mass
- visceral-fat
- lean-body-mass
- waist
- waist-to-height
- steps
- active-energy
- workouts
@@ -10312,6 +10319,7 @@ components:
- six-minute-walk
- stair-ascent-speed
- stair-descent-speed
- grip-strength
- sleep
- breathing-disturbances
- resting-pulse
@@ -25476,7 +25484,7 @@ components:
additionalProperties: false
tiles:
minItems: 1
maxItems: 50
maxItems: 61
type: array
items:
type: object
@@ -25490,6 +25498,7 @@ components:
- oxygen
- body-temperature
- respiratory-rate
- pain
- weight
- bmi
- body-water
@@ -25499,6 +25508,8 @@ components:
- muscle-mass
- visceral-fat
- lean-body-mass
- waist
- waist-to-height
- steps
- active-energy
- workouts
@@ -25515,6 +25526,7 @@ components:
- six-minute-walk
- stair-ascent-speed
- stair-descent-speed
- grip-strength
- sleep
- breathing-disturbances
- resting-pulse