From 4ac3e3c579108aa0e133d4818713bee1c5366a5f Mon Sep 17 00:00:00 2001 From: riefive Date: Mon, 24 Nov 2025 10:53:11 +0700 Subject: [PATCH] refactor: clean up role permission handling in encounter process pages --- .../content/encounter/process-next.vue | 1 - app/handlers/encounter-init.handler.ts | 14 ++++--- .../emergency/encounter/[id]/process.vue | 38 ++++++++----------- .../inpatient/encounter/[id]/process.vue | 3 +- 4 files changed, 25 insertions(+), 31 deletions(-) diff --git a/app/components/content/encounter/process-next.vue b/app/components/content/encounter/process-next.vue index c8e7ad77..df0219bd 100644 --- a/app/components/content/encounter/process-next.vue +++ b/app/components/content/encounter/process-next.vue @@ -95,7 +95,6 @@ function initMenus() { protocolChemotherapy: paginationMeta, medicineProtocolChemotherapy: paginationMeta, }) - console.log(menus.value) } async function getData() { diff --git a/app/handlers/encounter-init.handler.ts b/app/handlers/encounter-init.handler.ts index 240c071f..5e0cee10 100644 --- a/app/handlers/encounter-init.handler.ts +++ b/app/handlers/encounter-init.handler.ts @@ -33,7 +33,9 @@ const AssesmentFunctionListAsync = defineAsyncComponent(() => import('~/componen const EarlyMedicalAssesmentListAsync = defineAsyncComponent(() => import('~/components/content/soapi/entry.vue')) const EarlyMedicalRehabListAsync = defineAsyncComponent(() => import('~/components/content/soapi/entry.vue')) const ChemoProtocolListAsync = defineAsyncComponent(() => import('~/components/app/chemotherapy/list.protocol.vue')) -const ChemoMedicineProtocolListAsync = defineAsyncComponent(() => import('~/components/app/chemotherapy/list.medicine.vue')) +const ChemoMedicineProtocolListAsync = defineAsyncComponent( + () => import('~/components/app/chemotherapy/list.medicine.vue'), +) const DeviceOrderAsync = defineAsyncComponent(() => import('~/components/content/device-order/main.vue')) const PrescriptionAsync = defineAsyncComponent(() => import('~/components/content/prescription/main.vue')) const CpLabOrderAsync = defineAsyncComponent(() => import('~/components/content/cp-lab-order/main.vue')) @@ -92,13 +94,13 @@ const defaultKeys: Record = { unit: 'chemo', afterId: 'chemotherapy-protocol', }, - educationAssessment: { + educationAssessment: { id: 'education-assessment', title: 'Asesmen Kebutuhan Edukasi', classCode: ['ambulatory', 'emergency', 'inpatient'], unit: 'all', }, - consent: { + consent: { id: 'consent', title: 'General Consent', classCode: ['ambulatory', 'emergency', 'inpatient'], @@ -277,13 +279,13 @@ export function injectComponents(id: string | number, data: EncounterListData, m paginationMeta: meta?.medicineProtocolChemotherapy, } } - if (currentKeys?.educationAssessment) { + if (currentKeys?.educationAssessment) { currentKeys.educationAssessment['component'] = null currentKeys.educationAssessment['props'] = { encounter_id: id } } if (currentKeys?.consent) { - currentKeys.report['component'] = GeneralConsentListAsync - currentKeys.report['props'] = { encounter_id: id } + currentKeys.consent['component'] = GeneralConsentListAsync + currentKeys.consent['props'] = { encounter_id: id } } if (currentKeys?.patientNote) { currentKeys.patientNote['component'] = null diff --git a/app/pages/(features)/emergency/encounter/[id]/process.vue b/app/pages/(features)/emergency/encounter/[id]/process.vue index 2e6e837c..03bedd73 100644 --- a/app/pages/(features)/emergency/encounter/[id]/process.vue +++ b/app/pages/(features)/emergency/encounter/[id]/process.vue @@ -1,7 +1,7 @@ + + \ No newline at end of file diff --git a/app/pages/(features)/inpatient/encounter/[id]/process.vue b/app/pages/(features)/inpatient/encounter/[id]/process.vue index 2640a99a..87706c70 100644 --- a/app/pages/(features)/inpatient/encounter/[id]/process.vue +++ b/app/pages/(features)/inpatient/encounter/[id]/process.vue @@ -1,7 +1,6 @@