From da26790513bc966fd5ed2b20d2bf503e7cd75fc0 Mon Sep 17 00:00:00 2001 From: Khafid Prayoga Date: Wed, 3 Dec 2025 17:38:15 +0700 Subject: [PATCH] mv treatment-report to action-report based on encounter menu id list --- .../entry-form.vue | 12 ++++++------ .../fields/fill-notes.vue | 0 .../fields/index.ts | 0 .../fields/radio-bloods.vue | 0 .../fields/select-billing.vue | 0 .../fields/select-birth-place.vue | 0 .../fields/select-birth-type.vue | 0 .../fields/select-operation-system.vue | 0 .../fields/select-operation-type.vue | 0 .../fields/select-specimen.vue | 0 .../fields/select-surgery-counter.vue | 0 .../fields/select-surgery-type.vue | 0 .../list-history.cfg.ts | 6 +++--- .../list-history.vue | 0 .../list.cfg.ts | 6 +++--- .../list.vue | 0 .../preview.vue | 4 ++-- .../sample.ts | 4 ++-- .../entry.vue | 0 .../form.vue | 12 ++++++------ .../list.vue | 14 +++++++------- .../sample.ts | 0 .../view.vue | 12 ++++++------ app/components/content/encounter/process.vue | 4 ++-- app/handlers/encounter-init.handler.ts | 19 ++++++------------- ...port.schema.ts => action-report.schema.ts} | 4 ++-- 26 files changed, 45 insertions(+), 52 deletions(-) rename app/components/app/{treatment-report => action-report}/entry-form.vue (97%) rename app/components/app/{treatment-report => action-report}/fields/fill-notes.vue (100%) rename app/components/app/{treatment-report => action-report}/fields/index.ts (100%) rename app/components/app/{treatment-report => action-report}/fields/radio-bloods.vue (100%) rename app/components/app/{treatment-report => action-report}/fields/select-billing.vue (100%) rename app/components/app/{treatment-report => action-report}/fields/select-birth-place.vue (100%) rename app/components/app/{treatment-report => action-report}/fields/select-birth-type.vue (100%) rename app/components/app/{treatment-report => action-report}/fields/select-operation-system.vue (100%) rename app/components/app/{treatment-report => action-report}/fields/select-operation-type.vue (100%) rename app/components/app/{treatment-report => action-report}/fields/select-specimen.vue (100%) rename app/components/app/{treatment-report => action-report}/fields/select-surgery-counter.vue (100%) rename app/components/app/{treatment-report => action-report}/fields/select-surgery-type.vue (100%) rename app/components/app/{treatment-report => action-report}/list-history.cfg.ts (90%) rename app/components/app/{treatment-report => action-report}/list-history.vue (100%) rename app/components/app/{treatment-report => action-report}/list.cfg.ts (91%) rename app/components/app/{treatment-report => action-report}/list.vue (100%) rename app/components/app/{treatment-report => action-report}/preview.vue (98%) rename app/components/app/{treatment-report => action-report}/sample.ts (93%) rename app/components/content/{treatment-report => action-report}/entry.vue (100%) rename app/components/content/{treatment-report => action-report}/form.vue (83%) rename app/components/content/{treatment-report => action-report}/list.vue (92%) rename app/components/content/{treatment-report => action-report}/sample.ts (100%) rename app/components/content/{treatment-report => action-report}/view.vue (74%) rename app/schemas/{treatment-report.schema.ts => action-report.schema.ts} (96%) diff --git a/app/components/app/treatment-report/entry-form.vue b/app/components/app/action-report/entry-form.vue similarity index 97% rename from app/components/app/treatment-report/entry-form.vue rename to app/components/app/action-report/entry-form.vue index 52dfba14..2479e1c7 100644 --- a/app/components/app/treatment-report/entry-form.vue +++ b/app/components/app/action-report/entry-form.vue @@ -4,7 +4,7 @@ import { toTypedSchema } from '@vee-validate/zod' import { type Duration, intervalToDuration } from 'date-fns' // schema -import { type TreatmentReportFormData, TreatmentReportSchema } from '~/schemas/treatment-report.schema' +import { type ActionReportFormData, ActionReportSchema } from '~/schemas/action-report.schema' // type import type { Doctor } from '~/models/doctor' @@ -34,7 +34,7 @@ import { SelectDoctor } from '~/components/app/doctor/fields' // Helpers // #region Props & Emits -interface FormData extends TreatmentReportFormData { +interface FormData extends ActionReportFormData { _operationDuration: string _anesthesiaDuration: string } @@ -71,10 +71,10 @@ const isReadonly = computed(() => { return false }) -const formSchema = toTypedSchema(TreatmentReportSchema) +const formSchema = toTypedSchema(ActionReportSchema) const { errors, handleSubmit, values, meta, resetForm, setFieldValue, setValues, validate } = useForm({ - name: 'treatmentReportForm', + name: 'encounterActionReportForm', validationSchema: formSchema, initialValues: props.initialValues ? props.initialValues : {}, validateOnMount: false, @@ -141,7 +141,7 @@ watch( setFieldValue('_operationDuration', formatTime(res)) }, - { immediate: true } + { immediate: true }, ) watch( @@ -163,7 +163,7 @@ watch( setFieldValue('_anesthesiaDuration', formatTime(res)) }, - { immediate: true } + { immediate: true }, ) // #endregion diff --git a/app/components/app/treatment-report/fields/fill-notes.vue b/app/components/app/action-report/fields/fill-notes.vue similarity index 100% rename from app/components/app/treatment-report/fields/fill-notes.vue rename to app/components/app/action-report/fields/fill-notes.vue diff --git a/app/components/app/treatment-report/fields/index.ts b/app/components/app/action-report/fields/index.ts similarity index 100% rename from app/components/app/treatment-report/fields/index.ts rename to app/components/app/action-report/fields/index.ts diff --git a/app/components/app/treatment-report/fields/radio-bloods.vue b/app/components/app/action-report/fields/radio-bloods.vue similarity index 100% rename from app/components/app/treatment-report/fields/radio-bloods.vue rename to app/components/app/action-report/fields/radio-bloods.vue diff --git a/app/components/app/treatment-report/fields/select-billing.vue b/app/components/app/action-report/fields/select-billing.vue similarity index 100% rename from app/components/app/treatment-report/fields/select-billing.vue rename to app/components/app/action-report/fields/select-billing.vue diff --git a/app/components/app/treatment-report/fields/select-birth-place.vue b/app/components/app/action-report/fields/select-birth-place.vue similarity index 100% rename from app/components/app/treatment-report/fields/select-birth-place.vue rename to app/components/app/action-report/fields/select-birth-place.vue diff --git a/app/components/app/treatment-report/fields/select-birth-type.vue b/app/components/app/action-report/fields/select-birth-type.vue similarity index 100% rename from app/components/app/treatment-report/fields/select-birth-type.vue rename to app/components/app/action-report/fields/select-birth-type.vue diff --git a/app/components/app/treatment-report/fields/select-operation-system.vue b/app/components/app/action-report/fields/select-operation-system.vue similarity index 100% rename from app/components/app/treatment-report/fields/select-operation-system.vue rename to app/components/app/action-report/fields/select-operation-system.vue diff --git a/app/components/app/treatment-report/fields/select-operation-type.vue b/app/components/app/action-report/fields/select-operation-type.vue similarity index 100% rename from app/components/app/treatment-report/fields/select-operation-type.vue rename to app/components/app/action-report/fields/select-operation-type.vue diff --git a/app/components/app/treatment-report/fields/select-specimen.vue b/app/components/app/action-report/fields/select-specimen.vue similarity index 100% rename from app/components/app/treatment-report/fields/select-specimen.vue rename to app/components/app/action-report/fields/select-specimen.vue diff --git a/app/components/app/treatment-report/fields/select-surgery-counter.vue b/app/components/app/action-report/fields/select-surgery-counter.vue similarity index 100% rename from app/components/app/treatment-report/fields/select-surgery-counter.vue rename to app/components/app/action-report/fields/select-surgery-counter.vue diff --git a/app/components/app/treatment-report/fields/select-surgery-type.vue b/app/components/app/action-report/fields/select-surgery-type.vue similarity index 100% rename from app/components/app/treatment-report/fields/select-surgery-type.vue rename to app/components/app/action-report/fields/select-surgery-type.vue diff --git a/app/components/app/treatment-report/list-history.cfg.ts b/app/components/app/action-report/list-history.cfg.ts similarity index 90% rename from app/components/app/treatment-report/list-history.cfg.ts rename to app/components/app/action-report/list-history.cfg.ts index 25f2acc3..d943bc7d 100644 --- a/app/components/app/treatment-report/list-history.cfg.ts +++ b/app/components/app/action-report/list-history.cfg.ts @@ -4,7 +4,7 @@ import { format } from 'date-fns' import { id } from 'date-fns/locale' import type { Config, RecComponent } from '~/components/pub/my-ui/data-table' -import type { TreatmentReportData } from '~/components/app/treatment-report/sample' +import type { ActionReportData } from '~/components/app/action-report/sample' const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-d.vue')) export const config: Config = { @@ -41,13 +41,13 @@ export const config: Config = { parses: { reportAt: (rec: unknown): unknown => { - const attr = (rec as TreatmentReportData).reportAt + const attr = (rec as ActionReportData).reportAt const result = format(new Date(attr), 'd MMMM yyyy, HH:mm', { locale: id }) return result }, operationAt: (rec: unknown): unknown => { - const attr = (rec as TreatmentReportData).operationAt + const attr = (rec as ActionReportData).operationAt const result = format(new Date(attr), 'd MMMM yyyy', { locale: id }) return result diff --git a/app/components/app/treatment-report/list-history.vue b/app/components/app/action-report/list-history.vue similarity index 100% rename from app/components/app/treatment-report/list-history.vue rename to app/components/app/action-report/list-history.vue diff --git a/app/components/app/treatment-report/list.cfg.ts b/app/components/app/action-report/list.cfg.ts similarity index 91% rename from app/components/app/treatment-report/list.cfg.ts rename to app/components/app/action-report/list.cfg.ts index b07ef9e0..13a78728 100644 --- a/app/components/app/treatment-report/list.cfg.ts +++ b/app/components/app/action-report/list.cfg.ts @@ -4,7 +4,7 @@ import { format } from 'date-fns' import { id } from 'date-fns/locale' import type { Config, RecComponent } from '~/components/pub/my-ui/data-table' -import type { TreatmentReportData } from '~/components/app/treatment-report/sample' +import type { ActionReportData } from '~/components/app/action-report/sample' const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dud.vue')) export const config: Config = { @@ -42,13 +42,13 @@ export const config: Config = { parses: { reportAt: (rec: unknown): unknown => { - const attr = (rec as TreatmentReportData).reportAt + const attr = (rec as ActionReportData).reportAt const result = format(new Date(attr), 'd MMMM yyyy, HH:mm', { locale: id }) return result }, operationAt: (rec: unknown): unknown => { - const attr = (rec as TreatmentReportData).operationAt + const attr = (rec as ActionReportData).operationAt const result = format(new Date(attr), 'd MMMM yyyy', { locale: id }) return result diff --git a/app/components/app/treatment-report/list.vue b/app/components/app/action-report/list.vue similarity index 100% rename from app/components/app/treatment-report/list.vue rename to app/components/app/action-report/list.vue diff --git a/app/components/app/treatment-report/preview.vue b/app/components/app/action-report/preview.vue similarity index 98% rename from app/components/app/treatment-report/preview.vue rename to app/components/app/action-report/preview.vue index 65b1fc2e..fa113333 100644 --- a/app/components/app/treatment-report/preview.vue +++ b/app/components/app/action-report/preview.vue @@ -4,7 +4,7 @@ import { id } from 'date-fns/locale' // type import { type ProcedureSrc } from '~/models/procedure-src' -import { type TreatmentReportFormData } from '~/schemas/treatment-report.schema' +import { type ActionReportFormData } from '~/schemas/action-report.schema' // componenets import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '~/components/pub/ui/accordion' @@ -14,7 +14,7 @@ import ArrangementProcedurePicker from '~/components/app/therapy-protocol/picker // #region Props & Emits const props = defineProps<{ - data: TreatmentReportFormData + data: ActionReportFormData }>() const emit = defineEmits<{ diff --git a/app/components/app/treatment-report/sample.ts b/app/components/app/action-report/sample.ts similarity index 93% rename from app/components/app/treatment-report/sample.ts rename to app/components/app/action-report/sample.ts index 9446b91c..b067e859 100644 --- a/app/components/app/treatment-report/sample.ts +++ b/app/components/app/action-report/sample.ts @@ -1,6 +1,6 @@ import { addWeeks, formatISO } from 'date-fns' -export type TreatmentReportData = { +export type ActionReportData = { id: number reportAt: string operationAt: string @@ -17,7 +17,7 @@ export type TreatmentReportData = { asal: string } -export const sampleRows: TreatmentReportData[] = [ +export const sampleRows: ActionReportData[] = [ { id: 1, reportAt: formatISO(addWeeks(new Date(), -1)), diff --git a/app/components/content/treatment-report/entry.vue b/app/components/content/action-report/entry.vue similarity index 100% rename from app/components/content/treatment-report/entry.vue rename to app/components/content/action-report/entry.vue diff --git a/app/components/content/treatment-report/form.vue b/app/components/content/action-report/form.vue similarity index 83% rename from app/components/content/treatment-report/form.vue rename to app/components/content/action-report/form.vue index 73ebe615..e6c30c73 100644 --- a/app/components/content/treatment-report/form.vue +++ b/app/components/content/action-report/form.vue @@ -3,18 +3,18 @@ import mockData from './sample' // type import { genDoctor, type Doctor } from '~/models/doctor' -import type { TreatmentReportFormData } from '~/schemas/treatment-report.schema' +import type { ActionReportFormData } from '~/schemas/action-report.schema' // components import { toast } from '~/components/pub/ui/toast' -import AppTreatmentReportEntry from '~/components/app/treatment-report/entry-form.vue' +import AppActionReportEntry from '~/components/app/action-report/entry-form.vue' import ArrangementProcedurePicker from '~/components/app/therapy-protocol/picker-dialog/arrangement-procedure/procedure-picker.vue' // states const route = useRoute() const { mode, goBack } = useQueryCRUDMode('mode') const { recordId } = useQueryCRUDRecordId('record-id') -const reportData = ref({} as unknown as TreatmentReportFormData) +const reportData = ref({} as unknown as ActionReportFormData) const doctors = ref([]) const isLoading = ref(false) @@ -40,14 +40,14 @@ onMounted(async () => { async function loadEntryForEdit(id: number | string) { isLoading.value = true const result = mockData - reportData.value = result as TreatmentReportFormData + reportData.value = result as ActionReportFormData isLoading.value = false isDataReady.value = true } - +
// Components import Dialog from '~/components/pub/my-ui/modal/dialog.vue' -import AppTreatmentReportList from '~/components/app/treatment-report/list.vue' -import AppTreatmentReportListHistory from '~/components/app/treatment-report/list-history.vue' +import AppActionReportList from '~/components/app/action-report/list.vue' +import AppActionReportListHistory from '~/components/app/action-report/list-history.vue' import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue' import { ButtonAction } from '~/components/pub/my-ui/form' // config -import { config } from '~/components/app/treatment-report/list.cfg' +import { config } from '~/components/app/action-report/list.cfg' // types import { ActionEvents } from '~/components/pub/my-ui/data/types' import type { Encounter } from '~/models/encounter' // Samples -import { sampleRows, type TreatmentReportData } from '~/components/app/treatment-report/sample' +import { sampleRows, type ActionReportData } from '~/components/app/action-report/sample' import sampleReport from './sample' // helpers @@ -63,7 +63,7 @@ import { // filter + pencarian sederhana (client-side) const filtered = computed(() => { const q = search.value.trim().toLowerCase() - return sampleRows.filter((r: TreatmentReportData) => { + return sampleRows.filter((r: ActionReportData) => { if (q) { return r.nama.toLowerCase().includes(q) || r.noRm.toLowerCase().includes(q) || r.dokter.toLowerCase().includes(q) } @@ -205,7 +205,7 @@ watch([recId, recAction], (newVal) => {
- - import('~/components/conte const GeneralConsentListAsync = defineAsyncComponent(() => import('~/components/content/general-consent/entry.vue')) const ResumeListAsync = defineAsyncComponent(() => import('~/components/content/resume/list.vue')) const ControlLetterListAsync = defineAsyncComponent(() => import('~/components/content/control-letter/list.vue')) -const TreatmentReportEntryAsync = defineAsyncComponent(() => import('~/components/content/treatment-report/entry.vue')) +const ActionReportEntryAsync = defineAsyncComponent(() => import('~/components/content/action-report/entry.vue')) const defaultKeys: Record = { status: { @@ -247,12 +247,6 @@ const defaultKeys: Record = { classCode: ['ambulatory', 'emergency', 'inpatient'], unit: 'all', }, - treatmentReport: { - id: 'treatment-report', - title: 'Laporan Tindakan', - classCode: ['ambulatory', 'emergency', 'inpatient'], - unit: 'all', - }, } export function getItemsByClassCode(classCode: string, items: EncounterItem[]) { @@ -413,15 +407,14 @@ export function injectComponents(id: string | number, data: EncounterListData, m currentKeys.priceList['props'] = { encounter_id: id } } - if (currentKeys?.treatmentReport) { - currentKeys.treatmentReport['component'] = TreatmentReportEntryAsync - currentKeys.treatmentReport['props'] = { + if (currentKeys?.actionReport) { + currentKeys.actionReport['component'] = ActionReportEntryAsync + currentKeys.actionReport['props'] = { encounter: data?.encounter, - type: 'treatment-report', - label: currentKeys.treatmentReport['title'], + type: 'action-report', + label: currentKeys.actionReport['title'], } } - return currentKeys } diff --git a/app/schemas/treatment-report.schema.ts b/app/schemas/action-report.schema.ts similarity index 96% rename from app/schemas/treatment-report.schema.ts rename to app/schemas/action-report.schema.ts index 02b0076a..cd23eb28 100644 --- a/app/schemas/treatment-report.schema.ts +++ b/app/schemas/action-report.schema.ts @@ -105,7 +105,7 @@ const TissueNoteSchema = z.object({ .optional(), }) -export const TreatmentReportSchema = z.object({ +export const ActionReportSchema = z.object({ operatorTeam: OperatorTeamSchema, procedures: z.array(ProcedureSchema).min(1, { message: 'Silahkan pilih prosedur' }), @@ -118,4 +118,4 @@ export const TreatmentReportSchema = z.object({ tissueNotes: z.array(TissueNoteSchema).optional(), }) -export type TreatmentReportFormData = z.infer +export type ActionReportFormData = z.infer