Alert rules
Each rule has a severity (info, warning, critical) and a condition. They are evaluated when the questionnaire completes (after scoring). Up to 10 rules per version.
Condition types:
(Red flags are a separate trigger, in real time during the call.)
Escalation policy

(protocol, group, severity): a policy for a specific protocol and group takes precedence over a more general one. A policy that is found but disabled means “do not escalate here”.
Levels (up to 5). Each level has:
delay_minutes: the wait since the previous event (from 1 minute up to 1 week).- A target: a role (
coordinator,admin= head of service,medic) or a specific user.