public class TrendDetectionOptions
{
    public const string SectionName = "TrendDetection";

    /// <summary>Sliding window for rate-of-change calculation (minutes).</summary>
    public int WindowMinutes { get; set; } = 30;

    /// <summary>Maximum history entries stored per parameter in Redis.</summary>
    public int MaxHistoryEntries { get; set; } = 10;

    /// <summary>Redis TTL for trend history keys (seconds). Default 2 hours.</summary>
    public int HistoryTtlSeconds { get; set; } = 7200;

    /// <summary>Per-code rate thresholds: units per minute.</summary>
    public Dictionary<string, decimal> 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)
    };
}