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

Delete Audit Confirm audit deletion

Confirm Audit Deletion

Warning

You are about to permanently delete this audit. This action cannot be undone and will remove all associated data including findings, corrective actions, and audit history.

Audit to be Deleted
Title: {{ audit.title }}
Type: {% if audit.audit_type == 'internal' %} Internal {% elif audit.audit_type == 'external' %} External {% elif audit.audit_type == 'regulatory' %} Regulatory {% elif audit.audit_type == 'accreditation' %} Accreditation {% endif %}
Status: {% if audit.status == 'planned' %} Planned {% elif audit.status == 'in_progress' %} In Progress {% elif audit.status == 'completed' %} Completed {% elif audit.status == 'cancelled' %} Cancelled {% endif %}
Department: {{ audit.department.name|default:"All Departments" }}
Scheduled: {{ audit.scheduled_date|date:"F d, Y"|default:"Not scheduled" }}
Lead Auditor: {{ audit.lead_auditor.get_full_name|default:"Not assigned" }}
Created: {{ audit.created_at|date:"F d, Y" }}
Findings: {% if audit.findings_count > 0 %} {{ audit.findings_count }} finding{{ audit.findings_count|pluralize }} {% else %} No findings {% endif %}

Impact Assessment

Data to be Deleted:
  • Audit information and documentation
  • {% if audit.findings_count > 0 %}
  • {{ audit.findings_count }} audit finding{{ audit.findings_count|pluralize }}
  • {% endif %} {% if audit.corrective_actions_count > 0 %}
  • {{ audit.corrective_actions_count }} corrective action{{ audit.corrective_actions_count|pluralize }}
  • {% endif %}
  • Audit timeline and history
  • Team member assignments
  • {% if audit.attachments_count > 0 %}
  • {{ audit.attachments_count }} attachment{{ audit.attachments_count|pluralize }}
  • {% endif %}
Potential Impact:
    {% if audit.status == 'completed' %}
  • Loss of completed audit documentation
  • {% endif %} {% if audit.is_regulatory %}
  • Regulatory compliance record loss
  • {% endif %} {% if audit.findings_count > 0 %}
  • Loss of quality improvement data
  • {% endif %} {% if audit.corrective_actions_count > 0 %}
  • Orphaned corrective actions
  • {% endif %}
  • Audit trail discontinuity
  • {% if audit.status == 'in_progress' %}
  • Interruption of ongoing audit process
  • {% endif %}
{% if audit.status == 'completed' or audit.is_regulatory %}
Special Considerations
    {% if audit.status == 'completed' %}
  • This is a completed audit with documented findings and outcomes
  • {% endif %} {% if audit.is_regulatory %}
  • This is a regulatory audit - deletion may affect compliance records
  • {% endif %} {% if audit.is_external %}
  • This is an external audit - consider notifying external auditors
  • {% endif %} {% if audit.corrective_actions_count > 0 %}
  • Associated corrective actions will become orphaned
  • {% endif %}
{% endif %}

Alternative Actions

Consider these alternatives before deleting the audit:

Cancel Audit

Change the audit status to "Cancelled" instead of deleting. This preserves the audit record while indicating it was not completed.

{% if audit.status != 'cancelled' %} {% else %} Already cancelled {% endif %}
Archive Audit

Archive the audit to remove it from active lists while preserving all data for compliance and historical purposes.

{% if not audit.is_archived %} {% else %} Already archived {% endif %}
{% if audit.status == 'in_progress' %}
In-Progress Audit

This audit is currently in progress. Consider completing or cancelling it instead of deleting to maintain audit trail integrity.

{% endif %}

Final Confirmation

{% csrf_token %}
{% if audit.is_regulatory %}
{% endif %}

Deletion Guidelines

When to Delete
  • Duplicate audit entries
  • Test audits created in error
  • Audits with no meaningful data
  • Audits created by mistake
When NOT to Delete
  • Completed audits with findings
  • Regulatory or compliance audits
  • Audits with corrective actions
  • Historical audit records
  • Audits under investigation

Need Help?

If you're unsure about deleting this audit, contact:

Quality Management
quality@hospital.com
(555) 123-4567
Compliance Officer
compliance@hospital.com
(555) 123-4568
Consider consulting with the Quality Management team before deleting completed or regulatory audits.
{% endblock %} {% block js %} {% endblock %}