109 lines
4.4 KiB
HTML
109 lines
4.4 KiB
HTML
{% extends "layouts/base.html" %}
|
|
{% load i18n %}
|
|
{% load static %}
|
|
|
|
{% block title %}Survey #{{ survey.id|slice:":8" }} - PX360{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="container-fluid">
|
|
<div class="mb-3">
|
|
<a href="{% url 'surveys:instance_list' %}" class="btn btn-outline-secondary btn-sm">
|
|
<i class="bi bi-arrow-left me-1"></i> Back to Surveys
|
|
</a>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-lg-8">
|
|
<div class="card">
|
|
<div class="card-header bg-info text-white">
|
|
<h5 class="mb-0">{{ survey.survey_template.name }}</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<h6 class="mb-3">Survey Responses</h6>
|
|
|
|
{% for response in responses %}
|
|
<div class="mb-4 pb-3 border-bottom">
|
|
<div class="mb-2">
|
|
<strong>Q{{ forloop.counter }}:</strong> {{ response.question.text }}
|
|
</div>
|
|
<div class="ms-3">
|
|
{% if response.numeric_value %}
|
|
<span class="badge bg-primary">Score: {{ response.numeric_value }}</span>
|
|
{% endif %}
|
|
{% if response.choice_value %}
|
|
<span class="badge bg-secondary">{{ response.choice_value }}</span>
|
|
{% endif %}
|
|
{% if response.text_value %}
|
|
<p class="mb-0 mt-2">{{ response.text_value }}</p>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% empty %}
|
|
<div class="text-center py-5">
|
|
<i class="bi bi-clipboard" style="font-size: 3rem; color: #ccc;"></i>
|
|
<p class="text-muted mt-3">No responses yet</p>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-lg-4">
|
|
<div class="card mb-3">
|
|
<div class="card-header">
|
|
<h6 class="mb-0"><i class="bi bi-info-circle me-2"></i>Survey Information</h6>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="mb-3">
|
|
<strong>Status:</strong><br>
|
|
<span class="badge bg-{{ survey.status }}">{{ survey.get_status_display }}</span>
|
|
</div>
|
|
|
|
{% if survey.total_score %}
|
|
<div class="mb-3">
|
|
<strong>Total Score:</strong><br>
|
|
<h3 class="mb-0 {% if survey.is_negative %}text-danger{% else %}text-success{% endif %}">
|
|
{{ survey.total_score|floatformat:1 }}/5.0
|
|
</h3>
|
|
{% if survey.is_negative %}
|
|
<span class="badge bg-danger mt-2">Negative Feedback</span>
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if survey.sent_at %}
|
|
<div class="mb-3">
|
|
<strong>Sent:</strong><br>
|
|
{{ survey.sent_at|date:"M d, Y H:i" }}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if survey.completed_at %}
|
|
<div class="mb-0">
|
|
<strong>Completed:</strong><br>
|
|
{{ survey.completed_at|date:"M d, Y H:i" }}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h6 class="mb-0"><i class="bi bi-person me-2"></i>Patient Information</h6>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="mb-2">
|
|
<strong>Name:</strong><br>
|
|
{{ survey.patient.get_full_name }}
|
|
</div>
|
|
<div class="mb-0">
|
|
<strong>MRN:</strong><br>
|
|
{{ survey.patient.mrn }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|