From 323485347300abee84439e5956815cc2dafc5cf9 Mon Sep 17 00:00:00 2001 From: riefive Date: Wed, 29 Oct 2025 15:39:55 +0700 Subject: [PATCH 01/13] feat(cemo): add list of cemo --- app/components/app/cemotherapy/list-cfg.ts | 80 ++++++++++++++++++++++ app/components/app/cemotherapy/list.vue | 36 ++++++++++ app/components/app/cemotherapy/sample.ts | 49 +++++++++++++ 3 files changed, 165 insertions(+) create mode 100644 app/components/app/cemotherapy/list-cfg.ts create mode 100644 app/components/app/cemotherapy/list.vue create mode 100644 app/components/app/cemotherapy/sample.ts diff --git a/app/components/app/cemotherapy/list-cfg.ts b/app/components/app/cemotherapy/list-cfg.ts new file mode 100644 index 00000000..29c24e6f --- /dev/null +++ b/app/components/app/cemotherapy/list-cfg.ts @@ -0,0 +1,80 @@ +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: 120 }, + { width: 120 }, + { width: 120 }, + { width: 120 }, + { width: 120 }, + { width: 120 }, + { width: 120 }, + { width: 120 }, + { width: 120 }, + { width: 120 }, + { width: 120 }, + { width: 50 }, + ], + + headers: [ + [ + { label: 'TANGGAL' }, + { label: 'NO. RM' }, + { label: 'NO. BILL' }, + { label: 'JK' }, + { label: 'ALAMAT' }, + { label: 'KLINIK ASAL' }, + { label: 'NAMA DOKTER' }, + { label: 'CARA BAYAR' }, + { label: 'RUJUKAN' }, + { label: 'KET. RUJUKAN' }, + { label: 'ASAL' }, + { label: '' }, + ], + ], + + keys: [ + 'tanggal', + 'noRm', + 'noBill', + 'jk', + 'alamat', + 'klinik', + 'dokter', + 'caraBayar', + 'rujukan', + 'ketRujukan', + 'asal', + '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.vue b/app/components/app/cemotherapy/list.vue new file mode 100644 index 00000000..19642581 --- /dev/null +++ b/app/components/app/cemotherapy/list.vue @@ -0,0 +1,36 @@ + + + \ No newline at end of file diff --git a/app/components/app/cemotherapy/sample.ts b/app/components/app/cemotherapy/sample.ts new file mode 100644 index 00000000..254e64f6 --- /dev/null +++ b/app/components/app/cemotherapy/sample.ts @@ -0,0 +1,49 @@ +export type Row = { + id: number + tanggal: string + noRm: string + noBill: string + nama: string + jk: string + alamat: string + klinik: string + dokter: string + caraBayar: string + rujukan: string + ketRujukan: string + asal: string +} + +export const sampleRows: Row[] = [ + { + id: 1, + tanggal: '12 Agustus 2025', + noRm: 'RM23311224', + noBill: '-', + nama: 'Ahmad Baidowi', + jk: 'L', + alamat: 'Jl Jaksa Agung S. No. 9', + klinik: 'Penyakit dalam', + dokter: 'Dr. Andreas Sutaji', + caraBayar: 'JKN', + rujukan: 'Faskes BPJS', + ketRujukan: 'RUMAH SAKIT - RS Lawang Medika - Malang', + asal: 'Rawat Jalan Reguler', + }, + { + id: 2, + tanggal: '11 Agustus 2025', + noRm: 'RM23455667', + noBill: '-', + nama: 'Abraham Sulaiman', + jk: 'L', + alamat: 'Purwantoro, Blimbing', + klinik: 'Penyakit dalam', + dokter: 'Dr. Andreas Sutaji', + caraBayar: 'JKN', + rujukan: 'Faskes BPJS', + ketRujukan: 'RUMAH SAKIT - RS Lawang Medika - Malang', + asal: 'Rawat Jalan Reguler', + }, + // tambahkan lebih banyak baris contoh jika perlu +] From dc4edc1dc0053f350cdf8ad82c4c816099285671 Mon Sep 17 00:00:00 2001 From: riefive Date: Wed, 29 Oct 2025 15:58:52 +0700 Subject: [PATCH 02/13] feat(cemo): show list cemo --- app/components/app/cemotherapy/sample.ts | 4 +- app/components/content/cemotherapy/list.vue | 75 +++++++++++++++++++ .../outpation-action/cemotherapy/list.vue | 40 ++++++++++ 3 files changed, 117 insertions(+), 2 deletions(-) create mode 100644 app/components/content/cemotherapy/list.vue create mode 100644 app/pages/(features)/outpation-action/cemotherapy/list.vue diff --git a/app/components/app/cemotherapy/sample.ts b/app/components/app/cemotherapy/sample.ts index 254e64f6..24b9ebbf 100644 --- a/app/components/app/cemotherapy/sample.ts +++ b/app/components/app/cemotherapy/sample.ts @@ -1,4 +1,4 @@ -export type Row = { +export type CemotherapyData = { id: number tanggal: string noRm: string @@ -14,7 +14,7 @@ export type Row = { asal: string } -export const sampleRows: Row[] = [ +export const sampleRows: CemotherapyData[] = [ { id: 1, tanggal: '12 Agustus 2025', diff --git a/app/components/content/cemotherapy/list.vue b/app/components/content/cemotherapy/list.vue new file mode 100644 index 00000000..957a827f --- /dev/null +++ b/app/components/content/cemotherapy/list.vue @@ -0,0 +1,75 @@ + + + diff --git a/app/pages/(features)/outpation-action/cemotherapy/list.vue b/app/pages/(features)/outpation-action/cemotherapy/list.vue new file mode 100644 index 00000000..02326343 --- /dev/null +++ b/app/pages/(features)/outpation-action/cemotherapy/list.vue @@ -0,0 +1,40 @@ + + + From e866c0cf2ae2c3daf1b508e31b9b0ad8a28cfa69 Mon Sep 17 00:00:00 2001 From: riefive Date: Thu, 30 Oct 2025 14:41:52 +0700 Subject: [PATCH 03/13] feat(cemo): layouting protocol --- .../app/cemotherapy/list-cfg.protocol.ts | 62 ++++++++++ .../app/cemotherapy/list.protocol.vue | 75 +++++++++++++ .../content/cemotherapy/protocol.vue | 106 ++++++++++++++++++ .../outpation-action/cemotherapy/index.vue | 7 +- 4 files changed, 245 insertions(+), 5 deletions(-) create mode 100644 app/components/app/cemotherapy/list-cfg.protocol.ts create mode 100644 app/components/app/cemotherapy/list.protocol.vue create mode 100644 app/components/content/cemotherapy/protocol.vue diff --git a/app/components/app/cemotherapy/list-cfg.protocol.ts b/app/components/app/cemotherapy/list-cfg.protocol.ts new file mode 100644 index 00000000..da678c0f --- /dev/null +++ b/app/components/app/cemotherapy/list-cfg.protocol.ts @@ -0,0 +1,62 @@ +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: 120 }, + { width: 120 }, + { width: 120 }, + { width: 120 }, + { width: 120 }, + { width: 50 }, + ], + + headers: [ + [ + { label: 'NO.' }, + { label: 'TANGGAL' }, + { label: 'SIKLUS' }, + { label: 'PERIODE KEMOTERAPI' }, + { label: 'KEHADIRAN' }, + { label: '' }, + ], + ], + + keys: [ + 'number', + 'tanggal', + 'siklus', + 'periode', + 'kehadiran', + '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.protocol.vue b/app/components/app/cemotherapy/list.protocol.vue new file mode 100644 index 00000000..7b5c3234 --- /dev/null +++ b/app/components/app/cemotherapy/list.protocol.vue @@ -0,0 +1,75 @@ + + + diff --git a/app/components/content/cemotherapy/protocol.vue b/app/components/content/cemotherapy/protocol.vue new file mode 100644 index 00000000..427b4642 --- /dev/null +++ b/app/components/content/cemotherapy/protocol.vue @@ -0,0 +1,106 @@ + + + diff --git a/app/pages/(features)/outpation-action/cemotherapy/index.vue b/app/pages/(features)/outpation-action/cemotherapy/index.vue index 50485cec..06da4369 100644 --- a/app/pages/(features)/outpation-action/cemotherapy/index.vue +++ b/app/pages/(features)/outpation-action/cemotherapy/index.vue @@ -1,10 +1,7 @@ From 45cc019ec1f37583e5e950a45a095c74ff099538 Mon Sep 17 00:00:00 2001 From: riefive Date: Thu, 30 Oct 2025 15:43:50 +0700 Subject: [PATCH 04/13] feat(cemo): layouting form --- app/components/app/cemotherapy/entry-form.vue | 306 ++++++++++++++++++ 1 file changed, 306 insertions(+) create mode 100644 app/components/app/cemotherapy/entry-form.vue diff --git a/app/components/app/cemotherapy/entry-form.vue b/app/components/app/cemotherapy/entry-form.vue new file mode 100644 index 00000000..1b6e9140 --- /dev/null +++ b/app/components/app/cemotherapy/entry-form.vue @@ -0,0 +1,306 @@ + + + From 7119f67402b5261226257b3aa6e193d516f33041 Mon Sep 17 00:00:00 2001 From: riefive Date: Fri, 31 Oct 2025 13:09:59 +0700 Subject: [PATCH 05/13] feat(cemo): modify schema --- app/components/app/cemotherapy/entry-form.vue | 24 +++--- app/schemas/cemotherapy.schema.ts | 73 +++++++++++++++++++ 2 files changed, 83 insertions(+), 14 deletions(-) create mode 100644 app/schemas/cemotherapy.schema.ts diff --git a/app/components/app/cemotherapy/entry-form.vue b/app/components/app/cemotherapy/entry-form.vue index 1b6e9140..3a4104b8 100644 --- a/app/components/app/cemotherapy/entry-form.vue +++ b/app/components/app/cemotherapy/entry-form.vue @@ -4,22 +4,18 @@ import Block from '~/components/pub/my-ui/doc-entry/block.vue' import Cell from '~/components/pub/my-ui/doc-entry/cell.vue' import Field from '~/components/pub/my-ui/doc-entry/field.vue' import Label from '~/components/pub/my-ui/doc-entry/label.vue' +import Input from '~/components/pub/ui/input/Input.vue' import Button from '~/components/pub/ui/button/Button.vue' import Combobox from '~/components/pub/my-ui/combobox/combobox.vue' -import Input from '~/components/pub/ui/input/Input.vue' import DatepickerSingle from '~/components/pub/my-ui/datepicker/datepicker-single.vue' -// Types -import type { Ref } from 'vue' -import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type' - // Helpers import type z from 'zod' import { useForm } from 'vee-validate' import { toTypedSchema } from '@vee-validate/zod' +import { cemotherapySchema } from "~/schemas/cemotherapy.schema" interface Props { - schema: z.ZodSchema values?: any isLoading?: boolean isReadonly?: boolean @@ -41,7 +37,7 @@ const emit = defineEmits<{ }>() const { defineField, errors, meta } = useForm({ - validationSchema: toTypedSchema(props.schema), + validationSchema: toTypedSchema(cemotherapySchema), initialValues: { namaPasien: '', tanggalLahir: '', @@ -74,12 +70,12 @@ const [dokterKRJ, dokterKRJAttrs] = defineField('dokterKRJ') // Set initial values if provided if (props.values) { - Object.entries(props.values).forEach(([key, value]) => { - if (value !== undefined) { - const field = defineField(key)[0] - field.value = value - } - }) + // Object.entries(props.values).forEach(([key, value]) => { + // if (value !== undefined) { + // const field = defineField(key)[0] + // field.value = value + // } + // }) } const resetForm = () => { @@ -268,7 +264,7 @@ function onCancelForm() { val === '' ? null : Number(val)) + .refine(val => val === null || (val >= 0 && val <= 500), { + message: 'Berat badan harus di antara 0-500 kg', + }), + + tinggiBadan: z.union([ + z.string(), + z.number() + ]).transform(val => val === '' ? null : Number(val)) + .refine(val => val === null || (val >= 0 && val <= 300), { + message: 'Tinggi badan harus di antara 0-300 cm', + }), + + diagnosa: z.string({ + required_error: 'Diagnosa harus dipilih', + }).min(1, 'Diagnosa harus dipilih'), + + // Protokol Kemoterapi + siklus: z.string({ + required_error: 'Siklus harus diisi', + }).min(1, 'Siklus harus diisi'), + + periodeAwal: z.string({ + required_error: 'Periode awal harus diisi', + }).min(1, 'Periode awal harus diisi'), + + periodeAkhir: dateStringSchema.refine((val) => { + if (!val) return false + const date = new Date(val) + return !isNaN(date.getTime()) + }, { + message: 'Format tanggal tidak valid' + }), + + tanggalKemoterapi: dateStringSchema.refine((val) => { + if (!val) return false + const date = new Date(val) + return !isNaN(date.getTime()) + }, { + message: 'Format tanggal tidak valid' + }), + + dokterKRJ: z.string({ + required_error: 'Dokter harus dipilih', + }).refine(val => val !== '', { + message: 'Dokter harus dipilih', + }), +}) \ No newline at end of file From 71d68e5a0ee084b586be48ddf4035735647f2f34 Mon Sep 17 00:00:00 2001 From: riefive Date: Fri, 31 Oct 2025 14:49:21 +0700 Subject: [PATCH 06/13] feat(cemo): add dialog verification and list register --- .../app/cemotherapy/dialog-verification.vue | 164 ++++++++++++++++++ .../app/cemotherapy/list.register.vue | 71 ++++++++ 2 files changed, 235 insertions(+) create mode 100644 app/components/app/cemotherapy/dialog-verification.vue create mode 100644 app/components/app/cemotherapy/list.register.vue diff --git a/app/components/app/cemotherapy/dialog-verification.vue b/app/components/app/cemotherapy/dialog-verification.vue new file mode 100644 index 00000000..2d617445 --- /dev/null +++ b/app/components/app/cemotherapy/dialog-verification.vue @@ -0,0 +1,164 @@ + + + + diff --git a/app/components/app/cemotherapy/list.register.vue b/app/components/app/cemotherapy/list.register.vue new file mode 100644 index 00000000..131afc04 --- /dev/null +++ b/app/components/app/cemotherapy/list.register.vue @@ -0,0 +1,71 @@ + + + From d1369d513bf5781a03e39c51786f8485338f6e0f Mon Sep 17 00:00:00 2001 From: riefive Date: Fri, 31 Oct 2025 16:08:22 +0700 Subject: [PATCH 07/13] feat(cemo): add list verification --- .../app/cemotherapy/list-cfg.visit.ts | 99 +++++++++++++++++++ app/components/app/cemotherapy/list.visit.vue | 45 +++++++++ .../app/cemotherapy/status-badge.vue | 28 ++++++ .../app/cemotherapy/verify-button.vue | 31 ++++++ 4 files changed, 203 insertions(+) create mode 100644 app/components/app/cemotherapy/list-cfg.visit.ts create mode 100644 app/components/app/cemotherapy/list.visit.vue create mode 100644 app/components/app/cemotherapy/status-badge.vue create mode 100644 app/components/app/cemotherapy/verify-button.vue diff --git a/app/components/app/cemotherapy/list-cfg.visit.ts b/app/components/app/cemotherapy/list-cfg.visit.ts new file mode 100644 index 00000000..cb242d62 --- /dev/null +++ b/app/components/app/cemotherapy/list-cfg.visit.ts @@ -0,0 +1,99 @@ +import type { Config, RecComponent } from '~/components/pub/my-ui/data-table' +import { defineAsyncComponent } from 'vue' +import { format, parseISO } from 'date-fns' +import { id as localeID } from 'date-fns/locale' + +type VisitDto = any + +const statusBadge = defineAsyncComponent(() => import('./status-badge.vue')) +const verifyButton = defineAsyncComponent(() => import('./verify-button.vue')) + +export const config: Config = { + cols: [ + { width: 150 }, // TANGGAL MASUK + { width: 180 }, // PJ BERKAS RM + { width: 200 }, // DOKTER + { width: 150 }, // JENIS RUANGAN + { width: 150 }, // JENIS TINDAKAN + { width: 180 }, // TANGGAL JADWAL TINDAKAN + { width: 150 }, // STATUS + { width: 120 }, // AKSI + ], + + headers: [ + [ + { label: 'TANGGAL MASUK' }, + { label: 'PJ BERKAS RM' }, + { label: 'DOKTER' }, + { label: 'JENIS RUANGAN' }, + { label: 'JENIS TINDAKAN' }, + { label: 'TANGGAL JADWAL TINDAKAN' }, + { label: 'STATUS' }, + { label: 'AKSI' }, + ], + ], + + keys: [ + 'tanggal_masuk', + 'pj_berkas_rm', + 'dokter', + 'jenis_ruangan', + 'jenis_tindakan', + 'tanggal_jadwal_tindakan', + 'status', + 'action', + ], + + delKeyNames: [ + { key: 'id', label: 'ID' }, + { key: 'nama', label: 'Nama' }, + ], + + parses: { + tanggal_masuk: (rec: unknown): string => { + const recX = rec as VisitDto + if (!recX.tanggal_masuk) return '-' + try { + const date = typeof recX.tanggal_masuk === 'string' ? parseISO(recX.tanggal_masuk) : recX.tanggal_masuk + return format(date, 'dd MMMM yyyy', { locale: localeID }) + } catch { + return recX.tanggal_masuk.toString() + } + }, + tanggal_jadwal_tindakan: (rec: unknown): string => { + const recX = rec as VisitDto + if (!recX.tanggal_jadwal_tindakan) return '-' + try { + const date = + typeof recX.tanggal_jadwal_tindakan === 'string' + ? parseISO(recX.tanggal_jadwal_tindakan) + : recX.tanggal_jadwal_tindakan + return format(date, 'dd MMMM yyyy', { locale: localeID }) + } catch { + return recX.tanggal_jadwal_tindakan.toString() + } + }, + }, + + components: { + status(rec, idx) { + const res: RecComponent = { + idx, + rec: rec as object, + component: statusBadge, + } + return res + }, + action(rec, idx) { + const res: RecComponent = { + idx, + rec: rec as object, + component: verifyButton, + } + return res + }, + }, + + htmls: {}, +} + diff --git a/app/components/app/cemotherapy/list.visit.vue b/app/components/app/cemotherapy/list.visit.vue new file mode 100644 index 00000000..de451f31 --- /dev/null +++ b/app/components/app/cemotherapy/list.visit.vue @@ -0,0 +1,45 @@ + + + + diff --git a/app/components/app/cemotherapy/status-badge.vue b/app/components/app/cemotherapy/status-badge.vue new file mode 100644 index 00000000..1a7d94ca --- /dev/null +++ b/app/components/app/cemotherapy/status-badge.vue @@ -0,0 +1,28 @@ + + + + diff --git a/app/components/app/cemotherapy/verify-button.vue b/app/components/app/cemotherapy/verify-button.vue new file mode 100644 index 00000000..1d9c2d3a --- /dev/null +++ b/app/components/app/cemotherapy/verify-button.vue @@ -0,0 +1,31 @@ + + + + From 89b2fb9cd95a0e60efaa139ee6efcf7ebe00a61e Mon Sep 17 00:00:00 2001 From: riefive Date: Mon, 3 Nov 2025 15:03:56 +0700 Subject: [PATCH 08/13] 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) - diff --git a/app/pages/(features)/outpatient-action/chemotherapy/[id]/index.vue b/app/pages/(features)/outpation-action/chemotherapy/[id]/index.vue similarity index 100% rename from app/pages/(features)/outpatient-action/chemotherapy/[id]/index.vue rename to app/pages/(features)/outpation-action/chemotherapy/[id]/index.vue diff --git a/app/pages/(features)/outpatient-action/chemotherapy/index.vue b/app/pages/(features)/outpation-action/chemotherapy/index.vue similarity index 76% rename from app/pages/(features)/outpatient-action/chemotherapy/index.vue rename to app/pages/(features)/outpation-action/chemotherapy/index.vue index 4dd31ebe..a2dfdea5 100644 --- a/app/pages/(features)/outpatient-action/chemotherapy/index.vue +++ b/app/pages/(features)/outpation-action/chemotherapy/index.vue @@ -1,7 +1,7 @@