From 5685b31c4848e5512297fe829f7996006c6bd18a Mon Sep 17 00:00:00 2001 From: Khafid Prayoga Date: Tue, 26 Aug 2025 13:10:09 +0700 Subject: [PATCH] feat(satusehat): implement query schema and improve data table - Add schema.query.ts for query validation with zod - Move constants to const.ts for better organization - Refactor list.vue to use new query schema and constants - Add empty state handling to data-table.vue --- app/components/flow/satusehat/const.ts | 97 +++++++++ app/components/flow/satusehat/list.vue | 193 ++++-------------- app/components/flow/satusehat/schema.query.ts | 23 +++ .../pub/base/data-table/data-table.vue | 14 +- 4 files changed, 177 insertions(+), 150 deletions(-) create mode 100644 app/components/flow/satusehat/const.ts create mode 100644 app/components/flow/satusehat/schema.query.ts diff --git a/app/components/flow/satusehat/const.ts b/app/components/flow/satusehat/const.ts new file mode 100644 index 00000000..8dee79cc --- /dev/null +++ b/app/components/flow/satusehat/const.ts @@ -0,0 +1,97 @@ +import type { ServiceStatus } from '~/components/pub/base/service-status/type' +import type { Summary } from '~/components/pub/base/summary-card/type' +import type { HeaderPrep, RefSearchNav } from '~/components/pub/custom-ui/data/types' +import { CircleCheckBig, CircleDashed, CircleX, Send } from 'lucide-vue-next' + +export const tabs = [ + { + value: 'all', + label: 'Semua Resource', + }, + { + value: 'patient', + label: 'Patient', + }, + { + value: 'encounter', + label: 'Encounter', + }, + { + value: 'observation', + label: 'Observation', + }, +] + +export const actions = [ + { + value: 'export', + label: 'Ekspor', + icon: 'i-lucide-download', + }, +] + +// Status filter options +export const statusOptions = [ + { value: '0', label: 'Failed' }, + { value: '1', label: 'Pending' }, + { value: '2', label: 'Success' }, +] +export const summaryData: Summary[] = [ + { + title: 'Resource Terkirim', + icon: Send, + metric: 1245, + trend: 0, + timeframe: 'daily', + }, + { + title: 'Sync Success', + icon: CircleCheckBig, + metric: '97%', + trend: 0, + timeframe: 'daily', + }, + { + title: 'Pending Queue', + icon: CircleDashed, + metric: 32, + trend: 0, + timeframe: 'daily', + }, + { + title: 'Failed Items', + icon: CircleX, + metric: 10, + trend: 0, + timeframe: 'daily', + }, +] + +// SATUSEHAT Service integration +export const service = reactive({ + serviceName: 'SATUSEHAT', + serviceDesc: 'SATUSEHAT - FHIR R4 Compliant', + sessionActive: false, + status: 'connecting', + isSkeleton: false, +}) + +export const headerPrep: HeaderPrep = { + title: 'SATUSEHAT Integration', + icon: 'i-lucide-box', + addNav: { + label: 'Kirim Resource', + icon: 'i-lucide-send', + // onClick: () => navigateTo('/patient/add'), + }, +} + +export const refSearchNav: RefSearchNav = { + onClick: () => { + // open filter modal + }, + onInput: (_val: string) => { + }, + onClear: () => { + }, +} diff --git a/app/components/flow/satusehat/list.vue b/app/components/flow/satusehat/list.vue index 65327fac..3d88b03c 100644 --- a/app/components/flow/satusehat/list.vue +++ b/app/components/flow/satusehat/list.vue @@ -1,32 +1,27 @@