{% extends base_layout %} {% load i18n %} {% load static %} {% block title %}Inquiry #{{ inquiry.id|slice:":8" }} - PX360{% endblock %} {% block extra_css %} {% endblock %} {% block content %}
{% if source_user %} {{ _("Back to My Inquiries")}} {% else %} {{ _("Back to Inquiries")}} {% endif %}

{{ inquiry.subject }}

{{ inquiry.get_status_display }} {% if inquiry.priority %} {{ inquiry.get_priority_display }} {% endif %}

{{ _("ID") }}: {{ inquiry.id|slice:":8" }} {% if inquiry.patient %} | {{ _("Patient") }}: {{ inquiry.patient.get_full_name }} ({{ _("MRN") }}: {{ inquiry.patient.mrn }}) {% else %} | {{ _("Contact") }}: {{ inquiry.contact_name|default:inquiry.contact_email }} {% endif %}

{{ _("Hospital") }}: {{ inquiry.hospital.name_en }} {% if inquiry.department %} | {{ _("Department") }}: {{ inquiry.department.name_en }} {% endif %}

{% if inquiry.due_date %}
{{ _("Due Date")}}

{{ inquiry.due_date|date:"M d, Y H:i" }}

{% if inquiry.is_overdue %}
{{ _("OVERDUE") }}
{% else %} {{ inquiry.due_date|timeuntil }} {{ _("remaining") }} {% endif %}
{% endif %}
{% trans "Inquiry Details" %}
{{ _("Category") }}
{{ inquiry.get_category_display }}
{{ _("Source") }}
{% if inquiry.source %} {{ inquiry.get_source_display }} {% else %} {{ _("N/A")}} {% endif %}
{{ _("Channel") }}
{% if inquiry.channel %} {{ inquiry.get_channel_display }} {% else %} {{ _("N/A")}} {% endif %}
{{ _("Assigned To")}}
{% if inquiry.assigned_to %} {{ inquiry.assigned_to.get_full_name }} {% else %} {{ _("Unassigned") }} {% endif %}

{{ _("Message") }}

{{ inquiry.message|linebreaks }}

{% if inquiry.response %}
{{ _("Response") }}

{{ inquiry.response|linebreaks }}

{{ _("Responded by")}} {{ inquiry.responded_by.get_full_name }} {{ _("on") }} {{ inquiry.responded_at|date:"M d, Y H:i" }}
{% endif %}
{{ _("Created") }}
{{ inquiry.created_at|date:"M d, Y H:i" }}
{{ _("Last Updated")}}
{{ inquiry.updated_at|date:"M d, Y H:i" }}
{% trans "Activity Timeline" %}
{% if timeline %}
{% for update in timeline %}
{{ update.get_update_type_display }} {% if update.created_by %} by {{ update.created_by.get_full_name }} {% endif %}
{{ update.created_at|date:"M d, Y H:i" }}

{{ update.message }}

{% if update.old_status and update.new_status %}
{{ update.old_status }} {{ update.new_status }}
{% endif %}
{% endfor %}
{% else %}

{{ _("No timeline entries yet")}}

{% endif %}
{% trans "Attachments" %}
{% if attachments %}
{% for attachment in attachments %}
{{ attachment.filename }}
Uploaded by {{ attachment.uploaded_by.get_full_name }} on {{ attachment.created_at|date:"M d, Y H:i" }} ({{ attachment.file_size|filesizeformat }}) {% if attachment.description %}
{{ attachment.description }} {% endif %}
{% endfor %}
{% else %}

{{ _("No attachments")}}

{% endif %}
{% if can_edit %}
{% trans "Quick Actions" %}
{% csrf_token %}
{% csrf_token %}
{% endif %}
{% trans "Add Note" %}
{% csrf_token %}
{% if can_edit and inquiry.status != 'resolved' and inquiry.status != 'closed' %}
{% trans "Respond to Inquiry" %}
{% csrf_token %}
{% endif %}
{% trans "Contact Information" %}
{% if inquiry.patient %}
{{ _("Patient")}}
{{ inquiry.patient.get_full_name }}
{{ _("MRN") }}: {{ inquiry.patient.mrn }}
{% if inquiry.patient.phone %}
{{ _("Phone")}}
{{ inquiry.patient.phone }}
{% endif %} {% if inquiry.patient.email %}
{{ _("Email")}}
{{ inquiry.patient.email }}
{% endif %} {% else %} {% if inquiry.contact_name %}
{{ _("Name")}}
{{ inquiry.contact_name }}
{% endif %} {% if inquiry.contact_phone %}
{{ _("Phone")}}
{{ inquiry.contact_phone }}
{% endif %} {% if inquiry.contact_email %}
{{ _("Email")}}
{{ inquiry.contact_email }}
{% endif %} {% endif %}
{% trans "Assignment Info" %}
{{ _("Assigned To")}}
{% if inquiry.assigned_to %} {{ inquiry.assigned_to.get_full_name }}
{{ _("Assigned") }} {{ inquiry.assigned_at|date:"M d, Y H:i"|default:_("N/A") }} {% else %} {{ _("Unassigned") }} {% endif %}
{% if inquiry.responded_by %}
{{ _("Responded By")}}
{{ inquiry.responded_by.get_full_name }}
{{ inquiry.responded_at|date:"M d, Y H:i" }}
{% endif %} {% if inquiry.resolved_by %}
{{ _("Resolved By")}}
{{ inquiry.resolved_by.get_full_name }}
{{ inquiry.resolved_at|date:"M d, Y H:i" }}
{% endif %}
{% endblock %}