{% extends "base.html" %} {% load static %} {% block title %}Delete Incident - Quality Management{% endblock %} {% block content %}

Delete Incident {{ object.incident_number }} - {{ object.title }}

Confirm Incident Deletion

Critical Action - Permanent Deletion

You are about to permanently delete this incident record. This action cannot be undone and will result in the loss of all associated data, including investigation findings, corrective actions, and attachments.

{% if object.status == 'investigating' %}
Investigation in Progress

This incident is currently under investigation. Deleting it will terminate the ongoing investigation and may impact compliance requirements.

{% elif object.status == 'resolved' %}
Resolved Incident

This incident has been resolved. Deleting resolved incidents may impact quality metrics and regulatory reporting requirements.

{% elif object.status == 'closed' %}
Closed Incident

This incident has been closed and may be required for regulatory compliance and quality reporting. Consider archiving instead of deletion.

{% endif %} {% if object.patient_involved %}
Patient Safety Incident

This incident involves a patient and may be subject to regulatory reporting requirements. Deletion may violate patient safety and quality compliance standards.

{% endif %} {% if object.external_reporting_required %}
External Reporting Required

This incident requires external reporting to regulatory agencies. Deletion may result in compliance violations and regulatory penalties.

{% endif %}
Incident Summary
Incident Number: {{ object.incident_number }}
Title: {{ object.title }}
Category: {{ object.get_category_display }}
Type: {{ object.get_incident_type_display }}
Severity: {% if object.severity == 'critical' %} Critical {% elif object.severity == 'high' %} High {% elif object.severity == 'medium' %} Medium {% elif object.severity == 'low' %} Low {% endif %}
Status: {% if object.status == 'open' %} Open {% elif object.status == 'investigating' %} Investigating {% elif object.status == 'resolved' %} Resolved {% elif object.status == 'closed' %} Closed {% endif %}
Reported By: {{ object.reported_by.get_full_name }}
Department: {{ object.department.name|default:"Not specified" }}
Occurred At: {{ object.occurred_at|date:"M d, Y H:i" }}
Created: {{ object.created_at|date:"M d, Y H:i" }}
Deletion Impact Assessment
Data Loss:
  • Incident details and description
  • Investigation findings
  • Root cause analysis
  • Resolution documentation
  • {% if object.attachments.exists %}
  • {{ object.attachments.count }} attachment(s)
  • {% endif %}
Related Records:
    {% if object.corrective_actions.exists %}
  • {{ object.corrective_actions.count }} corrective action(s)
  • {% endif %} {% if object.patient %}
  • Patient record linkage
  • {% endif %}
  • Quality metrics impact
  • Audit trail records
{% if object.corrective_actions.exists %}
Associated Corrective Actions

Warning: This incident has {{ object.corrective_actions.count }} associated corrective action(s). Deleting this incident will also delete all related corrective actions.

{% for action in object.corrective_actions.all %} {% endfor %}
Action Assigned To Status Due Date
{{ action.title }}
{{ action.description|truncatechars:50 }}
{{ action.assigned_to.get_full_name|default:"Not assigned" }} {% if action.status == 'pending' %} Pending {% elif action.status == 'in_progress' %} In Progress {% elif action.status == 'completed' %} Completed {% elif action.status == 'cancelled' %} Cancelled {% endif %} {% if action.due_date %} {{ action.due_date|date:"M d, Y" }} {% if action.due_date < today and action.status != 'completed' %} Overdue {% endif %} {% else %} Not set {% endif %}
{% endif %}
Alternative Actions

Consider these alternatives to permanent deletion:

Recommendation: Archive the incident instead of deletion to maintain compliance and audit trails while removing it from active incident lists.
{% csrf_token %}
Deletion Confirmation
This additional confirmation helps prevent accidental deletions
Provide a detailed reason for this deletion (required for audit purposes)

Deletion Guidelines

When NOT to Delete:
  • Patient safety incidents
  • Regulatory reportable events
  • Incidents under investigation
  • Resolved incidents (archive instead)
  • Incidents with legal implications
When Deletion May Be Appropriate:
  • Duplicate entries
  • Test records
  • Data entry errors
  • Non-incident reports
Best Practices:
  • Archive instead of delete
  • Export data before deletion
  • Document deletion reason
  • Get supervisor approval

Contact Support

Quality Manager:
(555) 123-4567
quality@hospital.com
IT Support:
(555) 123-4570
it@hospital.com
Compliance Officer:
(555) 123-4571
compliance@hospital.com

Audit Information

User: {{ user.get_full_name }}
IP Address: {{ request.META.REMOTE_ADDR }}
Timestamp: {{ now|date:"M d, Y H:i:s" }}
Session ID: {{ request.session.session_key|truncatechars:12 }}
This deletion attempt will be logged for audit purposes regardless of completion.
{% endblock %} {% block js %} {% endblock %}