{% load i18n %}

{% trans "Resolution" %}

{% if complaint.status == 'resolved' or complaint.status == 'closed' %}

{% trans "Complaint Resolved" %}

{% if complaint.resolution %}

{{ complaint.resolution|linebreaks }}

{% endif %} {% if complaint.resolution_outcome %}

{% trans "Resolution Outcome" %}

{% if complaint.resolution_outcome == 'patient' %} {% trans "Patient" %} {% elif complaint.resolution_outcome == 'hospital' %} {% trans "Hospital" %} {% else %} {% trans "Other" %} {% endif %} {% if complaint.resolution_outcome == 'other' and complaint.resolution_outcome_other %} ({{ complaint.resolution_outcome_other }}) {% endif %}
{% endif %}

{% trans "Resolved by:" %} {{ complaint.resolved_by.get_full_name|default:"-" }}

{% trans "Resolved at:" %} {{ complaint.resolved_at|date:"M d, Y H:i"|default:"-" }}

{% if complaint.pending_external_set_at %}

{% trans "Pending External since:" %} {{ complaint.pending_external_set_at|date:"M d, Y H:i" }}

{% endif %}

{% trans "Patient Satisfaction" %}

{% if complaint.satisfaction %}
{% if complaint.satisfaction == 'satisfied' %} {% elif complaint.satisfaction == 'neutral' %} {% elif complaint.satisfaction == 'dissatisfied' %} {% else %} {% endif %} {{ complaint.get_satisfaction_display }} {% if complaint.satisfaction_set_at %} {{ complaint.satisfaction_set_at|date:"Y-m-d H:i" }} {% endif %}
{% endif %} {% if can_edit %}
{% csrf_token %}

{% trans "Set satisfaction based on patient follow-up call:" %}

{% elif not complaint.satisfaction %}

{% trans "No satisfaction feedback recorded yet." %}

{% endif %}
{% else %}

{% trans "Pending Resolution" %}

{% trans "This complaint has not been resolved yet." %}

{% if can_edit and complaint.is_active_status %} {% if complaint.assigned_to == current_user %}
{% csrf_token %} {% if explanations %}
{% endif %}
{% trans "This resolution will be sent to the patient via SMS and Email upon complaint closure." %}

{% trans "Who was in wrong / who was in right?" %}

{% else %}

{% trans "Activate this complaint to resolve it" %}

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