{% extends "base.html" %} {% load static %} {% block title %}Surgery Details - {{ object.procedure_name }}{% endblock %} {% block css %} {% endblock %} {% block content %}

Surgery Details {{ object.procedure_name }}

Surgery Information

Patient: {{ object.patient.get_full_name }}
{{ object.patient.medical_record_number }}
Procedure: {{ object.procedure_name }} {% if object.procedure_code %}
Code: {{ object.procedure_code }} {% endif %}
Primary Surgeon: Dr. {{ object.surgeon.get_full_name }}
Status: {{ object.get_status_display }}
Urgency: {{ object.get_urgency_level_display }}
Scheduled Date: {{ object.scheduled_date|date:"M d, Y" }}
Start Time: {{ object.scheduled_start_time|time:"H:i" }}
Duration: {% if object.estimated_duration %} {{ object.estimated_duration }} minutes {% else %} Not specified {% endif %}
Operating Room: {% if object.operating_room %} {{ object.operating_room }} {% else %} Not assigned {% endif %}
Anesthesia: {% if object.anesthesia_type %} {{ object.get_anesthesia_type_display }} {% else %} Not specified {% endif %}

Surgical Team

Medical Team
{% if object.assistant_surgeons.exists %}
Assistant Surgeons:
{% for surgeon in object.assistant_surgeons.all %} Dr. {{ surgeon.get_full_name }} {% if not forloop.last %}, {% endif %} {% endfor %}
{% endif %} {% if object.anesthesiologist %} {% endif %}
Nursing Team
{% if object.scrub_nurses.exists %}
Scrub Nurses:
{% for nurse in object.scrub_nurses.all %} {{ nurse.get_full_name }} {% if not forloop.last %}, {% endif %} {% endfor %}
{% endif %} {% if object.circulating_nurses.exists %}
Circulating Nurses:
{% for nurse in object.circulating_nurses.all %} {{ nurse.get_full_name }} {% if not forloop.last %}, {% endif %} {% endfor %}
{% endif %}

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 %} {% if object.special_instructions %}
Special Instructions
{{ object.special_instructions|linebreaks }}
{% endif %} {% if not object.pre_operative_notes and not object.operative_notes and not object.post_operative_notes and not object.special_instructions %}

No clinical notes available.

{% endif %}

Quick Actions

Edit Surgery {% if object.status == 'scheduled' %} {% elif object.status == 'in_progress' %} {% endif %} {% if object.status in 'scheduled,in_progress' %} {% endif %} View Calendar

Surgery Timeline

{{ object.created_at|date:"M d, Y H:i" }}
Surgery Scheduled
Surgery was scheduled by {{ object.created_by.get_full_name|default:"System" }}
{% if object.actual_start_time %}
{{ object.actual_start_time|date:"M d, Y H:i" }}
Surgery Started
Surgery began in {{ object.operating_room }}
{% endif %} {% if object.actual_end_time %}
{{ object.actual_end_time|date:"M d, Y H:i" }}
Surgery Completed
Duration: {{ object.get_actual_duration }} minutes
{% endif %} {% if object.status == 'cancelled' %}
{{ object.updated_at|date:"M d, Y H:i" }}
Surgery Cancelled
Surgery was cancelled
{% endif %}

Patient Information

{{ object.patient.get_full_name }}
{{ object.patient.medical_record_number }}
View Profile
Age: {{ object.patient.age }} years
Gender: {{ object.patient.get_gender_display }}
Blood Type: {% if object.patient.blood_type %} {{ object.patient.blood_type }} {% else %} Unknown {% endif %}
Allergies: {% if object.patient.allergies %} {{ object.patient.allergies }} {% else %} None known {% endif %}
{% endblock %} {% block js %} {% endblock %}