{% extends "base.html" %} {% load static %} {% block title %}{% if object %}Edit Alert Rule{% else %}Create Alert Rule{% endif %} - Communications{% endblock %} {% block content %}

{% if object %}Edit Alert Rule{% else %}Create Alert Rule{% endif %}

{% csrf_token %}
Basic Information
{{ form.rule_name }} {% if form.rule_name.errors %}
{{ form.rule_name.errors.0 }}
{% endif %}
Enter a unique, descriptive name for this alert rule
{{ form.category }} {% if form.category.errors %}
{{ form.category.errors.0 }}
{% endif %}
{{ form.severity }} {% if form.severity.errors %}
{{ form.severity.errors.0 }}
{% endif %}
{{ form.description }} {% if form.description.errors %}
{{ form.description.errors.0 }}
{% endif %}
Describe what this alert rule monitors and when it should trigger
{{ form.event_type }} {% if form.event_type.errors %}
{{ form.event_type.errors.0 }}
{% endif %}
Specify the type of event this rule should monitor
{{ form.is_active }}
{% if form.is_active.errors %}
{{ form.is_active.errors.0 }}
{% endif %}
Only active rules will be evaluated and can trigger alerts
Condition Configuration
{{ form.condition_expression }} {% if form.condition_expression.errors %}
{{ form.condition_expression.errors.0 }}
{% endif %}
Enter the condition that will trigger this alert (e.g., patient.temperature > 38.5)
{{ form.condition_parameters }} {% if form.condition_parameters.errors %}
{{ form.condition_parameters.errors.0 }}
{% endif %}
Optional JSON parameters for the condition expression
Notification Settings
{{ form.notification_template }}
{% if form.notification_template.errors %}
{{ form.notification_template.errors.0 }}
{% endif %}
Select a template for alert notifications (optional)
{{ form.cooldown_minutes }} {% if form.cooldown_minutes.errors %}
{{ form.cooldown_minutes.errors.0 }}
{% endif %}
Minimum time between alerts
{{ form.max_triggers_per_day }} {% if form.max_triggers_per_day.errors %}
{{ form.max_triggers_per_day.errors.0 }}
{% endif %}
Maximum alerts per day (0 = unlimited)
{{ form.auto_resolve }}
Automatically resolve when condition is no longer met
{{ form.escalation_enabled }}
Escalate unacknowledged alerts
{{ form.snooze_enabled }}
Allow temporary suppression of alerts
Alert Recipients
{{ form.recipients }}
{% if form.recipients.errors %}
{{ form.recipients.errors.0 }}
{% endif %}
Select users who should receive alerts from this rule
Actions


Cancel
Help & Examples

Patient Vitals:
patient.temperature > 38.5
patient.heart_rate < 60

Equipment:
equipment.status == 'OFFLINE'
equipment.battery_level < 20

System:
system.cpu_usage > 90
system.disk_space < 10

Critical: Immediate life-threatening situations
High: Urgent medical attention required
Medium: Important but not urgent
Low: Informational or routine alerts

• Use descriptive rule names
• Set appropriate cooldown periods
• Test rules before activating
• Use escalation for critical alerts
• Limit recipients to relevant staff
• Monitor rule performance regularly
Rule Preview

Fill out the form to see a preview of your alert rule

{% endblock %} {% block js %} {% endblock %}