Derive glucose isSpotEstimate from reading density

Hard-coding isSpotEstimate: true mislabels a dense Nightscout CGM stream
(~288 readings/day) as a spot estimate and undersells the data in the
clinical panel and coach. Compute readings-per-day over the covered span
and treat the series as continuous below the spot caveat once it clears a
~hourly bar (24 readings/day); sparse spot fingersticks keep the caveat.
The panel only renders the spot-reading line when isSpotEstimate, and the
OpenAPI field relaxes from a literal-true to a boolean.
This commit is contained in:
Marc-André Bombeck committed 2026-06-14 20:54:32 +02:00
1 parent c5a7e06e35
commit c268ace58c
6 files changed
+98 -31

No files matched your search

+3 -3
View File
@@ -14126,7 +14126,6 @@ components:
- type: "null"
isSpotEstimate:
type: boolean
const: true
required:
- stillLearning
- stillLearningReason
@@ -14141,8 +14140,9 @@ components:
- advanced
- isSpotEstimate
additionalProperties: false
description: Server-authoritative glucose clinical panel over the trailing 30-day window. Every figure is a SPOT-READING
ESTIMATE (a % of readings), not a CGM time-in-range AGP — `isSpotEstimate` is always true and `stillLearning`
description: Server-authoritative glucose clinical panel over the trailing 30-day window. Figures from sparse spot data
are a SPOT-READING ESTIMATE (a % of readings), not a CGM time-in-range AGP; `isSpotEstimate` is derived from
reading density (true below ~hourly, false for a continuous CGM stream such as Nightscout) and `stillLearning`
gates assertion when the window has too few readings or too short a span. `distribution` carries the Battelino
2019 TIR/TBR/TAR fractions (level-2 nested in level-1) plus minutes-of-a-day equivalents; `gmi` (Bergenstal
2018) + `estimatedA1c` (Nathan 2008 ADAG) derive from the mean; `variability` is SD + CV% with the Monnier 2017