public class TrendDetectionOptions { public const string SectionName = "TrendDetection"; /// Sliding window for rate-of-change calculation (minutes). public int WindowMinutes { get; set; } = 30; /// Maximum history entries stored per parameter in Redis. public int MaxHistoryEntries { get; set; } = 10; /// Redis TTL for trend history keys (seconds). Default 2 hours. public int HistoryTtlSeconds { get; set; } = 7200; /// Per-code rate thresholds: units per minute. public Dictionary RateThresholdsPerMinute { get; set; } = new() { ["HEART_RATE"] = 0.5m, // 15 bpm rise in 30 min ["RESP_RATE"] = 0.3m, // 9 breaths/min rise in 30 min ["SYSTOLIC_BP"] = 1.0m, // 30 mmHg drop in 30 min (negative rate checked separately) ["TEMP_C"] = 0.05m, // 1.5 °C rise in 30 min ["SPO2"] = 0.2m // 6% drop in 30 min (negative rate) }; }