Files
HealthLog/prisma/migrations/0156_v1170_cycle_temp_excluded/migration.sql
T
Marc-André Bombeck 4bfe9f11d7 feat(cycle): exclude disturbed temperatures from the symptothermal engine
A fever, illness, alcohol or a late/short-sleep reading can fake or mask
a temperature rise. Add a per-day `temperatureExcluded` flag on
CycleDayLog (migration 0156): when set, the engine drops the reading from
the cover-line baseline AND the shift evaluation, so a spike neither
fabricates nor masks a rise (Sensiplan: the cover line is drawn over the
last six unbracketed values).

Wired end to end — schema + Prisma, the engine's `detectTempShift`
filter, the Zod input/patch schemas, the day-log upsert (partial merge +
change detection), the read DTO, the calendar/insights/coach selects, the
backup round-trip, and the OpenAPI contract (a new boolean on the day-log
and calendar-day DTOs for the iOS client). The log-day sheet gains a
"mark reading as disturbed" toggle that appears once a temperature is
entered, translated across all six locales.

Citation: de.wikipedia "Symptothermale Methode"; myNFP "Temperaturkurve
auswerten" — Störfaktor bracketing.
2026-06-14 15:04:25 +02:00

11 lines
616 B
SQL

-- v1.17.0 — disturbed-temperature exclusion for the symptothermal engine.
--
-- A fever / illness / alcohol / late or short-sleep BBT reading can fake or
-- mask a temperature rise. `temperature_excluded = true` marks a day's basal
-- body temperature as a disturbed value: the Sensiplan cover-line baseline and
-- the shift evaluation both skip it, so a spike neither fabricates nor masks a
-- rise (the cover line is drawn over the last six *unbracketed* values).
-- Additive: every existing row backfills `false`.
ALTER TABLE "cycle_day_logs" ADD COLUMN "temperature_excluded" BOOLEAN NOT NULL DEFAULT false;