hospital-management/templates/appointments/confirm_appointment.html
2025-08-12 13:33:25 +03:00

282 lines
17 KiB
HTML

{% extends 'base.html' %}
{% load static %}
{% block title %}Confirm Appointment{% endblock %}
{% block content %}
<div id="content" class="app-content">
<div class="container">
<div class="row justify-content-center">
<div class="col-xl-8">
<ul class="breadcrumb">
<li class="breadcrumb-item"><a href="{% url 'core:dashboard' %}">Dashboard</a></li>
<li class="breadcrumb-item"><a href="{% url 'appointments:appointment_list' %}">Appointments</a></li>
<li class="breadcrumb-item"><a href="{% url 'appointments:appointment_detail' appointment.id %}">{{ appointment.patient.first_name }} {{ appointment.patient.last_name }}</a></li>
<li class="breadcrumb-item active">Confirm</li>
</ul>
<h1 class="page-header">Confirm Appointment</h1>
<!-- Appointment Info -->
<div class="card mb-4">
<div class="card-header">
<h4 class="card-title">Appointment Details</h4>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-6">
<div class="row mb-2">
<div class="col-4"><strong>Patient:</strong></div>
<div class="col-8">{{ appointment.patient.first_name }} {{ appointment.patient.last_name }}</div>
</div>
<div class="row mb-2">
<div class="col-4"><strong>Patient ID:</strong></div>
<div class="col-8">{{ appointment.patient.patient_id }}</div>
</div>
<div class="row mb-2">
<div class="col-4"><strong>Phone:</strong></div>
<div class="col-8">{{ appointment.patient.phone_number|default:"Not provided" }}</div>
</div>
<div class="row mb-2">
<div class="col-4"><strong>Email:</strong></div>
<div class="col-8">{{ appointment.patient.email|default:"Not provided" }}</div>
</div>
</div>
<div class="col-md-6">
<div class="row mb-2">
<div class="col-4"><strong>Date:</strong></div>
<div class="col-8">{{ appointment.appointment_date|date:"M d, Y" }}</div>
</div>
<div class="row mb-2">
<div class="col-4"><strong>Time:</strong></div>
<div class="col-8">{{ appointment.appointment_time|time:"g:i A" }}</div>
</div>
<div class="row mb-2">
<div class="col-4"><strong>Provider:</strong></div>
<div class="col-8">{{ appointment.provider.first_name }} {{ appointment.provider.last_name }}</div>
</div>
<div class="row mb-2">
<div class="col-4"><strong>Department:</strong></div>
<div class="col-8">{{ appointment.department.name }}</div>
</div>
<div class="row mb-2">
<div class="col-4"><strong>Type:</strong></div>
<div class="col-8">{{ appointment.appointment_type.name }}</div>
</div>
</div>
</div>
{% if appointment.notes %}
<div class="row mt-3">
<div class="col-12">
<strong>Appointment Notes:</strong>
<p class="mt-2">{{ appointment.notes }}</p>
</div>
</div>
{% endif %}
</div>
</div>
<!-- Confirmation Form -->
<div class="card">
<div class="card-header">
<h4 class="card-title">Confirmation Details</h4>
</div>
<div class="card-body">
{% if messages %}
{% for message in messages %}
<div class="alert alert-{{ message.tags }} alert-dismissible fade show" role="alert">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div>
{% endfor %}
{% endif %}
<form method="post" class="form-horizontal">
{% csrf_token %}
<div class="row mb-3">
<label class="col-form-label col-md-3">Confirmation Method</label>
<div class="col-md-9">
<select name="confirmation_method" class="form-select">
<option value="phone" {% if form.confirmation_method.value == 'phone' %}selected{% endif %}>Phone Call</option>
<option value="email" {% if form.confirmation_method.value == 'email' %}selected{% endif %}>Email</option>
<option value="sms" {% if form.confirmation_method.value == 'sms' %}selected{% endif %}>SMS/Text</option>
<option value="in_person" {% if form.confirmation_method.value == 'in_person' %}selected{% endif %}>In Person</option>
<option value="online" {% if form.confirmation_method.value == 'online' %}selected{% endif %}>Online Portal</option>
</select>
{% if form.confirmation_method.errors %}
<div class="text-danger">{{ form.confirmation_method.errors.0 }}</div>
{% endif %}
</div>
</div>
<div class="row mb-3">
<label class="col-form-label col-md-3">Confirmed By</label>
<div class="col-md-9">
<input type="text" name="confirmed_by" class="form-control"
value="{{ form.confirmed_by.value|default:request.user.get_full_name }}" readonly>
{% if form.confirmed_by.errors %}
<div class="text-danger">{{ form.confirmed_by.errors.0 }}</div>
{% endif %}
</div>
</div>
<div class="row mb-3">
<label class="col-form-label col-md-3">Patient Contact Verified</label>
<div class="col-md-9">
<div class="form-check">
<input class="form-check-input" type="checkbox" name="contact_verified" id="contact_verified"
{% if form.contact_verified.value %}checked{% endif %}>
<label class="form-check-label" for="contact_verified">
Patient contact information has been verified and is current
</label>
</div>
{% if form.contact_verified.errors %}
<div class="text-danger">{{ form.contact_verified.errors.0 }}</div>
{% endif %}
</div>
</div>
<div class="row mb-3">
<label class="col-form-label col-md-3">Insurance Verified</label>
<div class="col-md-9">
<div class="form-check">
<input class="form-check-input" type="checkbox" name="insurance_verified" id="insurance_verified"
{% if form.insurance_verified.value %}checked{% endif %}>
<label class="form-check-label" for="insurance_verified">
Patient insurance information has been verified
</label>
</div>
{% if form.insurance_verified.errors %}
<div class="text-danger">{{ form.insurance_verified.errors.0 }}</div>
{% endif %}
</div>
</div>
<div class="row mb-3">
<label class="col-form-label col-md-3">Pre-appointment Instructions Given</label>
<div class="col-md-9">
<div class="form-check">
<input class="form-check-input" type="checkbox" name="instructions_given" id="instructions_given"
{% if form.instructions_given.value %}checked{% endif %}>
<label class="form-check-label" for="instructions_given">
Pre-appointment instructions have been provided to the patient
</label>
</div>
{% if form.instructions_given.errors %}
<div class="text-danger">{{ form.instructions_given.errors.0 }}</div>
{% endif %}
</div>
</div>
<div class="row mb-3">
<label class="col-form-label col-md-3">Confirmation Notes</label>
<div class="col-md-9">
<textarea name="confirmation_notes" class="form-control" rows="4"
placeholder="Additional notes about the confirmation process">{{ form.confirmation_notes.value|default:'' }}</textarea>
{% if form.confirmation_notes.errors %}
<div class="text-danger">{{ form.confirmation_notes.errors.0 }}</div>
{% endif %}
</div>
</div>
<div class="row mb-3">
<div class="col-md-9 offset-md-3">
<div class="form-check mb-2">
<input class="form-check-input" type="checkbox" name="send_reminder" id="send_reminder"
{% if form.send_reminder.value %}checked{% endif %}>
<label class="form-check-label" for="send_reminder">
Send appointment reminder 24 hours before appointment
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" name="send_confirmation_email" id="send_confirmation_email"
{% if form.send_confirmation_email.value %}checked{% endif %}>
<label class="form-check-label" for="send_confirmation_email">
Send confirmation email to patient
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-9 offset-md-3">
<button type="submit" class="btn btn-success">
<i class="fa fa-check me-2"></i>Confirm Appointment
</button>
<a href="{% url 'appointments:appointment_detail' appointment.id %}" class="btn btn-secondary ms-2">
<i class="fa fa-arrow-left me-2"></i>Go Back
</a>
</div>
</div>
</form>
</div>
</div>
<!-- Pre-appointment Checklist -->
<div class="card mt-4">
<div class="card-header">
<h4 class="card-title">Pre-appointment Checklist</h4>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-6">
<h6>Patient Preparation:</h6>
<ul>
<li>Arrive 15 minutes early for check-in</li>
<li>Bring valid photo ID</li>
<li>Bring insurance cards</li>
<li>Bring list of current medications</li>
<li>Complete any required forms</li>
</ul>
</div>
<div class="col-md-6">
<h6>Special Instructions:</h6>
<ul>
{% if appointment.appointment_type.requires_fasting %}
<li>Fasting required - no food or drink 8 hours before appointment</li>
{% endif %}
{% if appointment.appointment_type.requires_preparation %}
<li>Special preparation required - see appointment type instructions</li>
{% endif %}
<li>Wear comfortable, loose-fitting clothing</li>
<li>Arrange transportation if sedation will be used</li>
<li>Bring a list of questions for the provider</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block js %}
<script>
$(document).ready(function() {
// Auto-check contact verified if patient has phone and email
var hasPhone = '{{ appointment.patient.phone_number }}' !== '';
var hasEmail = '{{ appointment.patient.email }}' !== '';
if (hasPhone && hasEmail) {
$('#contact_verified').prop('checked', true);
}
// Show/hide reminder option based on appointment date
var appointmentDate = new Date('{{ appointment.appointment_date|date:"Y-m-d" }}');
var now = new Date();
var timeDiff = appointmentDate.getTime() - now.getTime();
var daysDiff = Math.ceil(timeDiff / (1000 * 3600 * 24));
if (daysDiff < 1) {
$('#send_reminder').prop('disabled', true);
$('#send_reminder').next('label').append(' <small class="text-muted">(Appointment is today or in the past)</small>');
}
});
</script>
{% endblock %}