202 lines
11 KiB
HTML
202 lines
11 KiB
HTML
{% extends "base.html" %}
|
|
{% load static %}
|
|
|
|
{% block title %}Care Plans - {{ 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-clipboard-list me-2"></i>Care Plan Management
|
|
</h4>
|
|
</div>
|
|
|
|
<div class="card-body">
|
|
<!-- Filters -->
|
|
<div class="row mb-3">
|
|
<div class="col-md-2">
|
|
<select name="plan_type" class="form-select">
|
|
<option value="">All Types</option>
|
|
{% for value, label in plan_types %}
|
|
<option value="{{ value }}">{{ label }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<select name="status" class="form-select">
|
|
<option value="">All Status</option>
|
|
{% for value, label in plan_statuses %}
|
|
<option value="{{ value }}">{{ label }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<input type="date" name="date_from" class="form-control" placeholder="From Date">
|
|
</div>
|
|
<div class="col-md-2">
|
|
<input type="date" name="date_to" class="form-control" placeholder="To Date">
|
|
</div>
|
|
<div class="col-md-3">
|
|
<input type="text" name="search" class="form-control" placeholder="Search patients, care plans...">
|
|
</div>
|
|
<div class="col-md-1">
|
|
<button type="submit" class="btn btn-primary w-100">
|
|
<i class="fas fa-search"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Care Plans Table -->
|
|
<div class="table-responsive">
|
|
<table class="table table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th>Patient</th>
|
|
<th>Care Plan</th>
|
|
<th>Type</th>
|
|
<th>Primary Provider</th>
|
|
<th>Status</th>
|
|
<th>Start Date</th>
|
|
<th>Progress</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for plan in care_plans %}
|
|
<tr>
|
|
<td>
|
|
<strong>{{ plan.patient.get_full_name }}</strong><br>
|
|
<small class="text-muted">
|
|
MRN: {{ plan.patient.mrn }} •
|
|
{{ plan.patient.age }}y {{ plan.patient.get_gender_display }}
|
|
</small>
|
|
</td>
|
|
<td>
|
|
<strong>{{ plan.title }}</strong>
|
|
{% if plan.description %}
|
|
<br><small class="text-muted">{{ plan.description|truncatechars:60 }}</small>
|
|
{% endif %}
|
|
</td>
|
|
<td>{{ plan.get_plan_type_display }}</td>
|
|
<td>
|
|
{{ plan.primary_provider.get_full_name }}
|
|
{% if plan.care_team.count > 1 %}
|
|
<br><small class="text-muted">
|
|
+{{ plan.care_team.count|add:"-1" }} team member{{ plan.care_team.count|add:"-1"|pluralize }}
|
|
</small>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{% if plan.status == 'ACTIVE' %}
|
|
<span class="badge bg-success">Active</span>
|
|
{% elif plan.status == 'COMPLETED' %}
|
|
<span class="badge bg-primary">Completed</span>
|
|
{% elif plan.status == 'ON_HOLD' %}
|
|
<span class="badge bg-warning">On Hold</span>
|
|
{% elif plan.status == 'CANCELLED' %}
|
|
<span class="badge bg-danger">Cancelled</span>
|
|
{% elif plan.status == 'DRAFT' %}
|
|
<span class="badge bg-secondary">Draft</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{{ plan.start_date|date:"M d, Y" }}
|
|
{% if plan.target_end_date %}
|
|
<br><small class="text-muted">
|
|
Target: {{ plan.target_end_date|date:"M d, Y" }}
|
|
</small>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{% if plan.completion_percentage %}
|
|
<div class="progress" style="height: 20px;">
|
|
<div class="progress-bar"
|
|
role="progressbar"
|
|
style="width: {{ plan.completion_percentage }}%"
|
|
aria-valuenow="{{ plan.completion_percentage }}"
|
|
aria-valuemin="0"
|
|
aria-valuemax="100">
|
|
{{ plan.completion_percentage }}%
|
|
</div>
|
|
</div>
|
|
{% else %}
|
|
<span class="text-muted">Not started</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
<div class="btn-group btn-group-sm">
|
|
<button class="btn btn-outline-primary" title="View Details">
|
|
<i class="fas fa-eye"></i>
|
|
</button>
|
|
{% if plan.status == 'ACTIVE' %}
|
|
<button class="btn btn-outline-info" title="Update Progress">
|
|
<i class="fas fa-chart-line"></i>
|
|
</button>
|
|
<button class="btn btn-outline-success"
|
|
title="Mark Complete"
|
|
hx-post="{% url 'emr:complete_care_plan' plan.id %}"
|
|
hx-confirm="Mark this care plan as complete?"
|
|
hx-swap="none">
|
|
<i class="fas fa-check"></i>
|
|
</button>
|
|
{% endif %}
|
|
<button class="btn btn-outline-secondary" title="Notes">
|
|
<i class="fas fa-sticky-note"></i>
|
|
</button>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{% empty %}
|
|
<tr>
|
|
<td colspan="8" class="text-center py-4">
|
|
<i class="fas fa-clipboard-list fa-3x text-muted mb-3"></i>
|
|
<h5 class="text-muted">No care plans found</h5>
|
|
<p class="text-muted">No care plans match your current filters.</p>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- Pagination -->
|
|
{% if is_paginated %}
|
|
<nav aria-label="Care plan pagination">
|
|
<ul class="pagination justify-content-center">
|
|
{% if page_obj.has_previous %}
|
|
<li class="page-item">
|
|
<a class="page-link" href="?page=1">First</a>
|
|
</li>
|
|
<li class="page-item">
|
|
<a class="page-link" href="?page={{ page_obj.previous_page_number }}">Previous</a>
|
|
</li>
|
|
{% endif %}
|
|
|
|
<li class="page-item active">
|
|
<span class="page-link">
|
|
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}
|
|
</span>
|
|
</li>
|
|
|
|
{% if page_obj.has_next %}
|
|
<li class="page-item">
|
|
<a class="page-link" href="?page={{ page_obj.next_page_number }}">Next</a>
|
|
</li>
|
|
<li class="page-item">
|
|
<a class="page-link" href="?page={{ page_obj.paginator.num_pages }}">Last</a>
|
|
</li>
|
|
{% endif %}
|
|
</ul>
|
|
</nav>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|