feat (encounter): add entry

This commit is contained in:
Abizrh
2025-09-23 19:41:14 +07:00
parent 18e6824611
commit 688e79680f
15 changed files with 849 additions and 35 deletions

No files matched your search

@@ -0,0 +1,9 @@
<script setup lang="ts"></script>
<template>
<div class="mb-5 border-b border-b-slate-300 pb-3 text-lg xl:text-xl">
<Icon name="i-lucide-user" class="me-2" />
<span class="font-semibold">Tambah</span> Kunjungan
</div>
<AppEncounterEntryForm />
</template>
+78
View File
@@ -0,0 +1,78 @@
<script setup lang="ts">
import type { DataTableLoader } from '~/components/pub/base/data-table/type'
import type { Summary } from '~/components/pub/base/summary-card/type'
import type { HeaderPrep, RefSearchNav } from '~/components/pub/custom-ui/data/types'
import { Calendar, Hospital, UserCheck, UsersRound } from 'lucide-vue-next'
import SummaryCard from '~/components/pub/base/summary-card/summary-card.vue'
import Dialog from '~/components/pub/base/modal/dialog.vue'
import Header from '~/components/pub/custom-ui/nav-header/prep.vue'
import Filter from '~/components/pub/custom-ui/nav-header/filter.vue'
const data = ref([])
const isLoading = reactive<DataTableLoader>({
summary: false,
isTableLoading: false,
})
const recId = ref<number>(0)
const recAction = ref<string>('')
const recItem = ref<any>(null)
const isFormEntryDialogOpen = ref(false)
const hreaderPrep: HeaderPrep = {
title: 'Kunjungan',
icon: 'i-lucide-users',
addNav: {
label: 'Tambah',
onClick: () => navigateTo('/rehab/encounter/add'),
},
}
const refSearchNav: RefSearchNav = {
onClick: () => {
// open filter modal
isFormEntryDialogOpen.value = true
console.log(' 1open filter modal')
},
onInput: (_val: string) => {
// filter patient list
},
onClear: () => {
// clear url param
},
}
// Loading state management
async function getPatientList() {
isLoading.isTableLoading = true
const resp = await xfetch('/api/v1/patient')
if (resp.success) {
data.value = (resp.body as Record<string, any>).data
}
isLoading.isTableLoading = false
}
onMounted(() => {
getPatientList()
})
provide('rec_id', recId)
provide('rec_action', recAction)
provide('rec_item', recItem)
provide('table_data_loader', isLoading)
</script>
<template>
<Header :prep="{ ...hreaderPrep }" :ref-search-nav="refSearchNav" />
<div class="my-4 rounded-md border p-4">
<Filter :ref-search-nav="refSearchNav" />
<div class="my-4 flex flex-1 flex-col gap-4 md:gap-8">
<AppEncounterList :data="data" />
</div>
<Dialog v-model:open="isFormEntryDialogOpen" title="Tambah Divisi" size="lg" prevent-outside>
<AppEncounterFilter />
</Dialog>
<!-- <Pagination :pagination-meta="paginationMeta" @page-change="handlePageChange" /> -->
</div>
</template>
+23 -31
View File
@@ -112,27 +112,27 @@ const activeTabFilter = computed({
<AppSatusehatCardSummary :is-loading="isLoading.satusehatConn!" :summary-data="summaryData" />
</div>
<div class="rounded-md border p-4">
<h2 class="text-md font-semibold py-2">FHIR Resource</h2>
<h2 class="text-md py-2 font-semibold">FHIR Resource</h2>
<Tabs v-model="activeTabFilter">
<div class="scrollbar-hide overflow-x-auto flex gap-2 justify-between">
<div class="scrollbar-hide flex justify-between gap-2 overflow-x-auto">
<TabsList>
<TabsTrigger
v-for="tab in tabs" :key="tab.value" :value="tab.value"
v-for="tab in tabs"
:key="tab.value"
:value="tab.value"
class="flex-shrink-0 px-4 py-2 text-sm font-medium data-[state=active]:bg-green-600 data-[state=inactive]:bg-gray-100 data-[state=active]:text-white data-[state=inactive]:text-gray-700"
>
>
{{ tab.label }}
</TabsTrigger>
</TabsList>
<div class="flex gap-2 items-center">
<div class="flex items-center gap-2">
<!-- Search Input -->
<AppSatusehatPicker />
<div class="relative w-full max-w-sm">
<Dialog>
<DialogTrigger>
<Input type="text" placeholder="Cari pasien..." class="pl-3 h-9" />
<Input type="text" placeholder="Cari pasien..." class="h-9 pl-3" />
</DialogTrigger>
<DialogContent>
<DialogHeader class="border-b-1">
@@ -152,19 +152,13 @@ v-for="tab in tabs" :key="tab.value" :value="tab.value"
<FormLabel>Status</FormLabel>
<FormControl>
<Select v-bind="componentField">
<SelectTrigger class="bg-white border border-gray-300">
<SelectTrigger class="border border-gray-300 bg-white">
<SelectValue class="text-gray-400" placeholder="-- select item" />
</SelectTrigger>
<SelectContent class="bg-white ">
<SelectItem value="0">
Gagal
</SelectItem>
<SelectItem value="1">
Pending
</SelectItem>
<SelectItem value="2">
Terkirim
</SelectItem>
<SelectContent class="bg-white">
<SelectItem value="0"> Gagal </SelectItem>
<SelectItem value="1"> Pending </SelectItem>
<SelectItem value="2"> Terkirim </SelectItem>
</SelectContent>
</Select>
</FormControl>
@@ -181,12 +175,8 @@ v-for="tab in tabs" :key="tab.value" :value="tab.value"
</Form>
<DialogFooter>
<Button variant="outline">
Reset
</Button>
<Button>
Apply
</Button>
<Button variant="outline"> Reset </Button>
<Button> Apply </Button>
</DialogFooter>
</DialogContent>
</Dialog>
@@ -194,9 +184,11 @@ v-for="tab in tabs" :key="tab.value" :value="tab.value"
<!-- Action Buttons -->
<AppSatusehatButtonAction
v-for="action in actions" :key="action.value" :icon="action.icon"
v-for="action in actions"
:key="action.value"
:icon="action.icon"
:text="action.label"
/>
/>
</div>
</div>
<div class="mt-4">
@@ -206,11 +198,11 @@ v-for="action in actions" :key="action.value" :icon="action.icon"
<!-- Pagination -->
<div
v-if="!isLoading.satusehatConn && !isLoading.isTableLoading && pagination.total > 0"
class="mt-4 flex justify-between items-center"
>
v-if="!isLoading.satusehatConn && !isLoading.isTableLoading && pagination.total > 0"
class="mt-4 flex items-center justify-between"
>
<div class="text-sm text-muted-foreground">
Menampilkan {{ ((pagination.page - 1) * pagination.limit) + 1 }} -
Menampilkan {{ (pagination.page - 1) * pagination.limit + 1 }} -
{{ Math.min(pagination.page * pagination.limit, pagination.total) }}
dari {{ pagination.total }} data
</div>