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

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

{% if object.severity == 'critical' %} Critical {% elif object.severity == 'high' %} High {% elif object.severity == 'medium' %} Medium {% elif object.severity == 'low' %} Low {% endif %} {{ object.title }}

Edit
{% if object.status == 'open' %}
Incident Open - Investigation Required

This incident is currently open and requires investigation. Please review the details and take appropriate action.

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

This incident is currently under investigation. Investigation started on {{ object.investigation_started_at|date:"M d, Y H:i" }}.

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

This incident has been resolved on {{ object.resolved_at|date:"M d, Y H:i" }}. Resolution: {{ object.resolution_summary|truncatechars:100 }}

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

This incident has been closed on {{ object.closed_at|date:"M d, Y H:i" }}. All corrective actions have been completed.

{% endif %}
Incident Information
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 %}
Priority: {% if object.priority == 'urgent' %} Urgent {% elif object.priority == 'high' %} High {% elif object.priority == 'medium' %} Medium {% elif object.priority == '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 }}
Assigned To: {{ object.assigned_to.get_full_name|default:"Not assigned" }}
Department: {{ object.department.name|default:"Not specified" }}
Location: {{ object.location|default:"Not specified" }}
Occurred At: {{ object.occurred_at|date:"M d, Y H:i" }}
Description

{{ object.description|linebreaks }}

{% if object.immediate_action_taken %}
Immediate Action Taken:

{{ object.immediate_action_taken|linebreaks }}

{% endif %}
{% if object.patient_involved %}
Patient Impact
Patient Involved: Yes
{% if object.patient %}
Patient: {{ object.patient.get_full_name }}
MRN: {{ object.patient.medical_record_number }}
{% endif %}
Patient Harm: {% if object.patient_harm %} Yes {% else %} No {% endif %}
{% if object.harm_level %}
Harm Level: {{ object.get_harm_level_display }}
{% endif %} {% if object.patient_notified %}
Patient Notified: Yes
{% endif %}
{% if object.patient_impact_description %}
Impact Description:

{{ object.patient_impact_description|linebreaks }}

{% endif %}
{% endif %} {% if object.status == 'investigating' or object.status == 'resolved' or object.status == 'closed' %}
Investigation Details
{% if object.investigation_started_at %}
Investigation Started: {{ object.investigation_started_at|date:"M d, Y H:i" }}
{% endif %} {% if object.investigator %}
Investigator: {{ object.investigator.get_full_name }}
{% endif %} {% if object.root_cause_analysis %}
RCA Performed: Yes
{% endif %}
{% if object.investigation_completed_at %}
Investigation Completed: {{ object.investigation_completed_at|date:"M d, Y H:i" }}
{% endif %} {% if object.external_reporting_required %}
External Reporting: Required
{% endif %}
{% if object.investigation_findings %}
Investigation Findings:

{{ object.investigation_findings|linebreaks }}

{% endif %} {% if object.root_cause %}
Root Cause:

{{ object.root_cause|linebreaks }}

{% endif %} {% if object.contributing_factors %}
Contributing Factors:

{{ object.contributing_factors|linebreaks }}

{% endif %}
{% endif %} {% if object.status == 'resolved' or object.status == 'closed' %}
Resolution
{% if object.resolved_at %}
Resolved At: {{ object.resolved_at|date:"M d, Y H:i" }}
{% endif %} {% if object.resolved_by %}
Resolved By: {{ object.resolved_by.get_full_name }}
{% endif %}
{% if object.closed_at %}
Closed At: {{ object.closed_at|date:"M d, Y H:i" }}
{% endif %} {% if object.closed_by %}
Closed By: {{ object.closed_by.get_full_name }}
{% endif %}
{% if object.resolution_summary %}
Resolution Summary:

{{ object.resolution_summary|linebreaks }}

{% endif %} {% if object.lessons_learned %}
Lessons Learned:

{{ object.lessons_learned|linebreaks }}

{% endif %}
{% endif %} {% if object.corrective_actions.exists %}
Corrective Actions
{% for action in object.corrective_actions.all %} {% endfor %}
Action Assigned To Due Date Status Actions
{{ action.title }}
{{ action.description|truncatechars:50 }}
{{ action.assigned_to.get_full_name|default:"Not assigned" }} {% if action.due_date %} {{ action.due_date|date:"M d, Y" }} {% if action.due_date < today %} Overdue {% endif %} {% else %} Not set {% endif %} {% if action.status == 'pending' %} Pending {% elif action.status == 'in_progress' %} In Progress {% elif action.status == 'completed' %} Completed {% elif action.status == 'cancelled' %} Cancelled {% endif %}
{% endif %} {% if object.attachments.exists %}
Attachments
{% for attachment in object.attachments.all %}
{{ attachment.filename }} {{ attachment.file_size|filesizeformat }}
{% endfor %}
{% endif %}
{% if object.status == 'open' %} {% endif %} {% if object.status == 'investigating' %} {% endif %} {% if object.status == 'resolved' %} {% endif %} Edit

Incident Timeline

Incident Reported

{{ object.created_at|date:"M d, Y H:i" }}

By {{ object.reported_by.get_full_name }}

{% if object.investigation_started_at %}
Investigation Started

{{ object.investigation_started_at|date:"M d, Y H:i" }}

{% if object.investigator %}

By {{ object.investigator.get_full_name }}

{% endif %}
{% endif %} {% if object.investigation_completed_at %}
Investigation Completed

{{ object.investigation_completed_at|date:"M d, Y H:i" }}

{% endif %} {% if object.resolved_at %}
Incident Resolved

{{ object.resolved_at|date:"M d, Y H:i" }}

{% if object.resolved_by %}

By {{ object.resolved_by.get_full_name }}

{% endif %}
{% endif %} {% if object.closed_at %}
Incident Closed

{{ object.closed_at|date:"M d, Y H:i" }}

{% if object.closed_by %}

By {{ object.closed_by.get_full_name }}

{% endif %}
{% endif %}

Quick Actions

{% if object.status == 'open' %} {% endif %} {% if object.status == 'investigating' %} {% endif %} {% if object.status == 'resolved' %} {% endif %}

Incident Statistics

Days Open {{ object.days_open }}
{% if object.corrective_actions.exists %}
Corrective Actions {{ object.corrective_actions.count }}
{% endif %} {% if object.attachments.exists %}
Attachments {{ object.attachments.count }}
{% endif %}
Last Updated {{ object.updated_at|date:"M d, Y" }}

Contact Information

Quality Manager:
(555) 123-4567
quality@hospital.com
Risk Management:
(555) 123-4568
risk@hospital.com
Patient Safety:
(555) 123-4569
safety@hospital.com
{% endblock %} {% block js %} {% endblock %}