113 lines
5.0 KiB
Plaintext
113 lines
5.0 KiB
Plaintext
@model IEnumerable<SimpleLIS.Models.Patient>
|
|
@{
|
|
ViewData["Title"] = "Patients";
|
|
}
|
|
|
|
<div class="container-fluid">
|
|
<div class="row mb-4">
|
|
<div class="col-12">
|
|
<h1 class="display-4 mb-0">Patients</h1>
|
|
<p class="text-muted">All registered patients in the system</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="card">
|
|
<div class="card-header bg-white d-flex justify-content-between align-items-center">
|
|
<h5 class="mb-0">Patient List</h5>
|
|
<span class="badge bg-primary">@Model.Count() Total</span>
|
|
</div>
|
|
<div class="card-body">
|
|
@if (Model.Any())
|
|
{
|
|
<div class="table-responsive">
|
|
<table class="table table-striped table-hover" id="patientsTable">
|
|
<thead>
|
|
<tr>
|
|
<th>Patient ID</th>
|
|
<th>HL7 Patient ID</th>
|
|
<th>Name</th>
|
|
<th>Date of Birth</th>
|
|
<th>Age</th>
|
|
<th>Gender</th>
|
|
<th>Messages</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var patient in Model)
|
|
{
|
|
var age = DateTime.Now.Year - patient.DateOfBirth.Year;
|
|
if (DateTime.Now.DayOfYear < patient.DateOfBirth.DayOfYear) age--;
|
|
|
|
<tr>
|
|
<td><code>@patient.PatientId</code></td>
|
|
<td><code>@patient.HL7PatientId</code></td>
|
|
<td>
|
|
<strong>@patient.LastName, @patient.FirstName</strong>
|
|
</td>
|
|
<td>@patient.DateOfBirth.ToString("yyyy-MM-dd")</td>
|
|
<td>@age years</td>
|
|
<td>
|
|
@if (patient.Gender?.ToUpper() == "M")
|
|
{
|
|
<span class="badge bg-primary">Male</span>
|
|
}
|
|
else if (patient.Gender?.ToUpper() == "F")
|
|
{
|
|
<span class="badge bg-danger">Female</span>
|
|
}
|
|
else
|
|
{
|
|
<span class="badge bg-secondary">@patient.Gender</span>
|
|
}
|
|
</td>
|
|
<td>
|
|
<span class="badge bg-info">@patient.Messages.Count messages</span>
|
|
</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
<div class="alert alert-info mb-0">
|
|
<strong>No patients found.</strong> Send HL7 messages through Mirth Connect to populate patient data.
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row mt-3">
|
|
<div class="col-12">
|
|
<a asp-controller="Home" asp-action="Index" class="btn btn-secondary">
|
|
<i class="bi bi-arrow-left"></i> Back to Dashboard
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@section Scripts {
|
|
<script>
|
|
@if (Model.Any())
|
|
{
|
|
<text>
|
|
$(document).ready(function() {
|
|
$('#patientsTable').before('<div class="mb-3"><input type="text" id="searchInput" class="form-control" placeholder="Search patients..."></div>');
|
|
|
|
$('#searchInput').on('keyup', function() {
|
|
var value = $(this).val().toLowerCase();
|
|
$('#patientsTable tbody tr').filter(function() {
|
|
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
|
|
});
|
|
});
|
|
});
|
|
</text>
|
|
}
|
|
</script>
|
|
}
|