{% extends "base.html" %} {% load static %} {% block title %}Bed {{ object.bed_number }} Details{% endblock %} {% block content %}

Bed {{ object.bed_number }} Details

Bed Information

{{ object.get_status_display }}
Bed Number: {{ object.bed_number }}
Ward: {{ object.ward.name }}
Room: {{ object.room_number|default:"Not assigned" }}
Bed Type: {{ object.get_bed_type_display }}
Status: {{ object.get_status_display }}
Features: {% if object.has_oxygen %} Oxygen {% endif %} {% if object.has_suction %} Suction {% endif %} {% if object.has_monitor %} Monitor {% endif %} {% if object.is_isolation %} Isolation {% endif %} {% if not object.has_oxygen and not object.has_suction and not object.has_monitor and not object.is_isolation %} Standard bed {% endif %}
Last Cleaned: {{ object.last_cleaned|date:"M d, Y g:i A"|default:"Not recorded" }}
Last Maintenance: {{ object.last_maintenance|date:"M d, Y g:i A"|default:"Not recorded" }}
Created: {{ object.created_at|date:"M d, Y g:i A" }}
Last Updated: {{ object.updated_at|date:"M d, Y g:i A" }}
{% if object.notes %}
Notes:
{{ object.notes }}
{% endif %}
{% if object.current_patient %}

Current Patient

{% if object.current_patient.profile_picture %} {{ object.current_patient.get_full_name }} {% else %}
{{ object.current_patient.first_name|first }}{{ object.current_patient.last_name|first }}
{% endif %}
{{ object.current_patient.get_full_name }}
MRN: {{ object.current_patient.medical_record_number }}
DOB: {{ object.current_patient.date_of_birth|date:"M d, Y" }}
Admitted: {{ object.current_admission.admission_date|date:"M d, Y g:i A" }}
{% endif %}

Bed History

{% if bed_history %}
{% for history in bed_history %} {% endfor %}
Date Action Patient Duration Notes
{{ history.date|date:"M d, Y" }}
{{ history.date|time:"g:i A" }}
{{ history.get_action_display }} {% if history.patient %} {{ history.patient.get_full_name }}
{{ history.patient.medical_record_number }}
{% else %} System action {% endif %}
{% if history.duration %} {{ history.duration }} {% else %} - {% endif %} {% if history.notes %} {{ history.notes }} {% else %} - {% endif %}
{% else %}
No History Available

No bed history records found for this bed.

{% endif %}
Quick Actions
{% if object.status == 'available' %} {% elif object.status == 'occupied' %} {% endif %}
Statistics
Occupancy Rate (30 days) {{ bed_stats.occupancy_rate|default:0 }}%
{{ bed_stats.total_admissions|default:0 }}
Total Admissions
{{ bed_stats.avg_stay_days|default:0 }}
Avg Stay (days)
Maintenance Schedule
{% if maintenance_schedule %} {% for maintenance in maintenance_schedule %}
{{ maintenance.get_type_display }}
{{ maintenance.scheduled_date|date:"M d, Y g:i A" }}
{{ maintenance.get_status_display }}
{% endfor %} {% else %}
No scheduled maintenance
{% endif %}
Ward Information
Department: {{ object.ward.department.name }}
Capacity: {{ object.ward.total_beds }} beds
Available: {{ object.ward.available_beds }} beds
Occupancy: {{ object.ward.occupancy_rate }}%
{% endblock %}