173 lines
9.2 KiB
HTML
173 lines
9.2 KiB
HTML
{% extends "layouts/base.html" %}
|
|
{% load i18n %}
|
|
|
|
{% block title %}{% if adverse_action %}{% trans "Edit Adverse Action" %}{% else %}{% trans "Report Adverse Action" %}{% endif %} - PX360{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="p-6 max-w-4xl mx-auto">
|
|
<!-- Header -->
|
|
<div class="mb-6">
|
|
<div class="flex items-center gap-4">
|
|
<a href="{% url 'complaints:complaint_detail' complaint.id %}" class="text-[#64748b] hover:text-[#005696]">
|
|
<i data-lucide="arrow-left" class="w-6 h-6"></i>
|
|
</a>
|
|
<div>
|
|
<h1 class="text-2xl font-bold text-[#005696]">
|
|
{% if adverse_action %}{% trans "Edit Adverse Action" %}{% else %}{% trans "Report Adverse Action" %}{% endif %}
|
|
</h1>
|
|
<p class="text-[#64748b] mt-1">
|
|
{% trans "Complaint" %}: {{ complaint.reference_number }}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Form -->
|
|
<div class="bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden">
|
|
<form method="post" class="p-6">
|
|
{% csrf_token %}
|
|
|
|
<!-- Action Type -->
|
|
<div class="mb-6">
|
|
<label class="block text-sm font-bold text-gray-700 mb-2">
|
|
{% trans "Action Type" %}
|
|
<span class="text-red-500">*</span>
|
|
</label>
|
|
<select name="action_type" required
|
|
class="w-full px-4 py-3 border-2 border-gray-200 rounded-xl text-gray-800 focus:ring-2 focus:ring-[#005696] focus:border-transparent transition">
|
|
{% for value, label in action_type_choices %}
|
|
<option value="{{ value }}" {% if adverse_action and adverse_action.action_type == value %}selected{% endif %}>
|
|
{{ label }}
|
|
</option>
|
|
{% endfor %}
|
|
</select>
|
|
<p class="mt-1 text-sm text-[#64748b]">
|
|
{% trans "Select the type of adverse action that occurred." %}
|
|
</p>
|
|
</div>
|
|
|
|
<!-- Severity -->
|
|
<div class="mb-6">
|
|
<label class="block text-sm font-bold text-gray-700 mb-2">
|
|
{% trans "Severity Level" %}
|
|
<span class="text-red-500">*</span>
|
|
</label>
|
|
<div class="grid grid-cols-2 md:grid-cols-4 gap-3">
|
|
{% for value, label in severity_choices %}
|
|
<label class="relative cursor-pointer">
|
|
<input type="radio" name="severity" value="{{ value }}"
|
|
{% if adverse_action and adverse_action.severity == value %}checked{% elif not adverse_action and value == 'medium' %}checked{% endif %}
|
|
class="peer sr-only" required>
|
|
<div class="border-2 border-gray-200 rounded-xl p-4 text-center hover:border-[#005696] transition peer-checked:border-[#005696] peer-checked:bg-[#eef6fb]">
|
|
{% if value == 'low' %}
|
|
<i data-lucide="arrow-down" class="w-6 h-6 mx-auto mb-2 text-green-500"></i>
|
|
{% elif value == 'medium' %}
|
|
<i data-lucide="arrow-right" class="w-6 h-6 mx-auto mb-2 text-yellow-500"></i>
|
|
{% elif value == 'high' %}
|
|
<i data-lucide="arrow-up" class="w-6 h-6 mx-auto mb-2 text-orange-500"></i>
|
|
{% else %}
|
|
<i data-lucide="alert-triangle" class="w-6 h-6 mx-auto mb-2 text-red-500"></i>
|
|
{% endif %}
|
|
<span class="text-sm font-medium">{{ label }}</span>
|
|
</div>
|
|
</label>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Incident Date -->
|
|
<div class="mb-6">
|
|
<label class="block text-sm font-bold text-gray-700 mb-2">
|
|
{% trans "Incident Date & Time" %}
|
|
<span class="text-red-500">*</span>
|
|
</label>
|
|
<input type="datetime-local" name="incident_date" required
|
|
value="{% if adverse_action %}{{ adverse_action.incident_date|date:'Y-m-d\\TH:i' }}{% else %}{% now 'Y-m-d\\TH:i' %}{% endif %}"
|
|
class="w-full px-4 py-3 border-2 border-gray-200 rounded-xl text-gray-800 focus:ring-2 focus:ring-[#005696] focus:border-transparent transition">
|
|
</div>
|
|
|
|
<!-- Location -->
|
|
<div class="mb-6">
|
|
<label class="block text-sm font-bold text-gray-700 mb-2">
|
|
{% trans "Location" %}
|
|
</label>
|
|
<input type="text" name="location"
|
|
value="{{ adverse_action.location|default:'' }}"
|
|
class="w-full px-4 py-3 border-2 border-gray-200 rounded-xl text-gray-800 focus:ring-2 focus:ring-[#005696] focus:border-transparent transition"
|
|
placeholder="{% trans 'e.g., Emergency Room, Clinic B, Main Reception' %}">
|
|
</div>
|
|
|
|
<!-- Description -->
|
|
<div class="mb-6">
|
|
<label class="block text-sm font-bold text-gray-700 mb-2">
|
|
{% trans "Description" %}
|
|
<span class="text-red-500">*</span>
|
|
</label>
|
|
<textarea name="description" rows="4" required
|
|
class="w-full px-4 py-3 border-2 border-gray-200 rounded-xl text-gray-800 focus:ring-2 focus:ring-[#005696] focus:border-transparent transition"
|
|
placeholder="{% trans 'Describe what happened to the patient...' %}">{{ adverse_action.description|default:'' }}</textarea>
|
|
</div>
|
|
|
|
<!-- Patient Impact -->
|
|
<div class="mb-6">
|
|
<label class="block text-sm font-bold text-gray-700 mb-2">
|
|
{% trans "Impact on Patient" %}
|
|
</label>
|
|
<textarea name="patient_impact" rows="3"
|
|
class="w-full px-4 py-3 border-2 border-gray-200 rounded-xl text-gray-800 focus:ring-2 focus:ring-[#005696] focus:border-transparent transition"
|
|
placeholder="{% trans 'Describe the physical, emotional, or financial impact on the patient...' %}">{{ adverse_action.patient_impact|default:'' }}</textarea>
|
|
</div>
|
|
|
|
<!-- Involved Staff -->
|
|
<div class="mb-6">
|
|
<label class="block text-sm font-bold text-gray-700 mb-2">
|
|
{% trans "Involved Staff" %}
|
|
</label>
|
|
<select name="involved_staff" multiple
|
|
class="w-full px-4 py-3 border-2 border-gray-200 rounded-xl text-gray-800 focus:ring-2 focus:ring-[#005696] focus:border-transparent transition"
|
|
size="5">
|
|
{% for staff in staff_list %}
|
|
<option value="{{ staff.id }}" {% if staff.id in selected_staff %}selected{% endif %}>
|
|
{{ staff.get_full_name }} - {{ staff.department.name|default:staff.job_title|default:staff.employee_id }}
|
|
</option>
|
|
{% endfor %}
|
|
</select>
|
|
<p class="mt-1 text-sm text-[#64748b]">
|
|
{% trans "Hold Ctrl/Cmd to select multiple staff members." %}
|
|
</p>
|
|
</div>
|
|
|
|
<!-- Info Box -->
|
|
<div class="mb-6 bg-amber-50 border border-amber-200 rounded-xl p-4">
|
|
<div class="flex items-start gap-3">
|
|
<i data-lucide="alert-triangle" class="w-5 h-5 text-amber-500 flex-shrink-0 mt-0.5"></i>
|
|
<div>
|
|
<h4 class="font-medium text-amber-800">{% trans "Important Note" %}</h4>
|
|
<p class="text-sm text-amber-700 mt-1">
|
|
{% trans "Adverse actions are serious incidents where a patient experiences negative treatment because of a complaint. This information is used to identify patterns and prevent retaliation against patients." %}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Actions -->
|
|
<div class="flex items-center justify-end gap-3 pt-6 border-t border-gray-100">
|
|
<a href="{% url 'complaints:complaint_detail' complaint.id %}" class="px-6 py-3 border border-gray-200 text-gray-700 rounded-xl font-semibold hover:bg-gray-50 transition">
|
|
{% trans "Cancel" %}
|
|
</a>
|
|
<button type="submit" class="px-8 py-3 bg-[#005696] text-white rounded-xl font-semibold hover:bg-[#007bbd] transition flex items-center gap-2">
|
|
<i data-lucide="{% if adverse_action %}save{% else %}plus{% endif %}" class="w-5 h-5"></i>
|
|
{% if adverse_action %}{% trans "Save Changes" %}{% else %}{% trans "Report Adverse Action" %}{% endif %}
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
lucide.createIcons();
|
|
});
|
|
</script>
|
|
{% endblock %}
|