mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 04:32:42 +00:00
feat(insights): rewrite the BMI assessment prompt to the assessment spec
Describe the graded BMI series and target band, lead on the trend over the single value, keep the WHO bands as placement anchors rather than a label for the person, and name BMI's body-composition limits plainly. Drop the chart-token instruction the status path strips out.
This commit is contained in:
1 parent
052bbbfd7c
commit
4e04e375ad
1 file changed
+14
-30
+14
-30
@@ -1,35 +1,19 @@
|
||||
import type { Locale } from "@/lib/i18n/config";
|
||||
import { getBaseSystemPrompt } from "./base-system";
|
||||
|
||||
const BMI_SECTION_DE = `FACHSPEZIFISCH — BMI:
|
||||
- WHO-Klassifikation strikt anwenden:
|
||||
* Untergewicht: < 18.5
|
||||
* Normalgewicht: 18.5 - 24.9
|
||||
* Übergewicht (Präadipositas): 25.0 - 29.9
|
||||
* Adipositas Grad I: 30.0 - 34.9
|
||||
* Adipositas Grad II: 35.0 - 39.9
|
||||
* Adipositas Grad III: ≥ 40.0
|
||||
- Altersadjustierung: Ab 65+ gilt BMI 22-27 als optimal (DEGAM).
|
||||
- Geschlechtskontext: Bei verfügbarem Geschlecht unterschiedliche Risikoprofile berücksichtigen.
|
||||
- Trend wichtiger als Momentaufnahme: BMI-Entwicklung über 30/90 Tage gewichten.
|
||||
- Limitationen des BMI: Kein Maß für Körperzusammensetzung. Bei Sportlern oder muskulösen Personen eingeschränkt aussagekräftig — darauf hinweisen.
|
||||
- Zusammenhang mit Blutdruck und Puls: Übergewicht als Risikofaktor für Hypertonie einordnen.
|
||||
- Inline-Chart: Da BMI aus dem Gewicht abgeleitet wird, kannst du genau einen Token metric:WEIGHT in summary oder finding einbetten, um den zugrundeliegenden Gewichtsverlauf darunter einzublenden.`;
|
||||
const BMI_SECTION_DE = `METRIK — BMI:
|
||||
- Der Snapshot trägt bmi.summary + bmi.series (graded). bmi.latestDayFocus zeigt den jüngsten Wert, dessen WHO-Klassifikation und den Schritt zum Vortag; bmi.target ist das grüne Band (18.5-24.9).
|
||||
- Trend vor Momentaufnahme: Vergleiche das recent-Mittel mit dem weekly/monthly-Mittel der Person und benenne die Richtung — ein einzelner Tageswert trägt wenig.
|
||||
- WHO-Bänder zur groben Einordnung, nie als Etikett für die Person: Untergewicht < 18.5, Normal 18.5-24.9, Übergewicht 25.0-29.9, Adipositas I 30.0-34.9, II 35.0-39.9, III ≥ 40.0. Ab 65+ gilt 22-27 als günstig (DEGAM).
|
||||
- Grenzen des BMI offen ansprechen: Er misst keine Körperzusammensetzung und ist bei muskulösen oder sehr sportlichen Personen wenig aussagekräftig.
|
||||
- Eine Botschaft: Schließe mit EINEM machbaren Schritt, der zur Richtung passt — bei stabilem Wert im günstigen Band das ehrlich anerkennen, statt einen Befund zu erzwingen.`;
|
||||
|
||||
const BMI_SECTION_EN = `DOMAIN — BMI:
|
||||
- Apply WHO classification strictly:
|
||||
* Underweight: < 18.5
|
||||
* Normal weight: 18.5 - 24.9
|
||||
* Overweight (pre-obesity): 25.0 - 29.9
|
||||
* Obesity class I: 30.0 - 34.9
|
||||
* Obesity class II: 35.0 - 39.9
|
||||
* Obesity class III: ≥ 40.0
|
||||
- Age adjustment: From age 65+, BMI 22-27 counts as optimal (DEGAM).
|
||||
- Sex context: When sex is known, factor in different risk profiles.
|
||||
- Trend over snapshot: Weight 30- and 90-day BMI trajectories more heavily than a single value.
|
||||
- BMI limitations: Not a measure of body composition. Less informative for athletes or very muscular people — point this out.
|
||||
- Relation to blood pressure and pulse: Treat overweight as a risk factor for hypertension.
|
||||
- Inline chart: BMI is derived from weight, so you may embed exactly one metric:WEIGHT token in the summary or a finding to inline the underlying weight trajectory beneath it.`;
|
||||
const BMI_SECTION_EN = `METRIC — BMI:
|
||||
- The snapshot carries bmi.summary + bmi.series (graded). bmi.latestDayFocus shows the latest value, its WHO classification and the step from the prior day; bmi.target is the green band (18.5-24.9).
|
||||
- Trend over snapshot: compare the recent mean with the person's weekly/monthly mean and name the direction — a single daily value carries little.
|
||||
- WHO bands for rough placement, never as a label for the person: Underweight < 18.5, Normal 18.5-24.9, Overweight 25.0-29.9, Obesity I 30.0-34.9, II 35.0-39.9, III ≥ 40.0. From age 65+, 22-27 counts as favourable (DEGAM).
|
||||
- Name BMI's limits plainly: it does not measure body composition and is weakly informative for muscular or very athletic people.
|
||||
- One message: close with ONE doable step that fits the direction — when the value is stable in the favourable band, acknowledge that honestly rather than forcing a finding.`;
|
||||
|
||||
export function getBmiSystemPrompt(locale: Locale): string {
|
||||
const section = locale === "en" ? BMI_SECTION_EN : BMI_SECTION_DE;
|
||||
@@ -50,12 +34,12 @@ export function getBmiUserPrompt(
|
||||
: "";
|
||||
if (locale === "en") {
|
||||
return `Date: ${todayKey} (Europe/Berlin)
|
||||
Analyse the BMI trajectory taking age, sex and weight trend into account. Place the WHO classification.${ctxBlock}
|
||||
Write one short assessment of this person's BMI: name the current value and WHO band, place the recent trend against their own weekly/monthly baseline, and close with one doable step. Judge confidence from the measurement count and recency.${ctxBlock}
|
||||
|
||||
${snapshotJson}`;
|
||||
}
|
||||
return `Datum: ${todayKey} (Europe/Berlin)
|
||||
Analysiere den BMI-Verlauf unter Berücksichtigung von Alter, Geschlecht und Gewichtstrend. Ordne die Klassifikation nach WHO ein.${ctxBlock}
|
||||
Schreibe eine kurze Einschätzung zum BMI dieser Person: benenne den aktuellen Wert und das WHO-Band, ordne den jüngsten Trend gegen die eigene Wochen-/Monats-Baseline ein und schließe mit einem machbaren Schritt. Konfidenz aus Messanzahl und Aktualität ableiten.${ctxBlock}
|
||||
|
||||
${snapshotJson}`;
|
||||
}
|
||||
Reference in new issue
Block a user