{% extends 'base.html' %} {% load static %} {% block title %}OR Block - {{ object.operating_room.room_name }}{% endblock %} {% block css %} {% endblock %} {% block content %}

OR Block Details

Back {% if object.status == 'available' %} Edit {% endif %}
{{ object.operating_room.room_name }}
Date: {{ object.date }}
Time: {{ object.start_time|date:"H:i" }} - {{ object.end_time|date:"H:i" }}
Duration: {{ object.allocated_minutes }} min
Block Type: {{ object.get_block_type_display }}
Assigned Surgeon: {% if object.primary_surgeon %} {{ object.primary_surgeon.get_full_name }} {% else %} Unassigned {% endif %}
Created: {{ object.created_at|date:"M d, Y H:i" }}
{% if object.status == 'SCHEDULED' %} Scheduled {% elif object.status == 'DELAYED' %} Delayed {% elif object.status == 'ACTIVE' %} Active {% elif object.status == 'COMPLETED' %} Completed {% elif object.status == 'CANCELLED' %} Cancelled {% endif %}
{{ object.utilization_percentage }}%
Utilization

Block Utilization

{{ total_block_minutes }}
Total Minutes
{{ scheduled_minutes }}
Scheduled
{{ available_minutes }}
Available
{{ turnover_minutes }}
Turnover

Scheduled Cases ({{ object.surgical_cases.count }}) {% if object.status == 'available' %}
{% endif %}

{% for case in object.surgical_cases.all %}

{{ case.patient.get_full_name }}

Scheduled Time: {{ case.scheduled_start|date:"H:i" }} - Duration: {{ case.estimated_duration }}
{% if case.status == 'scheduled' %} Scheduled {% elif case.status == 'in_progress' %} In Progress {% elif case.status == 'completed' %} Completed {% elif case.status == 'cancelled' %} Cancelled {% endif %}
Procedure
{{ case.primary_procedure }}
Surgeon
{{ case.primary_surgeon.get_full_name }}
Estimated Duration
{{ case.estimated_duration }} minutes
Priority
{% if case.priority == 'emergency' %} Emergency {% elif case.priority == 'urgent' %} Urgent {% else %} Routine {% endif %}
View {% if case.status == 'scheduled' %} Edit {% endif %}
{% if case.status == 'scheduled' %} {% elif case.status == 'in_progress' %} {% endif %}
{% empty %}

No cases scheduled for this block

{% if object.status == 'available' %} {% endif %}
{% endfor %}

Block Details

Operating Room
{{ object.operating_room.name }}
Room Type
{{ object.operating_room.get_room_type_display }}
Capacity
{{ object.operating_room.capacity }} people
Equipment Level
{{ object.operating_room.get_equipment_level_display }}
{% if object.notes %}
Notes
{{ object.notes }}
{% endif %}

Assigned Team

{% if object.primary_surgeon %}
Primary Surgeon
{{ object.primary_surgeon.get_full_name }}
{% endif %} {% if object.assigned_anesthesiologist %}
Anesthesiologist
{{ object.assigned_anesthesiologist.get_full_name }}
{% endif %} {% if object.assigned_nurses.exists %}
Nursing Team
{% for nurse in object.assigned_nurses.all %}
{{ nurse.get_full_name }}
{% endfor %}
{% endif %}

Activity Timeline

{% for activity in object.activities.all %}
{{ activity.action }}
{{ activity.created_at|date:"M d, Y H:i" }}
{% if activity.notes %}
{{ activity.notes }}
{% endif %}
{% empty %}

No activity recorded

{% endfor %}
{% endblock %} {% block js %} {% endblock %}