{% extends "layouts/base.html" %} {% load i18n %} {% load static %} {% block title %}{{ observation.tracking_code }} - {% trans "Observation Detail" %} - PX360{% endblock %} {% block extra_css %} {% endblock %} {% block content %}
{% trans "Observations" %} {{ observation.tracking_code }} {{ observation.get_status_display }} {{ observation.get_severity_display }} {% if observation.is_anonymous %} {% trans "Anonymous" %} {% endif %} {% if observation.is_overdue %} {% trans "Overdue" %} {% endif %} {% if not observation.sent_to_department %} {% trans "Not Sent to Dept" %} {% endif %}

{% if observation.title %}{{ observation.title }}{% else %}{{ observation.description|truncatewords:10 }}{% endif %}

{{ observation.description }}

{% if observation.description_en %}

{{ observation.description_en }}

{% endif %} {% if observation.emotion or observation.short_description_en or observation.suggested_actions or observation.suggested_action_en %}
{% trans "AI Analysis" %}
{% if observation.emotion and observation.emotion != 'neutral' %}
{{ observation.emotion|title }} {% trans "Confidence" %}: {{ observation.emotion_confidence_percent|floatformat:0 }}%
{% endif %} {% if observation.short_description_en %}

{{ observation.short_description_en }}

{% if observation.short_description_ar %}

{{ observation.short_description_ar }}

{% endif %} {% elif observation.suggested_action_en %}

{{ observation.suggested_action_en }}

{% if observation.suggested_action_ar %}

{{ observation.suggested_action_ar }}

{% endif %}
{% elif observation.suggested_actions %}
{% for action in observation.suggested_actions %}
{{ action.priority }}

{{ action.action_en }}

{% endfor %}
{% endif %}
{% endif %}

{% trans "Category" %}

{{ observation.category.get_localized_name|default:"-" }}

{% trans "Location" %}

{% if observation.legacy_location %}{{ observation.legacy_location.name_en }}{% elif observation.location_text %}{{ observation.location_text }}{% else %}-{% endif %}

{% if observation.legacy_main_section %}

{{ observation.legacy_main_section.name_en }}{% if observation.legacy_subsection %} > {{ observation.legacy_subsection.name_en }}{% endif %}

{% endif %}

{% trans "Incident" %}

{{ observation.incident_datetime|date:"d M Y" }}

{% trans "Deadline" %}

{% if observation.due_at %}{{ observation.due_at|date:"d M Y" }}{% else %}-{% endif %} {% if observation.is_overdue %}{% endif %}

{% if observation.taxonomy_domain or observation.taxonomy_category or observation.taxonomy_subcategory or observation.taxonomy_classification %}
{% trans "Taxonomy" %}: {% if observation.taxonomy_domain %}{{ observation.taxonomy_domain.name_en }}{% endif %} {% if observation.taxonomy_category %}{{ observation.taxonomy_category.name_en }}{% endif %} {% if observation.taxonomy_subcategory %}{{ observation.taxonomy_subcategory.name_en }}{% endif %} {% if observation.taxonomy_classification %}{{ observation.taxonomy_classification.name_en }}{% endif %}
{% endif %}
{% if observation.is_anonymous %}
{% trans "Anonymous submission" %}
{% else %}
{% if observation.reporter_name %} {{ observation.reporter_name }} {% endif %} {% if observation.reporter_phone %} | {{ observation.reporter_phone }} {% endif %} {% if observation.reporter_email %} | {{ observation.reporter_email }} {% endif %} {% if not observation.reporter_name and not observation.reporter_phone and not observation.reporter_email %} {% trans "Reporter info not available" %} {% endif %}
{% endif %}

{% trans "Quick Actions" %}

{% if observation.status == 'new' and not observation.activated_at %} {% if can_convert %}
{% csrf_token %}
{% csrf_token %}
{% else %}

{% trans "Activate this observation to perform actions" %}

{% endif %} {% else %} {% if can_convert %} {% endif %} {% if can_convert and not observation.action_id %} {% trans "Convert" %} {% endif %} {% if can_send_to_department and not observation.department_responded_at %} {% endif %} {% if can_triage and observation.status != 'closed' and observation.status != 'cancelled' and observation.status != 'rejected' %} {% endif %} {% if can_triage %} {% trans "RCA" %} {% endif %} {% trans "QI Project" %} {% if observation.status == 'resolved' or observation.status == 'closed' %} {% if can_triage %}
{% csrf_token %}
{% endif %} {% endif %} {% if can_delete %}
{% csrf_token %}
{% endif %} {% endif %}
{% if can_convert %} {% endif %}

{% trans "Assignment" %}

  • {% trans "Department" %} {{ observation.assigned_department.name|default:_("Not assigned") }}
  • {% trans "Assigned To" %} {{ observation.assigned_to.get_full_name|default:_("Not assigned") }}
{% if observation.person_noted or observation.department_noted or observation.communication_method or observation.communication_datetime or observation.patient_file_number %}

{% trans "Communication" %}

    {% if observation.patient_file_number %}
  • {% trans "File Number" %} {{ observation.patient_file_number }}
  • {% endif %} {% if observation.person_noted %}
  • {% trans "Person Noted" %} {{ observation.person_noted }}
  • {% endif %} {% if observation.department_noted %}
  • {% trans "Department Noted" %} {{ observation.department_noted.name }}
  • {% endif %} {% if observation.communication_method %}
  • {% trans "Via" %} {{ observation.communication_method }}
  • {% endif %} {% if observation.communication_datetime %}
  • {% trans "Contacted At" %} {{ observation.communication_datetime|date:"M d, Y H:i" }}
  • {% endif %}
{% endif %} {% if px_action %}

{% trans "Linked PX Action" %}

{{ px_action.title|truncatewords:10 }}

{% trans "View Action" %}
{% endif %} {% if can_triage %}

{% trans "Triage" %}

{% csrf_token %}
{{ triage_form.assigned_department }}
{{ triage_form.assigned_to }}
{{ triage_form.status }}
{{ triage_form.note }}
{% endif %}
{% include "components/send_to_modal.html" with users=assignable_users departments=departments %} {% include "components/department_response_modal.html" %} {% endblock %}