NexLab_System / templates /dashboard.html
alisaleem97's picture
Upload folder using huggingface_hub
6ea020b verified
Raw History Blame Contribute Delete
13.9 kB
<!-- templates/dashboard.html -->
{% extends "base.html" %}
{% block title %}Dashboard - NexLab{% endblock %}
{% block page_title %}System Dashboard{% endblock %}
{% block content %}
<div class="space-y-6 pb-12">
<!-- PATIENT NUMBERS SECTION -->
<div>
<h2 class="text-lg font-bold text-slate-800 mb-3 border-b pb-2">Patients Numbers Section</h2>
<div class="grid grid-cols-2 md:grid-cols-5 gap-4">
<div
class="bg-white rounded-xl shadow-sm border border-slate-200 p-4 flex flex-col hover:shadow-md transition-shadow">
<span class="text-sm font-medium text-slate-500 uppercase tracking-wide">Total Patients (Today)</span>
<span class="text-3xl font-extrabold text-indigo-600 mt-2">{{ dash.today_patients }}</span>
</div>
<div
class="bg-white rounded-xl shadow-sm border border-slate-200 p-4 flex flex-col hover:shadow-md transition-shadow">
<span class="text-sm font-medium text-slate-500 uppercase tracking-wide">Pending</span>
<span class="text-3xl font-extrabold text-amber-500 mt-2">{{ dash.pending_patients }}</span>
<span class="text-xs text-slate-400 mt-1">Has un-authorized tests</span>
</div>
<div
class="bg-white rounded-xl shadow-sm border border-slate-200 p-4 flex flex-col hover:shadow-md transition-shadow">
<span class="text-sm font-medium text-slate-500 uppercase tracking-wide">Waiting</span>
<span class="text-3xl font-extrabold text-blue-500 mt-2">{{ dash.waiting_patients }}</span>
<span class="text-xs text-slate-400 mt-1">Pending Double Auth</span>
</div>
<div
class="bg-white rounded-xl shadow-sm border border-slate-200 p-4 flex flex-col hover:shadow-md transition-shadow">
<span class="text-sm font-medium text-slate-500 uppercase tracking-wide">Done</span>
<span class="text-3xl font-extrabold text-emerald-500 mt-2">{{ dash.done_patients }}</span>
<span class="text-xs text-slate-400 mt-1">All tests Double Auth</span>
</div>
<div
class="bg-white rounded-xl shadow-sm border border-slate-200 p-4 flex flex-col hover:shadow-md transition-shadow">
<span class="text-sm font-medium text-slate-500 uppercase tracking-wide">Deleted</span>
<span class="text-3xl font-extrabold text-red-500 mt-2">{{ dash.deleted_patients }}</span>
<span class="text-xs text-slate-400 mt-1">Total removed</span>
</div>
</div>
</div>
<!-- CALL CENTRE SECTION -->
<div>
<h2 class="text-lg font-bold text-slate-800 mb-3 border-b pb-2">Call Centre Section</h2>
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<div
class="bg-gradient-to-br from-indigo-50 to-white rounded-xl shadow-sm border border-indigo-100 p-4 flex items-center justify-between">
<div>
<h3 class="text-sm font-medium text-indigo-800 uppercase tracking-wide">Total</h3>
<p class="text-xs text-indigo-500">Done Patients</p>
</div>
<div class="text-3xl font-extrabold text-indigo-600">{{ dash.call_center_total }}</div>
</div>
<div
class="bg-gradient-to-br from-emerald-50 to-white rounded-xl shadow-sm border border-emerald-100 p-4 flex items-center justify-between">
<div>
<h3 class="text-sm font-medium text-emerald-800 uppercase tracking-wide">Sent</h3>
<p class="text-xs text-emerald-500">Called Patients</p>
</div>
<div class="text-3xl font-extrabold text-emerald-600">{{ dash.call_center_sent }}</div>
</div>
<div
class="bg-gradient-to-br from-rose-50 to-white rounded-xl shadow-sm border border-rose-100 p-4 flex items-center justify-between">
<div>
<h3 class="text-sm font-medium text-rose-800 uppercase tracking-wide">Not Sent</h3>
<p class="text-xs text-rose-500">Pending Call</p>
</div>
<div class="text-3xl font-extrabold text-rose-600">{{ dash.call_center_not_sent }}</div>
</div>
</div>
</div>
<!-- GENERAL INFO SECTION -->
<div>
<h2 class="text-lg font-bold text-slate-800 mb-3 border-b pb-2">General Info Section</h2>
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
<!-- Critical Value Alerts -->
<div class="bg-white rounded-xl shadow-sm border border-red-200 overflow-hidden lg:col-span-2">
<div class="bg-red-50 px-4 py-3 border-b border-red-100 flex items-center justify-between">
<h3 class="font-bold text-red-800 flex items-center">
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z">
</path>
</svg>
Critical Value Alerts
</h3>
</div>
<div class="p-0 max-h-[300px] overflow-y-auto">
{% if dash.critical_alerts %}
<table class="min-w-full divide-y divide-slate-100">
<thead class="bg-slate-50 sticky top-0">
<tr>
<th class="px-4 py-2 text-left text-xs font-medium text-slate-500 uppercase">Patient
</th>
<th class="px-4 py-2 text-left text-xs font-medium text-slate-500 uppercase">Test</th>
<th class="px-4 py-2 text-left text-xs font-medium text-slate-500 uppercase">Value</th>
<th class="px-4 py-2 text-left text-xs font-medium text-slate-500 uppercase">Date</th>
</tr>
</thead>
<tbody class="divide-y divide-slate-100">
{% for alert in dash.critical_alerts %}
<tr class="hover:bg-red-50/50 transition-colors">
<td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-slate-800">{{
alert.patient_name }} <span class="text-xs text-slate-400">({{ alert.patient_id
}})</span></td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-slate-600">{{ alert.test_name }}
</td>
<td class="px-4 py-2 whitespace-nowrap text-sm font-bold text-red-600 bg-red-50/30">{{
alert.value }}</td>
<td class="px-4 py-2 whitespace-nowrap text-xs text-slate-500">{{ alert.date }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<div class="p-8 text-center text-slate-500">
<p>No critical value alerts found.</p>
</div>
{% endif %}
</div>
</div>
<div class="space-y-6">
<!-- Patient Demographics -->
<div class="bg-white rounded-xl shadow-sm border border-slate-200">
<div class="px-4 py-3 border-b border-slate-100">
<h3 class="font-bold text-slate-800">Patient Demographics</h3>
</div>
<div class="p-6">
<div class="flex items-center justify-between mb-2">
<span class="text-sm text-slate-600 flex items-center">
<span class="w-3 h-3 rounded-full bg-blue-500 mr-2"></span> Male
</span>
<span class="font-bold text-slate-800">{{ dash.males }}</span>
</div>
<div class="w-full bg-slate-100 rounded-full h-2 mb-4">
{% set total_gender = (dash.males + dash.females) or 1 %}
<div class="bg-blue-500 h-2 rounded-full"
style="width: {{ (dash.males / total_gender * 100)|round }}%"></div>
</div>
<div class="flex items-center justify-between mb-2">
<span class="text-sm text-slate-600 flex items-center">
<span class="w-3 h-3 rounded-full bg-pink-500 mr-2"></span> Female
</span>
<span class="font-bold text-slate-800">{{ dash.females }}</span>
</div>
<div class="w-full bg-slate-100 rounded-full h-2">
<div class="bg-pink-500 h-2 rounded-full"
style="width: {{ (dash.females / total_gender * 100)|round }}%"></div>
</div>
</div>
</div>
<!-- Top Requested Tests -->
<div class="bg-white rounded-xl shadow-sm border border-slate-200">
<div class="px-4 py-3 border-b border-slate-100">
<h3 class="font-bold text-slate-800">Top Requested Tests</h3>
</div>
<div class="p-4">
{% if dash.top_tests %}
<ul class="space-y-3">
{% for tt in dash.top_tests %}
<li class="flex items-center justify-between">
<div class="flex items-center">
<div
class="w-6 h-6 rounded bg-indigo-100 text-indigo-600 flex items-center justify-center text-xs font-bold mr-3">
{{ loop.index }}</div>
<span class="text-sm font-medium text-slate-700 truncate w-32"
title="{{ tt.name }}">{{ tt.name }}</span>
</div>
<span class="text-sm font-bold text-slate-800 bg-slate-50 px-2 rounded">{{ tt.count
}}</span>
</li>
{% endfor %}
</ul>
{% else %}
<p class="text-sm text-slate-500 text-center py-4">No tests logged yet.</p>
{% endif %}
</div>
</div>
</div>
</div>
</div>
<!-- FOOTER SIGNATURE -->
<div class="mt-12 flex flex-col items-center justify-center border-t border-slate-200 pt-8 pb-4">
<!-- Premium Interactive QR Code Card -->
<div class="group relative flex flex-col items-center bg-white p-4 rounded-2xl shadow-md border border-slate-100 hover:shadow-xl hover:-translate-y-1.5 transition-all duration-300 mb-4 max-w-xs cursor-pointer">
<!-- Scan Corner Markers -->
<div class="absolute top-2 left-2 w-4.5 h-4.5 border-t-2 border-l-2 border-indigo-500 rounded-tl transition-all duration-300 group-hover:scale-110"></div>
<div class="absolute top-2 right-2 w-4.5 h-4.5 border-t-2 border-r-2 border-indigo-500 rounded-tr transition-all duration-300 group-hover:scale-110"></div>
<div class="absolute bottom-2 left-2 w-4.5 h-4.5 border-b-2 border-l-2 border-indigo-500 rounded-bl transition-all duration-300 group-hover:scale-110"></div>
<div class="absolute bottom-2 right-2 w-4.5 h-4.5 border-b-2 border-r-2 border-indigo-500 rounded-br transition-all duration-300 group-hover:scale-110"></div>
<!-- Scan Line Effect -->
<div class="absolute left-4 right-4 h-[2px] bg-gradient-to-r from-transparent via-indigo-400 to-transparent top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-100 group-hover:animate-pulse transition-opacity duration-300"></div>
<a href="https://alissahib97.wixsite.com/my-site-1" target="_blank" rel="noopener noreferrer" class="block overflow-hidden rounded-xl bg-slate-50 p-2 border border-slate-100 transition-all duration-300 group-hover:bg-indigo-50/30">
<img src="/static/ali_saleem_qr.png" alt="Ali Saleem QR Code" class="w-32 h-32 object-contain transition-transform duration-500 ease-out group-hover:scale-105">
</a>
<span class="text-xs text-slate-400 mt-2.5 font-medium tracking-wide transition-colors duration-300 group-hover:text-indigo-600">Scan to visit website</span>
</div>
<p class="text-lg font-medium text-slate-600">By: <a href="https://alissahib97.wixsite.com/my-site-1" target="_blank" rel="noopener noreferrer" class="text-indigo-600 hover:text-indigo-800 hover:underline transition-all duration-300">Ali Saleem</a></p>
</div>
</div>
{% endblock %}