diff --git a/app/components/app/encounter/assesment-function/entry-form.vue b/app/components/app/encounter/assesment-function/entry-form.vue new file mode 100644 index 00000000..5768c6a0 --- /dev/null +++ b/app/components/app/encounter/assesment-function/entry-form.vue @@ -0,0 +1,47 @@ + + + diff --git a/app/components/app/encounter/assesment-function/list-cfg.ts b/app/components/app/encounter/assesment-function/list-cfg.ts new file mode 100644 index 00000000..24cc80d1 --- /dev/null +++ b/app/components/app/encounter/assesment-function/list-cfg.ts @@ -0,0 +1,112 @@ +import type { Col, KeyLabel, RecComponent, RecStrFuncComponent, RecStrFuncUnknown, Th } from '~/components/pub/custom-ui/data/types' +import { defineAsyncComponent } from 'vue' + +type SmallDetailDto = any + +const action = defineAsyncComponent(() => import('~/components/pub/custom-ui/data/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/encounter/assesment-function/list.vue b/app/components/app/encounter/assesment-function/list.vue new file mode 100644 index 00000000..5b8778d9 --- /dev/null +++ b/app/components/app/encounter/assesment-function/list.vue @@ -0,0 +1,19 @@ + + + diff --git a/app/components/app/encounter/assesment-function/picker.vue b/app/components/app/encounter/assesment-function/picker.vue new file mode 100644 index 00000000..e69de29b diff --git a/app/components/app/encounter/assesment-function/search.vue b/app/components/app/encounter/assesment-function/search.vue new file mode 100644 index 00000000..e69de29b diff --git a/app/components/content/encounter/assesment-function/add.vue b/app/components/content/encounter/assesment-function/add.vue new file mode 100644 index 00000000..128cf74a --- /dev/null +++ b/app/components/content/encounter/assesment-function/add.vue @@ -0,0 +1,3 @@ + diff --git a/app/components/content/encounter/assesment-function/list.vue b/app/components/content/encounter/assesment-function/list.vue new file mode 100644 index 00000000..c53a6881 --- /dev/null +++ b/app/components/content/encounter/assesment-function/list.vue @@ -0,0 +1,64 @@ + + + diff --git a/app/components/content/encounter/home.vue b/app/components/content/encounter/home.vue new file mode 100644 index 00000000..2a4be548 --- /dev/null +++ b/app/components/content/encounter/home.vue @@ -0,0 +1,100 @@ + + + diff --git a/app/components/content/encounter/list.vue b/app/components/content/encounter/list.vue index 363d99bf..33ed1483 100644 --- a/app/components/content/encounter/list.vue +++ b/app/components/content/encounter/list.vue @@ -8,6 +8,10 @@ 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 props = defineProps<{ + type: string +}>() + const data = ref([]) const isLoading = reactive({ summary: false, @@ -60,14 +64,26 @@ watch( () => recAction.value, () => { console.log('recAction.value', recAction.value) - if (recAction.value === 'showDetail') { - navigateTo(`/rehab/encounter/${recId.value}/detail`) - } else if (recAction.value === 'showEdit') { - navigateTo(`/rehab/encounter/${recId.value}/edit`) - } else if (recAction.value === 'showProcess') { - navigateTo(`/rehab/encounter/${recId.value}/process`) - } else { - // handle other actions + if (props.type === 'encounter') { + if (recAction.value === 'showDetail') { + navigateTo(`/rehab/encounter/${recId.value}/detail`) + } else if (recAction.value === 'showEdit') { + navigateTo(`/rehab/encounter/${recId.value}/edit`) + } else if (recAction.value === 'showProcess') { + navigateTo(`/rehab/encounter/${recId.value}/process`) + } else { + // handle other actions + } + } else if (props.type === 'registration') { + if (recAction.value === 'showDetail') { + navigateTo(`/rehab/registration/${recId.value}/detail`) + } else if (recAction.value === 'showEdit') { + navigateTo(`/rehab/registration/${recId.value}/edit`) + } else if (recAction.value === 'showProcess') { + navigateTo(`/rehab/registration/${recId.value}/process`) + } else { + // handle other actions + } } }, ) @@ -86,7 +102,7 @@ provide('table_data_loader', isLoading) - + diff --git a/app/lib/page-permission.ts b/app/lib/page-permission.ts index 95673f20..c527a8cc 100644 --- a/app/lib/page-permission.ts +++ b/app/lib/page-permission.ts @@ -33,4 +33,12 @@ export const PAGE_PERMISSIONS = { billing: ['R'], management: ['R'], }, + '/rehab/registration': { + doctor: ['C', 'R', 'U', 'D'], + nurse: ['R'], + admisi: ['R'], + pharmacy: ['R'], + billing: ['R'], + management: ['R'], + }, } as const satisfies Record diff --git a/app/pages/(features)/rehab/encounter/[id]/process.vue b/app/pages/(features)/rehab/encounter/[id]/process.vue index ad499dfe..c1b8b716 100644 --- a/app/pages/(features)/rehab/encounter/[id]/process.vue +++ b/app/pages/(features)/rehab/encounter/[id]/process.vue @@ -35,7 +35,7 @@ const canCreate = hasCreateAccess(roleAccess) diff --git a/app/pages/(features)/rehab/encounter/index.vue b/app/pages/(features)/rehab/encounter/index.vue index 777eebf3..7cd6c5ed 100644 --- a/app/pages/(features)/rehab/encounter/index.vue +++ b/app/pages/(features)/rehab/encounter/index.vue @@ -33,7 +33,7 @@ const canRead = hasReadAccess(roleAccess)