{% extends "base.html" %} {% load static %} {% block title %}Surgical Case Details - Operating Theatre{% endblock %} {% block css %} {% endblock %} {% block content %}

Surgical Case Details {{ object.case_number }}

Case Information

{% if object.status == 'SCHEDULED' %}
Scheduled: This case is scheduled for {{ object.scheduled_start_time|date:"M d, Y" }} at {{ object.scheduled_start_time|time:"H:i" }}
{% elif object.status == 'IN_PROGRESS' %}
In Progress: Surgery started at {{ object.actual_start_time|time:"H:i" }}
{% elif object.status == 'COMPLETED' %}
Completed: Surgery completed on {{ object.actual_end_time|date:"M d, Y" }} at {{ object.actual_end_time|time:"H:i" }}
{% elif object.status == 'CANCELLED' %}
Cancelled: {{ object.cancellation_reason }}
{% endif %}
Patient Information
Patient Name: {{ object.patient.get_full_name }}
Patient ID: {{ object.patient.patient_id }}
Date of Birth: {{ object.patient.date_of_birth|date:"M d, Y" }} ({{ object.patient.age }} years)
Gender: {{ object.patient.get_gender_display }}
Blood Type: {{ object.patient.blood_type|default:"Not specified" }}
Allergies: {{ object.patient.allergies|default:"None known" }}
Emergency Contact: {{ object.patient.emergency_contact_name|default:"Not specified" }}
Contact Phone: {{ object.patient.emergency_contact_phone|default:"Not specified" }}
Surgery Information
Case Number: {{ object.case_number }}
Procedure: {{ object.procedure_name }}
Procedure Code: {{ object.procedure_code }}
Surgery Type: {{ object.get_surgery_type_display }}
Priority: {{ object.get_priority_display }}
Operating Room: {{ object.operating_room.name }}
Primary Surgeon: {{ object.primary_surgeon.get_full_name }}
Anesthesiologist: {{ object.anesthesiologist.get_full_name|default:"Not assigned" }}
Estimated Duration: {{ object.estimated_duration }} minutes
Status: {{ object.get_status_display }}
Scheduling Information
Scheduled Date: {{ object.scheduled_start_time|date:"M d, Y" }}
Scheduled Start: {{ object.scheduled_start_time|time:"H:i" }}
Scheduled End: {{ object.scheduled_end_time|time:"H:i" }}
{% if object.actual_start_time %} {% if object.actual_end_time %} {% endif %}
Actual Start: {{ object.actual_start_time|time:"H:i" }}
Actual End: {{ object.actual_end_time|time:"H:i" }}
Actual Duration: {{ object.actual_duration }} minutes
{% endif %}
Surgical Team
{% if object.anesthesiologist %} {% endif %} {% for team_member in object.surgical_team.all %} {% endfor %}
Role Name Department Contact
Primary Surgeon {{ object.primary_surgeon.get_full_name }} {{ object.primary_surgeon.department.name }} {{ object.primary_surgeon.phone|default:"--" }}
Anesthesiologist {{ object.anesthesiologist.get_full_name }} {{ object.anesthesiologist.department.name }} {{ object.anesthesiologist.phone|default:"--" }}
{{ team_member.role }} {{ team_member.staff_member.get_full_name }} {{ team_member.staff_member.department.name }} {{ team_member.staff_member.phone|default:"--" }}
{% if object.pre_operative_notes or object.operative_notes or object.post_operative_notes %}
Clinical Notes
{% if object.pre_operative_notes %}
Pre-operative Notes

{{ object.pre_operative_notes|linebreaks }}

{% endif %} {% if object.operative_notes %}
Operative Notes

{{ object.operative_notes|linebreaks }}

{% endif %} {% if object.post_operative_notes %}
Post-operative Notes

{{ object.post_operative_notes|linebreaks }}

{% endif %}
{% endif %} {% if object.equipment_used.all or object.supplies_used.all %}
Equipment & Supplies
{% if object.equipment_used.all %}
Equipment Used
{% for equipment in object.equipment_used.all %}
{{ equipment.name }}
{{ equipment.model }} - {{ equipment.serial_number }}
{{ equipment.get_status_display }}
{% endfor %}
{% endif %} {% if object.supplies_used.all %}
Supplies Used
{% for supply in object.supplies_used.all %}
{{ supply.item.name }}
Quantity: {{ supply.quantity_used }}
Lot: {{ supply.lot_number|default:"--" }}
Exp: {{ supply.expiry_date|date:"M Y"|default:"--" }}
{% endfor %}
{% endif %}
{% endif %}

Quick Actions

{% if object.status == 'SCHEDULED' %} {% elif object.status == 'IN_PROGRESS' %} {% elif object.status == 'COMPLETED' %} {% endif %}
Edit Case

Case Timeline

Case Created

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

{% if object.scheduled_start_time %}
Scheduled

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

{% endif %} {% if object.actual_start_time %}
Surgery Started

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

{% endif %} {% if object.actual_end_time %}
Surgery Completed

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

{% endif %} {% if object.status == 'CANCELLED' %}
Surgery Cancelled

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

{% endif %}

Case Statistics

{% if object.actual_duration %} {% endif %}
Created: {{ object.created_at|date:"M d, Y H:i" }}
Last Updated: {{ object.updated_at|date:"M d, Y H:i" }}
Duration: {{ object.actual_duration }} minutes
Team Size: {{ object.surgical_team.count|add:"1" }} members
Equipment Used: {{ object.equipment_used.count }} items
{% endblock %} {% block js %} {% endblock %}