{% extends 'layouts/base.html' %} {% load i18n %} {% block title %}{% trans "Inquiry" %} #{{ inquiry.reference_number|truncatechars:15 }} - PX360{% endblock %} {% block extra_css %} {% endblock %} {% block content %}
{% if source_user %} {% trans "Back to My Inquiries" %} {% else %} {% trans "Back to Inquiries" %} {% endif %}

{{ inquiry.subject }}

{% trans "Inquiry" %} {{ inquiry.get_status_display }} {% if inquiry.priority %} {{ inquiry.get_priority_display }} {% endif %}

{{ inquiry.message|truncatewords:30 }}

{{ inquiry.reference_number|truncatechars:15 }} {{ inquiry.created_at|date:"Y-m-d" }}
{% if can_respond %} {% endif %}

{% trans "Inquiry Details" %}

{{ inquiry.message|linebreaks }}

{% trans "AI Analysis" %}

{% if can_respond and not inquiry.short_description_en %} {% endif %}
{% if inquiry.short_description_en %} {% if inquiry.emotion and inquiry.emotion != 'neutral' %}

{% trans "Emotion Analysis" %}

{{ inquiry.get_emotion_display }} {% trans "Confidence" %}: {{ inquiry.emotion_confidence_percent|floatformat:0 }}%
{% trans "Intensity" %} {{ inquiry.emotion_intensity|floatformat:2 }} / 1.0
{% endif %} {% if inquiry.short_description_en %}

{% trans "AI Summary (English)" %}

{{ inquiry.short_description_en }}

{% endif %} {% if inquiry.short_description_ar %}

{% trans "AI Summary (Arabic)" %}

{{ inquiry.short_description_ar }}

{% endif %} {% else %}

{% trans "AI analysis is running. Please refresh the page shortly." %}

{% endif %}
{% if inquiry.response %}

{% trans "Response" %} {% if inquiry.response_sent_at %} {% trans "Sent to inquirer" %} {% endif %}

{% if inquiry.responded_by %}{{ inquiry.responded_by.get_full_name|default:inquiry.responded_by.email }}{% endif %} {% if inquiry.response_sent_at %}{{ inquiry.response_sent_at|date:"Y-m-d H:i" }}{% else %}{{ inquiry.responded_at|date:"Y-m-d H:i" }}{% endif %}
{% if inquiry.response_en %}

English

{{ inquiry.response_en|linebreaks }}

{% endif %} {% if inquiry.response_ar %}

العربية

{{ inquiry.response_ar|linebreaks }}

{% endif %} {% if not inquiry.response_en and not inquiry.response_ar %}

{{ inquiry.response|linebreaks }}

{% endif %}
{% endif %}

{% trans "Timeline" %}

{% trans "Inquiry Created" %}

{% trans "Created by" %} {% if inquiry.created_by %}{{ inquiry.created_by.get_full_name|default:inquiry.created_by.email }}{% endif %}

{{ inquiry.created_at|date:"Y-m-d H:i" }}

{% for update in inquiry.updates.all %}

{% if update.update_type == 'status_change' %}{% trans "Status Changed" %} {% elif update.update_type == 'response' %}{% trans "Response" %} {% elif update.update_type == 'communication' %}{% trans "Communication" %} {% else %}{% trans "Note" %}{% endif %}

{{ update.message|truncatewords:30 }}

{% if update.created_by %}

{% trans "by" %} {{ update.created_by.get_full_name|default:update.created_by.email }}

{% endif %}

{{ update.created_at|date:"Y-m-d H:i" }}

{% endfor %}

{% trans "Contact Information" %}

{% trans "Name" %}

{{ inquiry.contact_name|default:"-" }}

{% trans "Phone" %}

{{ inquiry.contact_phone|default:"-" }}

{% trans "Email" %}

{{ inquiry.contact_email|default:"-" }}

{% trans "Organization" %}

{% trans "Hospital" %}

{{ inquiry.hospital.name }}

{% if inquiry.department %}

{% trans "Department" %}

{{ inquiry.department.name }}

{% endif %}

{% trans "Category" %}

{{ inquiry.get_category_display|default:"-" }}

{% if inquiry.priority %}

{% trans "Priority" %}

{{ inquiry.get_priority_display }}
{% endif %}

{% trans "Actions" %}

{% if can_respond %} {% endif %} {% if inquiry.status != 'closed' %} {% trans "Edit Inquiry" %} {% endif %} {% trans "Initiate RCA" %}
{% if linked_rcas %}

{% trans "Root Cause Analyses" %}

{% endif %}
{% endblock %}