From 89b2fb9cd95a0e60efaa139ee6efcf7ebe00a61e Mon Sep 17 00:00:00 2001 From: riefive Date: Mon, 3 Nov 2025 15:03:56 +0700 Subject: [PATCH] feat(chemo): add page process and modify components --- .../dialog-verification.vue | 0 .../entry-form.vue | 4 +- .../app/chemotherapy/list-cfg.medicine.ts | 69 +++++++++++++++ .../list-cfg.protocol.ts | 0 .../{cemotherapy => chemotherapy}/list-cfg.ts | 0 .../list-cfg.visit.ts | 0 .../app/chemotherapy/list.medicine.vue | 76 +++++++++++++++++ .../list.protocol.vue | 0 .../list.register.vue | 0 .../list.visit.vue | 0 .../{cemotherapy => chemotherapy}/list.vue | 0 .../{cemotherapy => chemotherapy}/sample.ts | 4 +- .../status-badge.vue | 0 .../verify-button.vue | 0 .../{cemotherapy => chemotherapy}/list.vue | 8 +- .../content/chemotherapy/process.vue | 83 +++++++++++++++++++ .../protocol.vue | 6 +- .../chemotherapy/[id]/index.vue | 42 ++++++++++ .../outpatient-action/chemotherapy/index.vue | 9 ++ .../chemotherapy}/list.vue | 2 +- .../outpation-action/cemotherapy/index.vue | 7 -- ...erapy.schema.ts => chemotherapy.schema.ts} | 2 +- public/side-menu-items/doc.json | 2 +- public/side-menu-items/nur.json | 2 +- public/side-menu-items/nut.json | 2 +- public/side-menu-items/sys.json | 2 +- 26 files changed, 296 insertions(+), 24 deletions(-) rename app/components/app/{cemotherapy => chemotherapy}/dialog-verification.vue (100%) rename app/components/app/{cemotherapy => chemotherapy}/entry-form.vue (98%) create mode 100644 app/components/app/chemotherapy/list-cfg.medicine.ts rename app/components/app/{cemotherapy => chemotherapy}/list-cfg.protocol.ts (100%) rename app/components/app/{cemotherapy => chemotherapy}/list-cfg.ts (100%) rename app/components/app/{cemotherapy => chemotherapy}/list-cfg.visit.ts (100%) create mode 100644 app/components/app/chemotherapy/list.medicine.vue rename app/components/app/{cemotherapy => chemotherapy}/list.protocol.vue (100%) rename app/components/app/{cemotherapy => chemotherapy}/list.register.vue (100%) rename app/components/app/{cemotherapy => chemotherapy}/list.visit.vue (100%) rename app/components/app/{cemotherapy => chemotherapy}/list.vue (100%) rename app/components/app/{cemotherapy => chemotherapy}/sample.ts (92%) rename app/components/app/{cemotherapy => chemotherapy}/status-badge.vue (100%) rename app/components/app/{cemotherapy => chemotherapy}/verify-button.vue (100%) rename app/components/content/{cemotherapy => chemotherapy}/list.vue (88%) create mode 100644 app/components/content/chemotherapy/process.vue rename app/components/content/{cemotherapy => chemotherapy}/protocol.vue (90%) create mode 100644 app/pages/(features)/outpatient-action/chemotherapy/[id]/index.vue create mode 100644 app/pages/(features)/outpatient-action/chemotherapy/index.vue rename app/pages/(features)/{outpation-action/cemotherapy => outpatient-action/chemotherapy}/list.vue (96%) delete mode 100644 app/pages/(features)/outpation-action/cemotherapy/index.vue rename app/schemas/{cemotherapy.schema.ts => chemotherapy.schema.ts} (97%) diff --git a/app/components/app/cemotherapy/dialog-verification.vue b/app/components/app/chemotherapy/dialog-verification.vue similarity index 100% rename from app/components/app/cemotherapy/dialog-verification.vue rename to app/components/app/chemotherapy/dialog-verification.vue diff --git a/app/components/app/cemotherapy/entry-form.vue b/app/components/app/chemotherapy/entry-form.vue similarity index 98% rename from app/components/app/cemotherapy/entry-form.vue rename to app/components/app/chemotherapy/entry-form.vue index 3a4104b8..39113d63 100644 --- a/app/components/app/cemotherapy/entry-form.vue +++ b/app/components/app/chemotherapy/entry-form.vue @@ -13,7 +13,7 @@ import DatepickerSingle from '~/components/pub/my-ui/datepicker/datepicker-singl import type z from 'zod' import { useForm } from 'vee-validate' import { toTypedSchema } from '@vee-validate/zod' -import { cemotherapySchema } from "~/schemas/cemotherapy.schema" +import { chemotherapySchema } from "~/schemas/chemotherapy.schema" interface Props { values?: any @@ -37,7 +37,7 @@ const emit = defineEmits<{ }>() const { defineField, errors, meta } = useForm({ - validationSchema: toTypedSchema(cemotherapySchema), + validationSchema: toTypedSchema(chemotherapySchema), initialValues: { namaPasien: '', tanggalLahir: '', diff --git a/app/components/app/chemotherapy/list-cfg.medicine.ts b/app/components/app/chemotherapy/list-cfg.medicine.ts new file mode 100644 index 00000000..103452f5 --- /dev/null +++ b/app/components/app/chemotherapy/list-cfg.medicine.ts @@ -0,0 +1,69 @@ +import type { Config, RecComponent } from '~/components/pub/my-ui/data-table' +import { defineAsyncComponent } from 'vue' + +type SmallDetailDto = any + +const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dud.vue')) + +export const config: Config = { + cols: [ + { width: 60 }, + { width: 200 }, + { width: 100 }, + { width: 100 }, + { width: 150 }, + { width: 80 }, + { width: 200 }, + { width: 120 }, + ], + + headers: [ + [ + { label: 'NO.' }, + { label: 'NAMA OBAT' }, + { label: 'DOSIS' }, + { label: 'SATUAN' }, + { label: 'RUTE PEMBERIAN' }, + { label: 'HARI' }, + { label: 'CATATAN' }, + { label: '' }, + ], + ], + + keys: [ + 'number', + 'namaObat', + 'dosis', + 'satuan', + 'rute', + 'hari', + 'catatan', + 'action', + ], + + delKeyNames: [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, + ], + + parses: { + parent: (rec: unknown): unknown => { + const recX = rec as SmallDetailDto + return recX.parent?.name || '-' + }, + }, + + components: { + action(rec, idx) { + const res: RecComponent = { + idx, + rec: rec as object, + component: action, + } + return res + }, + }, + + htmls: {}, +} + diff --git a/app/components/app/cemotherapy/list-cfg.protocol.ts b/app/components/app/chemotherapy/list-cfg.protocol.ts similarity index 100% rename from app/components/app/cemotherapy/list-cfg.protocol.ts rename to app/components/app/chemotherapy/list-cfg.protocol.ts diff --git a/app/components/app/cemotherapy/list-cfg.ts b/app/components/app/chemotherapy/list-cfg.ts similarity index 100% rename from app/components/app/cemotherapy/list-cfg.ts rename to app/components/app/chemotherapy/list-cfg.ts diff --git a/app/components/app/cemotherapy/list-cfg.visit.ts b/app/components/app/chemotherapy/list-cfg.visit.ts similarity index 100% rename from app/components/app/cemotherapy/list-cfg.visit.ts rename to app/components/app/chemotherapy/list-cfg.visit.ts diff --git a/app/components/app/chemotherapy/list.medicine.vue b/app/components/app/chemotherapy/list.medicine.vue new file mode 100644 index 00000000..748c8cb9 --- /dev/null +++ b/app/components/app/chemotherapy/list.medicine.vue @@ -0,0 +1,76 @@ + + + + diff --git a/app/components/app/cemotherapy/list.protocol.vue b/app/components/app/chemotherapy/list.protocol.vue similarity index 100% rename from app/components/app/cemotherapy/list.protocol.vue rename to app/components/app/chemotherapy/list.protocol.vue diff --git a/app/components/app/cemotherapy/list.register.vue b/app/components/app/chemotherapy/list.register.vue similarity index 100% rename from app/components/app/cemotherapy/list.register.vue rename to app/components/app/chemotherapy/list.register.vue diff --git a/app/components/app/cemotherapy/list.visit.vue b/app/components/app/chemotherapy/list.visit.vue similarity index 100% rename from app/components/app/cemotherapy/list.visit.vue rename to app/components/app/chemotherapy/list.visit.vue diff --git a/app/components/app/cemotherapy/list.vue b/app/components/app/chemotherapy/list.vue similarity index 100% rename from app/components/app/cemotherapy/list.vue rename to app/components/app/chemotherapy/list.vue diff --git a/app/components/app/cemotherapy/sample.ts b/app/components/app/chemotherapy/sample.ts similarity index 92% rename from app/components/app/cemotherapy/sample.ts rename to app/components/app/chemotherapy/sample.ts index 24b9ebbf..082cde66 100644 --- a/app/components/app/cemotherapy/sample.ts +++ b/app/components/app/chemotherapy/sample.ts @@ -1,4 +1,4 @@ -export type CemotherapyData = { +export type ChemotherapyData = { id: number tanggal: string noRm: string @@ -14,7 +14,7 @@ export type CemotherapyData = { asal: string } -export const sampleRows: CemotherapyData[] = [ +export const sampleRows: ChemotherapyData[] = [ { id: 1, tanggal: '12 Agustus 2025', diff --git a/app/components/app/cemotherapy/status-badge.vue b/app/components/app/chemotherapy/status-badge.vue similarity index 100% rename from app/components/app/cemotherapy/status-badge.vue rename to app/components/app/chemotherapy/status-badge.vue diff --git a/app/components/app/cemotherapy/verify-button.vue b/app/components/app/chemotherapy/verify-button.vue similarity index 100% rename from app/components/app/cemotherapy/verify-button.vue rename to app/components/app/chemotherapy/verify-button.vue diff --git a/app/components/content/cemotherapy/list.vue b/app/components/content/chemotherapy/list.vue similarity index 88% rename from app/components/content/cemotherapy/list.vue rename to app/components/content/chemotherapy/list.vue index 957a827f..d4104f03 100644 --- a/app/components/content/cemotherapy/list.vue +++ b/app/components/content/chemotherapy/list.vue @@ -2,10 +2,10 @@ import { ref, computed } from 'vue' // Components -import AppCemotherapyList from '~/components/app/cemotherapy/list.vue' +import AppChemotherapyList from '~/components/app/chemotherapy/list.vue' // Samples -import { sampleRows, type CemotherapyData } from '~/components/app/cemotherapy/sample' +import { sampleRows, type ChemotherapyData } from '~/components/app/chemotherapy/sample' const search = ref('') const dateFrom = ref('') @@ -14,7 +14,7 @@ const dateTo = ref('') // filter + pencarian sederhana (client-side) const filtered = computed(() => { const q = search.value.trim().toLowerCase() - return sampleRows.filter((r: CemotherapyData) => { + return sampleRows.filter((r: ChemotherapyData) => { if (q) { return r.nama.toLowerCase().includes(q) || r.noRm.toLowerCase().includes(q) || r.dokter.toLowerCase().includes(q) } @@ -59,7 +59,7 @@ const filtered = computed(() => {
- +// +import { computed } from 'vue' +import { useRoute, useRouter } from 'vue-router' + +import { getDetail } from '~/services/encounter.service' + +// +import type { TabItem } from '~/components/pub/my-ui/comp-tab/type' +import CompTab from '~/components/pub/my-ui/comp-tab/comp-tab.vue' + +// PLASE ORDER BY TAB POSITION +import ProtocolList from '~/components/app/chemotherapy/list.protocol.vue' +import MedicineProtocolList from '~/components/app/chemotherapy/list.medicine.vue' + +const route = useRoute() +const router = useRouter() + +// activeTab selalu sinkron dengan query param +const activeTab = computed({ + get: () => (route.query?.tab && typeof route.query.tab === 'string' ? route.query.tab : 'chemotherapy-protocol'), + set: (val: string) => { + router.replace({ path: route.path, query: { tab: val } }) + }, +}) + +const id = typeof route.params.id == 'string' ? parseInt(route.params.id) : 0 +const dataRes = await getDetail(id, { + includes: + 'patient,patient-person,patient-person-addresses,unit,Appointment_Doctor,Appointment_Doctor-employee,Appointment_Doctor-employee-person', +}) +const dataResBody = dataRes.body ?? null +const data = dataResBody?.data ?? null + +// Dummy rows for ProtocolList (matches keys expected by list-cfg.protocol) +const protocolRows = [ + { + number: '1', + tanggal: new Date().toISOString().substring(0, 10), + siklus: 'I', + periode: 'Siklus I', + kehadiran: 'Hadir', + action: '', + }, + { + number: '2', + tanggal: new Date().toISOString().substring(0, 10), + siklus: 'II', + periode: 'Siklus II', + kehadiran: 'Tidak Hadir', + action: '', + }, +] + +const paginationMeta = { + recordCount: protocolRows.length, + page: 1, + pageSize: 10, + totalPage: 1, + hasNext: false, + hasPrev: false, +} + +const tabs: TabItem[] = [ + { value: 'chemotherapy-protocol', label: 'Protokol Kemoterapi', component: ProtocolList, props: { data: protocolRows, paginationMeta } }, + { value: 'chemotherapy-medicine', label: 'Protokol Obat Kemoterapi', component: MedicineProtocolList, props: { data: protocolRows, paginationMeta } }, +] + + + + diff --git a/app/components/content/cemotherapy/protocol.vue b/app/components/content/chemotherapy/protocol.vue similarity index 90% rename from app/components/content/cemotherapy/protocol.vue rename to app/components/content/chemotherapy/protocol.vue index 427b4642..82050d79 100644 --- a/app/components/content/cemotherapy/protocol.vue +++ b/app/components/content/chemotherapy/protocol.vue @@ -8,7 +8,7 @@ import type { PaginationMeta } from '~/components/pub/my-ui/pagination/paginatio // Components import CompTab from '~/components/pub/my-ui/comp-tab/comp-tab.vue' -import ProtocolList from '~/components/app/cemotherapy/list.protocol.vue' +import ProtocolList from '~/components/app/chemotherapy/list.protocol.vue' // Services import { getDetail } from '~/services/encounter.service' @@ -76,8 +76,8 @@ const paginationMeta: PaginationMeta = { } const tabs: TabItem[] = [ - { value: 'cemotherapy-protocol', label: 'Protokol Kemoterapi', component: ProtocolList, props: { data: protocolRows, paginationMeta } }, - { value: 'cemotherapy-medicine', label: 'Protokol Obat Kemoterapi' }, + { value: 'chemotherapy-protocol', label: 'Protokol Kemoterapi', component: ProtocolList, props: { data: protocolRows, paginationMeta } }, + { value: 'chemotherapy-medicine', label: 'Protokol Obat Kemoterapi' }, ] onMounted(async () => { diff --git a/app/pages/(features)/outpatient-action/chemotherapy/[id]/index.vue b/app/pages/(features)/outpatient-action/chemotherapy/[id]/index.vue new file mode 100644 index 00000000..edc1cd02 --- /dev/null +++ b/app/pages/(features)/outpatient-action/chemotherapy/[id]/index.vue @@ -0,0 +1,42 @@ + + + + diff --git a/app/pages/(features)/outpatient-action/chemotherapy/index.vue b/app/pages/(features)/outpatient-action/chemotherapy/index.vue new file mode 100644 index 00000000..4dd31ebe --- /dev/null +++ b/app/pages/(features)/outpatient-action/chemotherapy/index.vue @@ -0,0 +1,9 @@ + + + diff --git a/app/pages/(features)/outpation-action/cemotherapy/list.vue b/app/pages/(features)/outpatient-action/chemotherapy/list.vue similarity index 96% rename from app/pages/(features)/outpation-action/cemotherapy/list.vue rename to app/pages/(features)/outpatient-action/chemotherapy/list.vue index 02326343..a141baaa 100644 --- a/app/pages/(features)/outpation-action/cemotherapy/list.vue +++ b/app/pages/(features)/outpatient-action/chemotherapy/list.vue @@ -33,7 +33,7 @@ const canRead = true // hasReadAccess(roleAccess)