diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..9849c47 --- /dev/null +++ b/TODO.md @@ -0,0 +1,7 @@ +# TODO + +## Backend +- [ ] Work on patvisit backend + +## Frontend +- [ ] Visits index: add search parameter, remove type, show visitdate diff --git a/src/routes/(app)/master-data/tests/test-modal/tabs/RefNumTab.svelte b/src/routes/(app)/master-data/tests/test-modal/tabs/RefNumTab.svelte index b580d58..109447e 100644 --- a/src/routes/(app)/master-data/tests/test-modal/tabs/RefNumTab.svelte +++ b/src/routes/(app)/master-data/tests/test-modal/tabs/RefNumTab.svelte @@ -256,7 +256,7 @@
- {#each numRefTypeOptions as opt (opt.value)} {/each} diff --git a/src/routes/(app)/master-data/tests/test-modal/tabs/ThresholdTab.svelte b/src/routes/(app)/master-data/tests/test-modal/tabs/ThresholdTab.svelte index 50ebb26..3946b09 100644 --- a/src/routes/(app)/master-data/tests/test-modal/tabs/ThresholdTab.svelte +++ b/src/routes/(app)/master-data/tests/test-modal/tabs/ThresholdTab.svelte @@ -274,7 +274,7 @@
- {#each numRefTypeOptions as opt (opt.value)} {/each} @@ -324,7 +324,7 @@
- {#each ageUnits as opt (opt.value)} {/each} diff --git a/src/routes/(app)/visits/+page.svelte b/src/routes/(app)/visits/+page.svelte index a9014c5..8a5bb10 100644 --- a/src/routes/(app)/visits/+page.svelte +++ b/src/routes/(app)/visits/+page.svelte @@ -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'); diff --git a/src/routes/(app)/visits/VisitList.svelte b/src/routes/(app)/visits/VisitList.svelte index fe21373..27b3c75 100644 --- a/src/routes/(app)/visits/VisitList.svelte +++ b/src/routes/(app)/visits/VisitList.svelte @@ -1,5 +1,5 @@