{% extends "layouts/base.html" %} {% load i18n %} {% load static %} {% load survey_filters %} {% block title %}{{ _("Survey") }} #{{ survey.id|slice:":8" }} - PX360{% endblock %} {% block extra_css %} {% endblock %} {% block content %}
{{ _("Back to Surveys")}}

{{ survey.survey_template.name }}

{{ _("Survey") }} #{{ survey.id|slice:":8" }} • {{ survey.survey_template.get_survey_type_display }}

{% if survey.status == 'completed' and survey.total_score %}
{{ _("Patient Score") }}

{{ survey.total_score|floatformat:1 }}

/ 5.0
{{ _("Template Average") }}

{{ template_average|floatformat:1 }}

/ 5.0
{% if survey.total_score >= template_average %} {% trans "Above average" %} {% else %} {% trans "Below average" %} {% endif %} {% if survey.is_negative %} {% trans "Negative feedback" %} {% endif %}
{% endif %}
{% trans "Survey Responses" %}
{% for response in responses %}
Q{{ forloop.counter }} {{ response.question.text }}
{% trans "Question type" %}: {{ response.question.get_question_type_display }}
{% if response.numeric_value %}
{{ response.numeric_value }}
{% trans "out of" %} 5
{% endif %}
{% if response.question.question_type == 'rating' %}
{% trans "Your rating" %}: {% for i in "12345" %} {% if forloop.counter <= response.numeric_value|floatformat:0 %} {% else %} {% endif %} {% endfor %}
{% if response.question.id in question_stats %} {% with question_stat=question_stats|get_item:response.question.id %}
{% trans "Average" %}: {{ question_stat.average }} {{ question_stat.total_responses }} {% trans "responses" %}
{% endwith %} {% endif %}
{% endif %} {% if response.question.question_type in 'multiple_choice,single_choice' %}
{% trans "Your response" %}: {{ response.choice_value }}
{% if response.question.id in question_stats and question_stats|get_item:response.question.id.type == 'choice' %}
{% trans "Response Distribution" %}: {% for option in question_stats|get_item:response.question.id.options %}
{{ option.value }} {{ option.count }} ({{ option.percentage }}%)
{% endfor %}
{% endif %}
{% endif %} {% if response.text_value %}
{% trans "Comment" %} {{ response.text_value|length }} {% trans "characters" %}

{{ response.text_value|linebreaks }}

{% endif %}
{% empty %}

{{ _("No responses yet")}}

{% endfor %}
{% if related_surveys %}
{% trans "Related Surveys from Patient" %}
{% for related in related_surveys %} {% endfor %}
{% trans "Survey" %} {% trans "Type" %} {% trans "Score" %} {% trans "Date" %} {% trans "Actions" %}
{{ related.survey_template.name }} {{ related.survey_template.get_survey_type_display }} {{ related.total_score|floatformat:1 }} {{ related.completed_at|date:"M d, Y" }}
{% endif %}
{% trans "Survey Information" %}
{% trans "Status" %}:
{% if survey.status == 'completed' %} {{ survey.get_status_display }} {% elif survey.status == 'sent' %} {{ survey.get_status_display }} {% elif survey.status == 'active' %} {{ survey.get_status_display }} {% elif survey.status == 'cancelled' %} {{ survey.get_status_display }} {% else %} {{ survey.get_status_display }} {% endif %}
{% if survey.total_score %}
{% trans "Total Score" %}:

{{ survey.total_score|floatformat:1 }}/5.0

{% if survey.is_negative %} {% trans "Negative Feedback" %} {% endif %}
{% endif %} {% if survey.sent_at %}
{% trans "Sent" %}:
{{ survey.sent_at|date:"M d, Y H:i" }}
{% endif %} {% if survey.completed_at %}
{% trans "Completed" %}:
{{ survey.completed_at|date:"M d, Y H:i" }}
{% endif %}
{% trans "Survey Type" %}:
{{ survey.survey_template.get_survey_type_display }}
{% if survey.survey_template.hospital %}
{% trans "Hospital" %}:
{{ survey.survey_template.hospital.name }}
{% endif %}
{% trans "Patient Information" %}
{% trans "Name" %}:
{{ survey.patient.get_full_name }}
{% trans "Phone" %}:
{{ survey.patient.phone }}
{% trans "MRN" %}:
{{ survey.patient.mrn }}
{% if survey.patient.email %}
{% trans "Email" %}:
{{ survey.patient.email }}
{% endif %}
{% if survey.journey_instance %}
{% trans "Journey Information" %}
{% trans "Journey" %}:
{{ survey.journey_instance.journey_template.name }}
{% if survey.journey_stage_instance %}
{% trans "Stage" %}:
{{ survey.journey_stage_instance.stage_template.name }}
{% endif %}
{% endif %} {% if survey.is_negative %}
{% trans "Follow-up Actions" %}
{% if not survey.patient_contacted %}
{% trans "Action Required" %}: {% trans "Contact patient to discuss negative feedback" %}.
{% csrf_token %}
{% else %}
{% trans "Patient Contacted" %}
{% trans "By" %} {{ survey.patient_contacted_by.get_full_name }} {% trans "on" %} {{ survey.patient_contacted_at|date:"M d, Y H:i" }}
{% trans "Contact Notes" %}:

{{ survey.contact_notes }}

{% trans "Status" %}:
{% if survey.issue_resolved %} {% trans "Issue Resolved" %} {% else %} {% trans "Issue Discussed" %} {% endif %}
{% if not survey.satisfaction_feedback_sent %}
{% trans "Send Satisfaction Feedback" %}

{% trans "Send a feedback form to patient to assess their satisfaction with how their concerns were addressed" %}.

{% csrf_token %}
{% else %}
{% trans "Satisfaction Feedback Sent" %}
{{ survey.satisfaction_feedback_sent_at|date:"M d, Y H:i" }}
{% if survey.follow_up_feedbacks.exists %}
{% trans "Related Feedback" %}: {% for feedback in survey.follow_up_feedbacks.all %} {% endfor %}
{% endif %} {% endif %} {% endif %}
{% endif %}
{% endblock %}