hospital-management/templates/patients/consent_management.html
Marwan Alwali 610e165e17 update
2025-09-04 19:19:52 +03:00

145 lines
7.3 KiB
HTML

{% extends "base.html" %}
{% load static %}
{% block title %}Consent Management - {{ block.super }}{% endblock %}
{% block content %}
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">
<i class="fas fa-file-signature me-2"></i>Consent Management
</h4>
</div>
<div class="card-body">
<!-- Filters -->
<div class="row mb-3">
<div class="col-md-3">
<select name="status" class="form-select">
<option value="">All Status</option>
<option value="PENDING">Pending</option>
<option value="SIGNED">Signed</option>
<option value="EXPIRED">Expired</option>
<option value="REVOKED">Revoked</option>
</select>
</div>
<div class="col-md-3">
<select name="template_id" class="form-select">
<option value="">All Templates</option>
<!-- Template options would be populated -->
</select>
</div>
<div class="col-md-4">
<input type="text" name="search" class="form-control" placeholder="Search patients...">
</div>
<div class="col-md-2">
<button type="submit" class="btn btn-primary w-100">
<i class="fas fa-search"></i>
</button>
</div>
</div>
<!-- Consent Forms List -->
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>Patient</th>
<th>Template</th>
<th>Status</th>
<th>Created</th>
<th>Signed</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for consent in consents %}
<tr>
<td>
<strong>{{ consent.patient.get_full_name }}</strong><br>
<small class="text-muted">MRN: {{ consent.patient.mrn }}</small>
</td>
<td>{{ consent.template.name }}</td>
<td>
{% if consent.status == 'PENDING' %}
<span class="badge bg-warning">Pending</span>
{% elif consent.status == 'SIGNED' %}
<span class="badge bg-success">Signed</span>
{% elif consent.status == 'EXPIRED' %}
<span class="badge bg-danger">Expired</span>
{% elif consent.status == 'REVOKED' %}
<span class="badge bg-secondary">Revoked</span>
{% endif %}
</td>
<td>{{ consent.created_at|date:"M d, Y H:i" }}</td>
<td>
{% if consent.patient_signed_at %}
{{ consent.patient_signed_at|date:"M d, Y H:i" }}
{% else %}
<span class="text-muted">Not signed</span>
{% endif %}
</td>
<td>
<div class="btn-group btn-group-sm">
<button class="btn btn-outline-primary" title="View">
<i class="fas fa-eye"></i>
</button>
{% if consent.status == 'PENDING' %}
<button class="btn btn-outline-success"
title="Sign"
hx-get="{% url 'patients:sign_consent_form' consent.consent_id %}"
hx-target="#sign-consent-modal .modal-body"
data-bs-toggle="modal"
data-bs-target="#sign-consent-modal">
<i class="fas fa-signature"></i>
</button>
{% endif %}
<button class="btn btn-outline-secondary" title="Download">
<i class="fas fa-download"></i>
</button>
</div>
</td>
</tr>
{% empty %}
<tr>
<td colspan="6" class="text-center py-4">
<i class="fas fa-file-signature fa-3x text-muted mb-3"></i>
<h5 class="text-muted">No consent forms found</h5>
<p class="text-muted">No consent forms match your current filters.</p>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<!-- Pagination -->
{% if is_paginated %}
{% include 'partial/pagination.html' %}
{% endif %}
</div>
</div>
</div>
</div>
</div>
<!-- Sign Consent Modal -->
<div class="modal fade" id="sign-consent-modal" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Sign Consent Form</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<!-- Content loaded via HTMX -->
</div>
</div>
</div>
</div>
{% endblock %}