From 7ae9a9adfe6c790799c65c2c9148d01ac6088e96 Mon Sep 17 00:00:00 2001 From: Abizrh Date: Tue, 12 Aug 2025 17:01:50 +0700 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat=20(patient):=20implement=20pat?= =?UTF-8?q?ient=20list=20and=20entry=20form?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/app/patient/entry-form.vue | 5 +- app/components/app/patient/list-cfg.ts | 118 ++++++++++++++++++ app/components/app/patient/list.vue | 19 +++ app/components/flow/patient/list.vue | 20 ++- app/components/pub/nav/data-table.vue | 46 +++++++ .../pub/nav/dropdown-action-dud.vue | 82 ++++++++++++ app/components/pub/nav/footer/cs.vue | 28 +++-- app/components/pub/nav/footer/csd.vue | 28 +++++ app/components/pub/nav/types.ts | 9 ++ 9 files changed, 342 insertions(+), 13 deletions(-) create mode 100644 app/components/app/patient/list-cfg.ts create mode 100644 app/components/pub/nav/data-table.vue create mode 100644 app/components/pub/nav/dropdown-action-dud.vue create mode 100644 app/components/pub/nav/footer/csd.vue diff --git a/app/components/app/patient/entry-form.vue b/app/components/app/patient/entry-form.vue index b75af1c3..0b636bcf 100644 --- a/app/components/app/patient/entry-form.vue +++ b/app/components/app/patient/entry-form.vue @@ -8,8 +8,7 @@ import Label from '~/components/pub/form/label.vue' diff --git a/app/components/app/patient/list-cfg.ts b/app/components/app/patient/list-cfg.ts new file mode 100644 index 00000000..c1131bec --- /dev/null +++ b/app/components/app/patient/list-cfg.ts @@ -0,0 +1,118 @@ +import type { + Col, + KeyLabel, + RecComponent, + RecStrFuncComponent, + RecStrFuncUnknown, + Th, +} from '~/components/pub/nav/types' + +type SmallDetailDto = any + +const action = defineAsyncComponent(() => import('~/components/pub/nav/dropdown-action-dud.vue')) + +export const cols: Col[] = [ + {}, + {}, + {}, + { width: 100 }, + { width: 120 }, + {}, + {}, + {}, + { width: 100 }, + { width: 100 }, + {}, + { width: 50 }, +] + +export const header: Th[][] = [ + [ + { label: 'Nama' }, + { label: 'Rekam Medis' }, + { label: 'KTP' }, + { label: 'Tgl Lahir' }, + { label: 'Umur' }, + { label: 'JK' }, + { label: 'Pendidikan' }, + { label: 'Status' }, + { label: '' }, + ], +] + +export const keys = [ + 'name', + 'medicalRecord_number', + 'identity_number', + 'birth_date', + 'patient_age', + 'gender', + 'education', + 'status', + 'action', +] + +export const delKeyNames: KeyLabel[] = [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, +] + +export const funcParsed: RecStrFuncUnknown = { + name: (rec: unknown): unknown => { + const recX = rec as SmallDetailDto + return `${recX.firstName} ${recX.middleName || ''} ${recX.lastName || ''}` + }, + identity_number: (rec: unknown): unknown => { + const recX = rec as SmallDetailDto + if (recX.identity_number?.substring(0, 5) === 'BLANK') { + return '(TANPA NIK)' + } + return recX.identity_number + }, + birth_date: (rec: unknown): unknown => { + const recX = rec as SmallDetailDto + if (typeof recX.birth_date == 'object' && recX.birth_date) { + return (recX.birth_date as Date).toLocaleDateString() + } else if (typeof recX.birth_date == 'string') { + return (recX.birth_date as string).substring(0, 10) + } + return recX.birth_date + }, + patient_age: (rec: unknown): unknown => { + const recX = rec as SmallDetailDto + return recX.birth_date?.split('T')[0] + }, + gender: (rec: unknown): unknown => { + const recX = rec as SmallDetailDto + if (typeof recX?.gender_code !== 'number' && recX?.gender_code !== '') { + return 'Tidak Diketahui' + } + return recX.gender_code + }, + education: (rec: unknown): unknown => { + const recX = rec as SmallDetailDto + if (typeof recX.education_code == 'number' && recX.education_code >= 0) { + return recX.education_code + } else if (typeof recX.education_code) { + return recX.education_code + } + return '-' + }, +} + +export const funcComponent: RecStrFuncComponent = { + action(rec, idx) { + const res: RecComponent = { + idx, + rec: rec as object, + component: action, + } + return res + }, +} + +export const funcHtml: RecStrFuncUnknown = { + patient_address(_rec) { + return '-' + }, +} diff --git a/app/components/app/patient/list.vue b/app/components/app/patient/list.vue index e69de29b..d2f74529 100644 --- a/app/components/app/patient/list.vue +++ b/app/components/app/patient/list.vue @@ -0,0 +1,19 @@ + + + diff --git a/app/components/flow/patient/list.vue b/app/components/flow/patient/list.vue index 0cae3161..cde5209c 100644 --- a/app/components/flow/patient/list.vue +++ b/app/components/flow/patient/list.vue @@ -1,4 +1,6 @@ diff --git a/app/components/pub/nav/data-table.vue b/app/components/pub/nav/data-table.vue new file mode 100644 index 00000000..5477c734 --- /dev/null +++ b/app/components/pub/nav/data-table.vue @@ -0,0 +1,46 @@ + + + diff --git a/app/components/pub/nav/dropdown-action-dud.vue b/app/components/pub/nav/dropdown-action-dud.vue new file mode 100644 index 00000000..dfba60e0 --- /dev/null +++ b/app/components/pub/nav/dropdown-action-dud.vue @@ -0,0 +1,82 @@ + + + diff --git a/app/components/pub/nav/footer/cs.vue b/app/components/pub/nav/footer/cs.vue index c7786b76..d51bf74a 100644 --- a/app/components/pub/nav/footer/cs.vue +++ b/app/components/pub/nav/footer/cs.vue @@ -1,12 +1,24 @@ - + diff --git a/app/components/pub/nav/footer/csd.vue b/app/components/pub/nav/footer/csd.vue new file mode 100644 index 00000000..78874932 --- /dev/null +++ b/app/components/pub/nav/footer/csd.vue @@ -0,0 +1,28 @@ + + + diff --git a/app/components/pub/nav/types.ts b/app/components/pub/nav/types.ts index 91b53410..aa4d130b 100644 --- a/app/components/pub/nav/types.ts +++ b/app/components/pub/nav/types.ts @@ -82,3 +82,12 @@ export interface KeyNames { key: string label: string } + +export interface LinkItem { + label: string + icon?: string + href?: string // to cover the needs of stating full external origins full url + action?: string // for local paths + onClick?: (event: Event) => void + headerStatus?: boolean +}