From 323485347300abee84439e5956815cc2dafc5cf9 Mon Sep 17 00:00:00 2001 From: riefive Date: Wed, 29 Oct 2025 15:39:55 +0700 Subject: [PATCH 1/5] 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 2/5] 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 3/5] 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 4/5] 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 5/5] 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