Add TODO.md and update visits components with search parameters and UI improvements
This commit is contained in:
parent
96f3b14fd4
commit
69f2fd6956
7
TODO.md
Normal file
7
TODO.md
Normal file
@ -0,0 +1,7 @@
|
||||
# TODO
|
||||
|
||||
## Backend
|
||||
- [ ] Work on patvisit backend
|
||||
|
||||
## Frontend
|
||||
- [ ] Visits index: add search parameter, remove type, show visitdate
|
||||
@ -256,7 +256,7 @@
|
||||
<!-- NumRefType -->
|
||||
<div class="flex flex-col">
|
||||
<label class="text-xs text-gray-600 mb-0.5">Type</label>
|
||||
<select class="select select-sm select-bordered w-20" bind:value={simpleRefNum.NumRefType}>
|
||||
<select class="select select-sm select-bordered w-full" bind:value={simpleRefNum.NumRefType}>
|
||||
{#each numRefTypeOptions as opt (opt.value)}
|
||||
<option value={opt.value}>{opt.label}</option>
|
||||
{/each}
|
||||
|
||||
@ -274,7 +274,7 @@
|
||||
<!-- NumRefType -->
|
||||
<div class="flex flex-col">
|
||||
<label class="text-xs text-gray-600 mb-0.5">Type</label>
|
||||
<select class="select select-sm select-bordered w-20" bind:value={thresholdData.NumRefType}>
|
||||
<select class="select select-sm select-bordered w-full" bind:value={thresholdData.NumRefType}>
|
||||
{#each numRefTypeOptions as opt (opt.value)}
|
||||
<option value={opt.value}>{opt.label}</option>
|
||||
{/each}
|
||||
@ -324,7 +324,7 @@
|
||||
<!-- Age Unit -->
|
||||
<div class="flex flex-col">
|
||||
<label class="text-xs text-gray-600 mb-0.5">Unit</label>
|
||||
<select class="select select-sm select-bordered w-20" bind:value={thresholdData.AgeUnit}>
|
||||
<select class="select select-sm select-bordered w-full" bind:value={thresholdData.AgeUnit}>
|
||||
{#each ageUnits as opt (opt.value)}
|
||||
<option value={opt.value}>{opt.label}</option>
|
||||
{/each}
|
||||
|
||||
@ -84,35 +84,9 @@
|
||||
params.Location = searchFilters.location;
|
||||
}
|
||||
|
||||
// TODO: Replace with actual API call
|
||||
// const response = await fetchVisits(params);
|
||||
// visits = Array.isArray(response.data) ? response.data : [];
|
||||
|
||||
// Mock data for now
|
||||
visits = [
|
||||
{
|
||||
InternalPVID: 'V001',
|
||||
PVID: 'V2024001',
|
||||
PatientID: 'P001',
|
||||
PatientName: 'John Doe',
|
||||
PVCreateDate: new Date().toISOString(),
|
||||
ADTCode: 'A01',
|
||||
LocCode: 'ICU-101',
|
||||
AttDoc: 'Dr. Smith'
|
||||
},
|
||||
{
|
||||
InternalPVID: 'V002',
|
||||
PVID: 'V2024002',
|
||||
PatientID: 'P002',
|
||||
PatientName: 'Jane Smith',
|
||||
PVCreateDate: new Date(Date.now() - 86400000).toISOString(),
|
||||
ADTCode: 'A04',
|
||||
LocCode: 'OPD-205',
|
||||
AttDoc: 'Dr. Johnson',
|
||||
EndDate: new Date().toISOString()
|
||||
}
|
||||
];
|
||||
totalItems = visits.length;
|
||||
const response = await fetchVisits(params);
|
||||
visits = Array.isArray(response.data) ? response.data : [];
|
||||
totalItems = response.total || visits.length;
|
||||
totalPages = Math.ceil(totalItems / perPage) || 1;
|
||||
} catch (err) {
|
||||
toastError(err.message || 'Failed to load visits');
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<script>
|
||||
import { ChevronLeft, ChevronRight, Calendar } from 'lucide-svelte';
|
||||
import { ChevronLeft, ChevronRight, Calendar, Edit2, History } from 'lucide-svelte';
|
||||
import VisitCard from './VisitCard.svelte';
|
||||
import DataTable from '$lib/components/DataTable.svelte';
|
||||
import { formatPatientName } from '$lib/utils/patients.js';
|
||||
@ -95,14 +95,14 @@
|
||||
title="Edit"
|
||||
onclick={() => onEditVisit(row)}
|
||||
>
|
||||
<span class="text-xs">Edit</span>
|
||||
<Edit2 class="w-3 h-3" />
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-xs btn-ghost"
|
||||
title="History"
|
||||
onclick={() => onViewHistory(row)}
|
||||
>
|
||||
<span class="text-xs">Hist</span>
|
||||
<History class="w-3 h-3" />
|
||||
</button>
|
||||
</div>
|
||||
{:else}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user