diff --git a/src/lib/components/patient/admission/modal/search-param-modal.svelte b/src/lib/components/patient/admission/modal/search-param-modal.svelte index c012425..e16830b 100644 --- a/src/lib/components/patient/admission/modal/search-param-modal.svelte +++ b/src/lib/components/patient/admission/modal/search-param-modal.svelte @@ -1,24 +1,53 @@
-
+
{#each props.searchFields as field} @@ -53,7 +82,7 @@
-
+
{#if props.search.searchData && props.search.searchData.length > 0} - +
+
+ + + + + Patient ID + Patient Name + Birthdate + Sex + + + + {#each props.search.searchData as patient, i} + togglePatientSelection(patient)} + > + e.stopPropagation()}> + togglePatientSelection(patient)} + /> + + {patient.PatientID} + {patient.FullName} + {patient.Birthdate ? patient.Birthdate.split(" ")[0] : ""} + {patient.SexLabel} + + {/each} + + +
+
+ + + + +
+
{:else}
diff --git a/src/lib/components/patient/admission/page/master-page.svelte b/src/lib/components/patient/admission/page/master-page.svelte index 72ca18c..5c218bc 100644 --- a/src/lib/components/patient/admission/page/master-page.svelte +++ b/src/lib/components/patient/admission/page/master-page.svelte @@ -10,17 +10,22 @@ import ReusableDataTable from "$lib/components/reusable/reusable-data-table.svelte"; let props = $props(); + let selectedInternalPid = $state(null); + let tableData = $state([]); const search = useSearch(searchFields, searchParam); const actions = admissionActions(props.masterDetail) actions.find(a => a.label === 'Search Parameters').popoverContent = searchParamSnippet; let activeRowId = $state(null); + + function handlePatientConfirm(internalPid) { + console.log(internalPid); + } {#snippet searchParamSnippet()} - - + {/snippet}
togglePatientSelection(patient)} > - + e.stopPropagation()}> {patient.PatientID} {patient.FullName} {patient.Birthdate ? patient.Birthdate.split(" ")[0] : ""} - {patient.Gender} + {patient.SexLabel} {/each} diff --git a/src/lib/components/patient/list/modal/linkto-modal.svelte b/src/lib/components/patient/list/modal/linkto-modal.svelte index e56fda6..0846b98 100644 --- a/src/lib/components/patient/list/modal/linkto-modal.svelte +++ b/src/lib/components/patient/list/modal/linkto-modal.svelte @@ -165,7 +165,7 @@ {patient.Birthdate ? patient.Birthdate.split(" ")[0] : ""} - {patient.Gender} + {patient.SexLabel} {/each} diff --git a/src/lib/components/reusable/reusable-data-table.svelte b/src/lib/components/reusable/reusable-data-table.svelte index 7aefeb4..1f5a0a7 100644 --- a/src/lib/components/reusable/reusable-data-table.svelte +++ b/src/lib/components/reusable/reusable-data-table.svelte @@ -60,18 +60,20 @@ getFilteredRowModel: getFilteredRowModel(), }); -
-
- { - globalFilter = e.currentTarget.value; - }} - class="h-7 w-64 text-xs px-2" - /> -
-
+
+ {#if props.searchable ?? true} +
+ { + globalFilter = e.currentTarget.value; + }} + class="h-7 w-64 text-xs px-2" + /> +
+ {/if} +
{#each table.getHeaderGroups() as headerGroup (headerGroup.id)}