{% extends "layouts/base.html" %} {% load i18n %} {% load survey_filters %} {% block title %}{{ department.get_localized_name }} - {% trans "Department" %} - PX360{% endblock %} {% block extra_css %} {% endblock %} {% block content %}
{% trans "Departments" %} {{ department.get_localized_name }}

{{ department.get_localized_name }}

{% if department.name_ar %}

{{ department.name_ar }}

{% endif %}
{{ department.code }} {% if department.category %} {% if department.category == 'nursing' %} {% elif department.category == 'support_services' %} {% elif department.category == 'medical' %} {% elif department.category == 'non_medical' %} {% endif %} {{ department.get_category_display }} {% endif %} {{ department.hospital.name }} {% if department.location %} {{ department.location }} {% endif %} {% if department.phone %} {{ department.phone }} {% endif %} {% if department.email %} {{ department.email }} {% endif %} {% if department.parent %} {% trans "Sub of" %} {{ department.parent.get_localized_name }} {% endif %}

{% trans "Manager" %}

{% if department.manager %}

{{ department.manager.get_full_name }}

{% else %}

{% trans "Not assigned" %}

{% endif %}
{% if department.manager %}
{% elif can_edit %} {% endif %} {% if can_edit %} {% endif %}

{% trans "Champion" %}

{% if department.respondent %}

{{ department.respondent.get_full_name }}

{% else %}

{% trans "Not set" %}

{% endif %}
{% if department.respondent %}
{% elif can_assign %} {% endif %} {% if can_assign %} {% endif %}
{% if can_edit %} {% trans "Edit Department" %} {% endif %}

{% trans "Staff" %}

{{ stats.staff_count }}

{% trans "Open Complaints" %}

{{ stats.open_complaints }}

{{ stats.total_complaints }} {% trans "total" %}

{% trans "Pending Inquiries" %}

{{ stats.pending_inquiries }}

{{ stats.total_inquiries }} {% trans "total" %}

{% trans "Open Observations" %}

{{ stats.open_observations }}

{{ stats.total_observations }} {% trans "total" %}

{% if pending_actions %}

{% trans "Pending Actions" %}

{{ pending_actions_count }} {% trans "items awaiting response" %}

{% for action in pending_actions %} {% endfor %}
{% trans "Type" %} {% trans "Reference" %} {% trans "Subject" %} {% trans "SLA Deadline" %} {% trans "Action" %}
{{ action.type_label }} {{ action.reference }} {{ action.subject|truncatechars:50 }} {% if action.sla_due_at %} {% if action.is_overdue %} {{ action.sla_due_at|date:"M d, H:i" }} {% else %} {{ action.sla_due_at|date:"M d, H:i" }} {% endif %} {% else %} - {% endif %} {% if action.type == 'complaint_department_response' %} {% else %} {% trans "Respond" %} {% endif %}
{% endif %} {% if staff_head %}
{{ staff_head.first_name|truncatechars:1 }}{{ staff_head.last_name|truncatechars:1 }}
{{ staff_head.get_localized_name }} {% trans "Department Head" %}

{{ staff_head.get_localized_job_title }} · {{ staff_head.employee_id }}

