feat: Add encounter list view with filter form and data table configurations for encounter management.

This commit is contained in:
riefive
2025-12-09 11:41:03 +07:00
parent 26b31a4d67
commit 69b047fce5
3 changed files with 13 additions and 10 deletions
+2 -2
View File
@@ -93,9 +93,9 @@ function handleSearch() {
Reset
</Button>
<Button
variant="outline"
variant="default"
type="button"
class="h-[40px] rounded-md border-orange-400 text-orange-400 hover:bg-green-50"
class="h-[40px]"
@click="handleSearch"
>
<Icon
+1 -1
View File
@@ -167,7 +167,7 @@ export const ambulatoryConfig: Config = {
},
address: (rec: unknown): unknown => {
const recX = rec as Encounter
const addresses = recX.patient.person.addresses
const addresses = recX.patient?.person?.addresses || []
const resident = addresses?.find((addr) => addr.locationType_code === 'domicile')
const text = resident ? formatAddress(resident) : '-'
return text.length > 20 ? text.substring(0, 17) + '...' : text
+10 -7
View File
@@ -11,7 +11,7 @@ import FileUpload from '~/components/pub/my-ui/form/file-field.vue'
import { useSidebar } from '~/components/pub/ui/sidebar/utils'
// Constants
import { paymentTypes } from '~/lib/constants.vclaim'
import { paymentTypes, sepRefTypeCodes } from '~/lib/constants.vclaim'
// App libs
import { getServicePosition } from '~/lib/roles' // previously getPositionAs
@@ -70,10 +70,7 @@ const isRecordCancelOpen = ref(false)
const uploadFile = ref<any>(null)
const payments = ref<any>([])
const units = ref<any>([])
const visits = ref([
{ label: 'Rujukan Internal', value: 'ri' },
{ label: 'SEP Rujukan', value: 'sr' },
])
const sepsList = ref<any>([])
// Headers
const hreaderPrep: CH.Config = {
@@ -145,6 +142,10 @@ onMounted(async () => {
value: item.toString(),
label: paymentTypes[item],
})) as any
sepsList.value = Object.keys(sepRefTypeCodes).map((item) => ({
value: item.toString(),
label: sepRefTypeCodes[item],
})) as any
})
/////// Functions
@@ -244,7 +245,8 @@ function handleViewFile(id: number, menu: string, subMenu: string) {
function handleFilterApply(filters: { personName: string; startDate: string; endDate: string }) {
filterParams.value = {
'person-name': filters.personName,
// 'person-name': filters.personName,
'patient-identifier': filters.personName,
'start-date': filters.startDate,
'end-date': filters.endDate,
}
@@ -358,6 +360,7 @@ function handleRemoveConfirmation() {
<CH.ContentHeader v-bind="hreaderPrep">
<FilterNav
:active-positon="activeServicePosition"
:enable-export="false"
@apply="handleFilterApply"
@click="() => (isFilterFormDialogOpen = true)"
@onExportPdf="() => {}"
@@ -381,7 +384,7 @@ function handleRemoveConfirmation() {
<FilterForm
:payments="payments"
:units="units"
:visits="visits"
:visits="sepsList"
@search="handleFilterSearch"
@reset="handleFilterReset"
/>