{% extends 'base.html' %} {% load static %} {% block title %}Delete Metric Definition - Hospital Management{% endblock %} {% block content %}
Metric Definition to be Deleted

{{ metric.name }}

{{ metric.description|default:"No description provided" }}

{{ metric.get_category_display }}
{{ metric.get_metric_type_display }}
{% if metric.status == 'active' %} Active {% elif metric.status == 'inactive' %} Inactive {% else %} Draft {% endif %}
{{ metric.unit|default:"N/A" }}
{{ metric.data_source.name|default:"N/A" }}
{% if metric.last_calculated %} {{ metric.last_calculated|timesince }} ago {% else %} Never {% endif %}
{{ metric.created_by|default:"System" }}
{{ metric.created_at|date:"M d, Y" }}
{% if metric.category == 'clinical' %} {% elif metric.category == 'financial' %} {% elif metric.category == 'operational' %} {% elif metric.category == 'quality' %} {% else %} {% endif %}
{{ metric.get_category_display }}
{{ metric.calculation_count|default:"0" }} Calculations
{{ metric.widget_count|default:"0" }} Widgets
Deletion Impact
What will be deleted:
  • Metric definition
    1
  • Formula and configuration
    1
  • Calculation history
    {{ metric.calculation_count|default:"0" }}
  • Associated widgets
    {{ metric.widget_count|default:"0" }}
  • Parameters and settings
    {{ metric.parameters_count|default:"0" }}
What will remain:
  • Original data sources
    Safe
  • Other dashboards
    Safe
  • Other metrics
    Safe
  • User accounts
    Safe
  • System settings
    Safe
{% if metric.widget_count > 0 %}
Warning: This metric is used by {{ metric.widget_count }} widget{{ metric.widget_count|pluralize }}. Deleting it will break these widgets and they will need to be reconfigured.
{% endif %} {% if metric.status == 'active' %}
Notice: This metric is currently active and may be used in automated calculations. Consider deactivating it first before deletion.
{% endif %}
{% if metric.formula %}
Formula to be Lost
{{ metric.formula }}
This formula will be permanently lost. Consider backing up the configuration before deletion.
{% endif %}
Alternative Actions

Consider these alternatives before deleting the metric definition:

Deactivate Metric

Temporarily disable without deleting data.

Export Configuration

Download metric configuration for backup.

Duplicate Metric

Create a copy before deletion.

Edit Metric

Modify instead of deleting.

Edit Instead
Confirm Deletion
{% csrf_token %}
{% if metric.widget_count > 0 %}
{% endif %} {% if metric.status == 'active' %}
{% endif %}
{% endblock %}