172 lines
9.5 KiB
HTML
172 lines
9.5 KiB
HTML
{% extends "base.html" %}
|
|
{% load static %}
|
|
|
|
{% block title %}Problem List - {{ 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-list me-2"></i>Problem List Management
|
|
</h4>
|
|
</div>
|
|
|
|
<div class="card-body">
|
|
<!-- Filters -->
|
|
<div class="row mb-3">
|
|
<div class="col-md-2">
|
|
<select name="problem_type" class="form-select">
|
|
<option value="">All Types</option>
|
|
{% for value, label in problem_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 problem_statuses %}
|
|
<option value="{{ value }}">{{ label }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<select name="priority" class="form-select">
|
|
<option value="">All Priorities</option>
|
|
{% for value, label in priorities %}
|
|
<option value="{{ value }}">{{ label }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<input type="text" name="search" class="form-control" placeholder="Search patients, problems, codes...">
|
|
</div>
|
|
<div class="col-md-2">
|
|
<button type="submit" class="btn btn-primary w-100">
|
|
<i class="fas fa-search"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Problems Table -->
|
|
<div class="table-responsive">
|
|
<table class="table table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th>Patient</th>
|
|
<th>Problem</th>
|
|
<th>Type</th>
|
|
<th>Priority</th>
|
|
<th>Status</th>
|
|
<th>Onset Date</th>
|
|
<th>Diagnosed By</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for problem in problems %}
|
|
<tr>
|
|
<td>
|
|
<strong>{{ problem.patient.get_full_name }}</strong><br>
|
|
<small class="text-muted">
|
|
MRN: {{ problem.patient.mrn }} •
|
|
{{ problem.patient.age }}y {{ problem.patient.get_gender_display }}
|
|
</small>
|
|
</td>
|
|
<td>
|
|
<strong>{{ problem.problem_name }}</strong>
|
|
{% if problem.problem_code %}
|
|
<br><small class="text-muted">Code: {{ problem.problem_code }}</small>
|
|
{% endif %}
|
|
{% if problem.description %}
|
|
<br><small class="text-muted">{{ problem.description|truncatechars:50 }}</small>
|
|
{% endif %}
|
|
</td>
|
|
<td>{{ problem.get_problem_type_display }}</td>
|
|
<td>
|
|
{% if problem.priority == 'HIGH' %}
|
|
<span class="badge bg-danger">High</span>
|
|
{% elif problem.priority == 'MEDIUM' %}
|
|
<span class="badge bg-warning">Medium</span>
|
|
{% else %}
|
|
<span class="badge bg-info">Low</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{% if problem.status == 'ACTIVE' %}
|
|
<span class="badge bg-success">Active</span>
|
|
{% elif problem.status == 'RESOLVED' %}
|
|
<span class="badge bg-secondary">Resolved</span>
|
|
{% elif problem.status == 'INACTIVE' %}
|
|
<span class="badge bg-secondary">Inactive</span>
|
|
{% elif problem.status == 'RULED_OUT' %}
|
|
<span class="badge bg-danger">Ruled Out</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{{ problem.onset_date|date:"M d, Y" }}
|
|
{% if problem.resolution_date %}
|
|
<br><small class="text-muted">
|
|
Resolved: {{ problem.resolution_date|date:"M d, Y" }}
|
|
</small>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{{ problem.diagnosing_provider.get_full_name }}
|
|
{% if problem.managing_provider and problem.managing_provider != problem.diagnosing_provider %}
|
|
<br><small class="text-muted">
|
|
Managing: {{ problem.managing_provider.get_full_name }}
|
|
</small>
|
|
{% 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 problem.status == 'ACTIVE' %}
|
|
<button class="btn btn-outline-success"
|
|
title="Mark Resolved"
|
|
hx-post="{% url 'emr:resolve_problem' problem.id %}"
|
|
hx-confirm="Mark this problem as resolved?"
|
|
hx-swap="none">
|
|
<i class="fas fa-check"></i>
|
|
</button>
|
|
{% endif %}
|
|
<button class="btn btn-outline-info" title="Care Plan">
|
|
<i class="fas fa-clipboard-list"></i>
|
|
</button>
|
|
<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-list fa-3x text-muted mb-3"></i>
|
|
<h5 class="text-muted">No problems found</h5>
|
|
<p class="text-muted">No problems 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>
|
|
{% endblock %}
|
|
|