{% endif %}
{% if not user.is_department_respondent or user.is_px_admin or user.is_hospital_admin or user.is_department_manager %} {% endif %}
{% if search_query or complaint_status_filter or inquiry_status_filter or observation_status_filter %} {% trans "Clear" %} {% endif %}
{% if not user.is_department_respondent or user.is_px_admin or user.is_hospital_admin or user.is_department_manager %}
{% for s in staff_list %} {% empty %} {% endfor %}
{% trans "Name" %} {% trans "Job Title" %} {% trans "Employee ID" %} {{ department.get_category_display }} {% trans "User Account" %} {% trans "Complaints" %}
{{ s.first_name|truncatechars:1 }}{{ s.last_name|truncatechars:1 }}
{{ s.get_localized_name }} {% if s.is_head %} {% trans "HEAD" %} {% endif %}
{{ s.get_localized_job_title }} {{ s.employee_id }} {{ s.get_department_type_display }} {% if s.user %} {% for g in s.user.groups.all %} {{ g.name }} {% endfor %} {% else %} {% trans "No account" %} {% endif %} {% with count=staff_complaint_counts|get_item:s.pk %} {% if count %} {{ count }} {% else %} 0 {% endif %} {% endwith %}
{% trans "No staff members in this department" %}
{% endif %}
{% for c in complaints %} {% empty %} {% endfor %}
{% trans "Reference" %} {% trans "Classification" %} {% trans "Staff" %} {% trans "Patient" %} {% trans "Assigned To" %} {% trans "Status" %} {% trans "Created" %}
{{ c.reference_number }}
{% if c.domain %}{{ c.domain.get_localized_name }}{% endif %} {% if c.category %}{{ c.category.get_localized_name }}{% endif %} {% if c.subcategory_obj %}{{ c.subcategory_obj.get_localized_name }}{% endif %} {% if c.classification_obj %}{{ c.classification_obj.get_localized_name }}{% endif %} {% if not c.domain and not c.category and not c.subcategory_obj and not c.classification_obj %}-{% endif %}
{% if c.involved_staff.all %} {% for inv in c.involved_staff.all %}
{{ inv.staff.get_localized_name }}
{% endfor %} {% elif c.staff %}
{{ c.staff.get_localized_name }}
{% else %} - {% endif %}
{{ c.patient.mrn|default:"-" }} {{ c.assigned_to.get_full_name|default:"-" }} {{ c.get_status_display }} {{ c.created_at|date:"Y-m-d" }}
{% trans "No complaints for this department" %}
{% if user.is_department_respondent and not user.is_px_admin and not user.is_hospital_admin and not user.is_department_manager %}
{% for i in inquiries %}

{{ i.message }}

{% if i.status in 'open,in_progress' %} {% endif %}
{% empty %}

{% trans "No pending inquiries" %}

{% endfor %}
{% else %} {% for i in inquiries %} {% empty %} {% endfor %}
{% trans "Reference" %} {% trans "Subject" %} {% trans "Contact" %} {% trans "Assigned To" %} {% trans "Status" %} {% trans "Actions" %}
{{ i.reference_number }} {{ i.subject }} {{ i.contact_name|default:"-" }} {{ i.assigned_to.get_full_name|default:"-" }} {{ i.get_status_display }}
{% trans "View" %} {% if can_respond and i.status in 'open,in_progress' %} {% trans "Respond" %} {% endif %}
{% trans "No inquiries for this department" %}
{% endif %}
{% for o in observations %} {% empty %} {% endfor %}
{% trans "Tracking Code" %} {% trans "Title" %} {% trans "Severity" %} {% trans "Assigned To" %} {% trans "Status" %} {% trans "Created" %}
{{ o.tracking_code }} {{ o.title|default:"-" }} {{ o.get_severity_display }} {{ o.assigned_to.get_full_name|default:"-" }} {{ o.get_status_display }} {{ o.created_at|date:"Y-m-d" }}
{% trans "No observations for this department" %}

{% trans "Loading analytics..." %}

{% for item in standards_data %} {% empty %} {% endfor %}
{% trans "Code" %} {% trans "Title" %} {% trans "Activity Type" %} {% trans "Status" %} {% trans "Evidence" %}
{{ item.standard.code }} {{ item.standard.title }} {% if item.standard.activity_type %} {{ item.standard.activity_type.name }} {% else %} - {% endif %} {% if not item.standard.is_assessable or item.standard.is_heading %} {% trans "Informational" %} {% else %} {% endif %} {% if not item.standard.is_assessable or item.standard.is_heading %} - {% else %} {% endif %}
{% trans "No standards for this department" %}
{% endblock %}