diff --git a/app/components/app/prb/_common/btn-history.vue b/app/components/app/prb/_common/btn-history.vue new file mode 100644 index 00000000..972eab8e --- /dev/null +++ b/app/components/app/prb/_common/btn-history.vue @@ -0,0 +1,21 @@ + + + \ No newline at end of file diff --git a/app/components/app/prb/_common/filter.vue b/app/components/app/prb/_common/filter.vue new file mode 100644 index 00000000..d5e99b30 --- /dev/null +++ b/app/components/app/prb/_common/filter.vue @@ -0,0 +1,73 @@ + + + diff --git a/app/components/app/prb/_common/select-date.vue b/app/components/app/prb/_common/select-date.vue new file mode 100644 index 00000000..d94d04eb --- /dev/null +++ b/app/components/app/prb/_common/select-date.vue @@ -0,0 +1,119 @@ + + + diff --git a/app/components/app/prb/_common/select-dpjp.vue b/app/components/app/prb/_common/select-dpjp.vue new file mode 100644 index 00000000..9e83e64f --- /dev/null +++ b/app/components/app/prb/_common/select-dpjp.vue @@ -0,0 +1,86 @@ + + + diff --git a/app/components/app/prb/_common/select-medicine-form.vue b/app/components/app/prb/_common/select-medicine-form.vue new file mode 100644 index 00000000..9e83e64f --- /dev/null +++ b/app/components/app/prb/_common/select-medicine-form.vue @@ -0,0 +1,86 @@ + + + diff --git a/app/components/app/prb/_common/select-medicine.vue b/app/components/app/prb/_common/select-medicine.vue new file mode 100644 index 00000000..9e83e64f --- /dev/null +++ b/app/components/app/prb/_common/select-medicine.vue @@ -0,0 +1,86 @@ + + + diff --git a/app/components/app/prb/_common/select-program.vue b/app/components/app/prb/_common/select-program.vue new file mode 100644 index 00000000..cde3fb66 --- /dev/null +++ b/app/components/app/prb/_common/select-program.vue @@ -0,0 +1,77 @@ + + + diff --git a/app/components/app/prb/bpjs-list.cfg.ts b/app/components/app/prb/bpjs-list.cfg.ts new file mode 100644 index 00000000..92d68f73 --- /dev/null +++ b/app/components/app/prb/bpjs-list.cfg.ts @@ -0,0 +1,60 @@ +import type { Config } from '~/components/pub/my-ui/data-table' +import type { Patient } from '~/models/patient' +import { defineAsyncComponent } from 'vue' +import { educationCodes, genderCodes } from '~/lib/constants' +import { calculateAge } from '~/lib/utils' + +const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-upd.vue')) + +export const config: Config = { + cols: [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {width: 50}, ], + + headers: [ + [ + { label: 'No. PRB' }, + { label: 'No. RM' }, + { label: 'Nama Pasien' }, + { label: 'Jenis Kelamin' }, + { label: 'Alamat' }, + { label: 'Klinik' }, + { label: 'Nama Dokter' }, + { label: 'Tanggal' }, + { label: 'Program PRB' }, + { label: 'No. SEP' }, + { label: 'Action' }, + ], + ], + + keys: ['date', 'name1', 'name2', 'name3', 'name4', 'name5', 'name6', 'name7', 'name8', 'name9', 'action'], + + delKeyNames: [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, + ], + + parses: { + date: (rec: unknown): unknown => { + const date = (rec as any).date + if (typeof date == 'object' && date) { + return (date as Date).toLocaleDateString('id-ID') + } else if (typeof date == 'string') { + return (date as string).substring(0, 10) + } + return date + }, + }, + + components: { + action(rec, idx) { + return { + idx, + rec: rec as object, + component: action, + } + }, + }, + + htmls: { + + }, +} diff --git a/app/components/app/prb/detail.vue b/app/components/app/prb/detail.vue new file mode 100644 index 00000000..7e40366d --- /dev/null +++ b/app/components/app/prb/detail.vue @@ -0,0 +1,62 @@ + + + + + diff --git a/app/components/app/prb/entry.vue b/app/components/app/prb/entry.vue new file mode 100644 index 00000000..4658578a --- /dev/null +++ b/app/components/app/prb/entry.vue @@ -0,0 +1,102 @@ + + + diff --git a/app/components/app/prb/history-list.cfg.ts b/app/components/app/prb/history-list.cfg.ts new file mode 100644 index 00000000..6f571af3 --- /dev/null +++ b/app/components/app/prb/history-list.cfg.ts @@ -0,0 +1,62 @@ +import type { Config } from '~/components/pub/my-ui/data-table' +import { defineAsyncComponent } from 'vue' + +const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-print.vue')) +const statusBadge = defineAsyncComponent(() => import('~/components/pub/my-ui/badge/status-badge.vue')) + +export const config: Config = { + cols: [{}, {}, {}, {}, {}, {}, {width: 100}, {width: 50}, ], + + headers: [ + [ + { label: 'Tgl Diterbitkan' }, + { label: 'Kode Obat' }, + { label: 'Nama Obat' }, + { label: 'Signa' }, + { label: 'Jumlah' }, + { label: 'Durasi Pemberian' }, + { label: 'status' }, + { label: 'Action' }, + ], + ], + + keys: ['date', 'name1', 'name2', 'name3', 'name4', 'name5', 'status', 'action'], + + delKeyNames: [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, + ], + + parses: { + date: (rec: unknown): unknown => { + const date = (rec as any).date + if (typeof date == 'object' && date) { + return (date as Date).toLocaleDateString('id-ID') + } else if (typeof date == 'string') { + return (date as string).substring(0, 10) + } + return date + }, + }, + + components: { + action(rec, idx) { + return { + idx, + rec: rec as object, + component: action, + } + }, + status(rec, idx) { + return { + idx, + rec: rec as object, + component: statusBadge, + } + }, + }, + + htmls: { + + }, +} diff --git a/app/components/app/prb/history-list.vue b/app/components/app/prb/history-list.vue new file mode 100644 index 00000000..20cc7eaf --- /dev/null +++ b/app/components/app/prb/history-list.vue @@ -0,0 +1,35 @@ + + + \ No newline at end of file diff --git a/app/components/app/prb/list.cfg.ts b/app/components/app/prb/list.cfg.ts new file mode 100644 index 00000000..4da07cdd --- /dev/null +++ b/app/components/app/prb/list.cfg.ts @@ -0,0 +1,56 @@ +import type { Config } from '~/components/pub/my-ui/data-table' +import type { Patient } from '~/models/patient' +import { defineAsyncComponent } from 'vue' +import { educationCodes, genderCodes } from '~/lib/constants' +import { calculateAge } from '~/lib/utils' + +const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-upd.vue')) + +export const config: Config = { + cols: [{}, {}, {}, {}, {}, {}, {width: 50}, ], + + headers: [ + [ + { label: 'Tgl Diterbitkan' }, + { label: 'Kode Obat' }, + { label: 'Nama Obat' }, + { label: 'Signa' }, + { label: 'Jumlah' }, + { label: 'Durasi Pemberian' }, + { label: 'Action' }, + ], + ], + + keys: ['date', 'name1', 'name2', 'name3', 'name4', 'name5', 'action'], + + delKeyNames: [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, + ], + + parses: { + date: (rec: unknown): unknown => { + const date = (rec as any).date + if (typeof date == 'object' && date) { + return (date as Date).toLocaleDateString('id-ID') + } else if (typeof date == 'string') { + return (date as string).substring(0, 10) + } + return date + }, + }, + + components: { + action(rec, idx) { + return { + idx, + rec: rec as object, + component: action, + } + }, + }, + + htmls: { + + }, +} diff --git a/app/components/app/prb/list.vue b/app/components/app/prb/list.vue new file mode 100644 index 00000000..5e51b50f --- /dev/null +++ b/app/components/app/prb/list.vue @@ -0,0 +1,34 @@ + + + diff --git a/app/components/app/prb/obat-picker/form.vue b/app/components/app/prb/obat-picker/form.vue new file mode 100644 index 00000000..510cae69 --- /dev/null +++ b/app/components/app/prb/obat-picker/form.vue @@ -0,0 +1,114 @@ + + + \ No newline at end of file diff --git a/app/components/app/prb/obat-picker/picker-dialog.vue b/app/components/app/prb/obat-picker/picker-dialog.vue new file mode 100644 index 00000000..69ea3b90 --- /dev/null +++ b/app/components/app/prb/obat-picker/picker-dialog.vue @@ -0,0 +1,140 @@ + + + diff --git a/app/components/app/prb/sep-picker/list.cfg.ts b/app/components/app/prb/sep-picker/list.cfg.ts new file mode 100644 index 00000000..5a928e2d --- /dev/null +++ b/app/components/app/prb/sep-picker/list.cfg.ts @@ -0,0 +1,83 @@ +import type { Config } from '~/components/pub/my-ui/data-table' +import { defineAsyncComponent } from 'vue' + +const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-choose.vue')) +const statusBadge = defineAsyncComponent(() => import('~/components/pub/my-ui/badge/status-badge.vue')) + +export const config: Config = { + cols: [ + { width: 120 }, // TGL. SEP + { width: 150 }, // NO. SEP + { width: 120 }, // PELAYANAN + { width: 100 }, // JALUR + { width: 150 }, // NO. RM + { width: 200 }, // NAMA PASIEN + { width: 150 }, // NO. KARTU BPJS + { width: 150 }, // NO. SURAT KONTROL + { width: 150 }, // TGL SURAT KONTROL + { width: 150 }, // KLINIK TUJUAN + { width: 200 }, // DPJP + { width: 200 }, // DIAGNOSIS AWAL + { width: 100 }, // AKSI + ], + + headers: [ + [ + { label: 'TGL. SEP' }, + { label: 'NO. SEP' }, + { label: 'PELAYANAN' }, + { label: 'JALUR' }, + { label: 'NO. RM' }, + { label: 'NAMA PASIEN' }, + { label: 'NO. KARTU BPJS' }, + { label: 'NO. SURAT KONTROL' }, + { label: 'TGL SURAT KONTROL' }, + { label: 'KLINIK TUJUAN' }, + { label: 'DPJP' }, + { label: 'DIAGNOSIS AWAL' }, + { label: 'AKSI' }, + ], + ], + + keys: [ + 'letterDate', + 'letterNumber', + 'serviceType', + 'flow', + 'medicalRecordNumber', + 'patientName', + 'cardNumber', + 'controlLetterNumber', + 'controlLetterDate', + 'clinicDestination', + 'attendingDoctor', + 'diagnosis', + 'action', + ], + + delKeyNames: [ + { key: 'letterNumber', label: 'NO. SEP' }, + { key: 'patientName', label: 'Nama Pasien' }, + ], + + parses: {}, + + components: { + action(rec, idx) { + return { + idx, + rec: rec as object, + component: action, + } + }, + status(rec, idx) { + return { + idx, + rec: rec as object, + component: statusBadge, + } + }, + }, + + htmls: {}, +} \ No newline at end of file diff --git a/app/components/app/prb/sep-picker/list.vue b/app/components/app/prb/sep-picker/list.vue new file mode 100644 index 00000000..9c8aa593 --- /dev/null +++ b/app/components/app/prb/sep-picker/list.vue @@ -0,0 +1,53 @@ + + + diff --git a/app/components/app/prb/sep-picker/picker-dialog.vue b/app/components/app/prb/sep-picker/picker-dialog.vue new file mode 100644 index 00000000..efb32023 --- /dev/null +++ b/app/components/app/prb/sep-picker/picker-dialog.vue @@ -0,0 +1,141 @@ + + + diff --git a/app/components/app/vaccine-data/_common/select-date.vue b/app/components/app/vaccine-data/_common/select-date.vue new file mode 100644 index 00000000..d94d04eb --- /dev/null +++ b/app/components/app/vaccine-data/_common/select-date.vue @@ -0,0 +1,119 @@ + + + diff --git a/app/components/app/vaccine-data/_common/select-vaccine-type.vue b/app/components/app/vaccine-data/_common/select-vaccine-type.vue new file mode 100644 index 00000000..cde3fb66 --- /dev/null +++ b/app/components/app/vaccine-data/_common/select-vaccine-type.vue @@ -0,0 +1,77 @@ + + + diff --git a/app/components/app/vaccine-data/detail.vue b/app/components/app/vaccine-data/detail.vue new file mode 100644 index 00000000..2c79e461 --- /dev/null +++ b/app/components/app/vaccine-data/detail.vue @@ -0,0 +1,68 @@ + + + + + diff --git a/app/components/app/vaccine-data/entry.vue b/app/components/app/vaccine-data/entry.vue new file mode 100644 index 00000000..4b8f291b --- /dev/null +++ b/app/components/app/vaccine-data/entry.vue @@ -0,0 +1,82 @@ + + + diff --git a/app/components/app/vaccine-data/list-doctor.cfg.ts b/app/components/app/vaccine-data/list-doctor.cfg.ts new file mode 100644 index 00000000..be938aa5 --- /dev/null +++ b/app/components/app/vaccine-data/list-doctor.cfg.ts @@ -0,0 +1,53 @@ +import type { Config } from '~/components/pub/my-ui/data-table' +import { defineAsyncComponent } from 'vue' +import actionDoctor from '~/components/pub/my-ui/data/dropdown-action-dd.vue' +import actionNursePhysio from '~/components/pub/my-ui/data/dropdown-action-detail.vue' + +const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dd.vue')) + +export const config: Config = { + cols: [{}, {}, {}, {}, {width: 50}, ], + + headers: [ + [ + { label: 'Jenis Vaksin' }, + { label: 'Tanggal Pemberian Vaksin' }, + { label: 'Tanggal Kedaluwarsa Vaksin' }, + { label: 'Dosis Ke' }, + { label: 'Action' }, + ], + ], + + keys: ['name1', 'date', 'date', 'name2', 'action'], + + delKeyNames: [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, + ], + + parses: { + date: (rec: unknown): unknown => { + const date = (rec as any).date + if (typeof date == 'object' && date) { + return (date as Date).toLocaleDateString('id-ID') + } else if (typeof date == 'string') { + return (date as string).substring(0, 10) + } + return date + }, + }, + + components: { + action(rec, idx) { + return { + idx, + rec: rec as object, + component: action, + } + }, + }, + + htmls: { + + }, +} diff --git a/app/components/app/vaccine-data/list-nurse-physio.cfg.ts b/app/components/app/vaccine-data/list-nurse-physio.cfg.ts new file mode 100644 index 00000000..acfc698c --- /dev/null +++ b/app/components/app/vaccine-data/list-nurse-physio.cfg.ts @@ -0,0 +1,53 @@ +import type { Config } from '~/components/pub/my-ui/data-table' +import { defineAsyncComponent } from 'vue' +import actionDoctor from '~/components/pub/my-ui/data/dropdown-action-dd.vue' +import actionNursePhysio from '~/components/pub/my-ui/data/dropdown-action-detail.vue' + +const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-detail.vue')) + +export const config: Config = { + cols: [{}, {}, {}, {}, {width: 50}, ], + + headers: [ + [ + { label: 'Jenis Vaksin' }, + { label: 'Tanggal Pemberian Vaksin' }, + { label: 'Tanggal Kedaluwarsa Vaksin' }, + { label: 'Dosis Ke' }, + { label: 'Action' }, + ], + ], + + keys: ['name1', 'date', 'date', 'name2', 'action'], + + delKeyNames: [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, + ], + + parses: { + date: (rec: unknown): unknown => { + const date = (rec as any).date + if (typeof date == 'object' && date) { + return (date as Date).toLocaleDateString('id-ID') + } else if (typeof date == 'string') { + return (date as string).substring(0, 10) + } + return date + }, + }, + + components: { + action(rec, idx) { + return { + idx, + rec: rec as object, + component: action, + } + }, + }, + + htmls: { + + }, +} diff --git a/app/components/app/vaccine-data/list.vue b/app/components/app/vaccine-data/list.vue new file mode 100644 index 00000000..7960112b --- /dev/null +++ b/app/components/app/vaccine-data/list.vue @@ -0,0 +1,41 @@ + + + diff --git a/app/components/content/encounter/process-bu.vue b/app/components/content/encounter/process-bu.vue index 02fc7495..8285d5e6 100644 --- a/app/components/content/encounter/process-bu.vue +++ b/app/components/content/encounter/process-bu.vue @@ -26,6 +26,7 @@ import DocUploadList from '~/components/content/document-upload/list.vue' import GeneralConsentList from '~/components/content/general-consent/entry.vue' import ResumeList from '~/components/content/resume/list.vue' import ControlLetterList from '~/components/content/control-letter/list.vue' +import VaccineDataList from '~/components/content/vaccine-data/list.vue' const route = useRoute() const router = useRouter() @@ -96,6 +97,7 @@ const tabs: TabItem[] = [ component: DocUploadList, props: { encounter: data }, }, + { value: 'vaccine-data', label: 'Data Vaksin', component: VaccineDataList, props: { encounter: data } }, ] diff --git a/app/components/content/encounter/process.vue b/app/components/content/encounter/process.vue index b9e8355f..52698dd9 100644 --- a/app/components/content/encounter/process.vue +++ b/app/components/content/encounter/process.vue @@ -139,4 +139,4 @@ async function getData() { - + \ No newline at end of file diff --git a/app/components/content/prb/bpjs-list.vue b/app/components/content/prb/bpjs-list.vue new file mode 100644 index 00000000..8ce0d050 --- /dev/null +++ b/app/components/content/prb/bpjs-list.vue @@ -0,0 +1,225 @@ + + + diff --git a/app/components/content/prb/detail.vue b/app/components/content/prb/detail.vue new file mode 100644 index 00000000..4de8f260 --- /dev/null +++ b/app/components/content/prb/detail.vue @@ -0,0 +1,65 @@ + + + diff --git a/app/components/content/prb/entry.vue b/app/components/content/prb/entry.vue new file mode 100644 index 00000000..244c49b0 --- /dev/null +++ b/app/components/content/prb/entry.vue @@ -0,0 +1,160 @@ + + + + + diff --git a/app/components/content/prb/list.vue b/app/components/content/prb/list.vue new file mode 100644 index 00000000..a1c09696 --- /dev/null +++ b/app/components/content/prb/list.vue @@ -0,0 +1,202 @@ + + + diff --git a/app/components/content/vaccine-data/detail.vue b/app/components/content/vaccine-data/detail.vue new file mode 100644 index 00000000..fd977b39 --- /dev/null +++ b/app/components/content/vaccine-data/detail.vue @@ -0,0 +1,65 @@ + + + diff --git a/app/components/content/vaccine-data/entry.vue b/app/components/content/vaccine-data/entry.vue new file mode 100644 index 00000000..60fe3775 --- /dev/null +++ b/app/components/content/vaccine-data/entry.vue @@ -0,0 +1,159 @@ + + + + + diff --git a/app/components/content/vaccine-data/list.vue b/app/components/content/vaccine-data/list.vue new file mode 100644 index 00000000..a701271e --- /dev/null +++ b/app/components/content/vaccine-data/list.vue @@ -0,0 +1,165 @@ + + + diff --git a/app/components/pub/my-ui/data/dropdown-action-choose.vue b/app/components/pub/my-ui/data/dropdown-action-choose.vue new file mode 100644 index 00000000..8fb63f33 --- /dev/null +++ b/app/components/pub/my-ui/data/dropdown-action-choose.vue @@ -0,0 +1,30 @@ + + + diff --git a/app/components/pub/my-ui/data/dropdown-action-detail.vue b/app/components/pub/my-ui/data/dropdown-action-detail.vue new file mode 100644 index 00000000..b695fb5c --- /dev/null +++ b/app/components/pub/my-ui/data/dropdown-action-detail.vue @@ -0,0 +1,30 @@ + + + diff --git a/app/components/pub/my-ui/data/dropdown-action-print.vue b/app/components/pub/my-ui/data/dropdown-action-print.vue new file mode 100644 index 00000000..99a7da03 --- /dev/null +++ b/app/components/pub/my-ui/data/dropdown-action-print.vue @@ -0,0 +1,31 @@ + + + diff --git a/app/components/pub/my-ui/data/dropdown-action-upd.vue b/app/components/pub/my-ui/data/dropdown-action-upd.vue new file mode 100644 index 00000000..611e53d2 --- /dev/null +++ b/app/components/pub/my-ui/data/dropdown-action-upd.vue @@ -0,0 +1,94 @@ + + + diff --git a/app/handlers/prb.handler.ts b/app/handlers/prb.handler.ts new file mode 100644 index 00000000..bfff163b --- /dev/null +++ b/app/handlers/prb.handler.ts @@ -0,0 +1,24 @@ +// Handlers +import { genCrudHandler } from '~/handlers/_handler' + +// Services +import { create, update, remove } from '~/services/prb.service' + +export const { + recId, + recAction, + recItem, + isReadonly, + isProcessing, + isFormEntryDialogOpen, + isRecordConfirmationOpen, + onResetState, + handleActionSave, + handleActionEdit, + handleActionRemove, + handleCancelForm, +} = genCrudHandler({ + create, + update, + remove, +}) diff --git a/app/handlers/vaccine-data.handler.ts b/app/handlers/vaccine-data.handler.ts new file mode 100644 index 00000000..7f5fa1b6 --- /dev/null +++ b/app/handlers/vaccine-data.handler.ts @@ -0,0 +1,24 @@ +// Handlers +import { genCrudHandler } from '~/handlers/_handler' + +// Services +import { create, update, remove } from '~/services/vaccine-data.service' + +export const { + recId, + recAction, + recItem, + isReadonly, + isProcessing, + isFormEntryDialogOpen, + isRecordConfirmationOpen, + onResetState, + handleActionSave, + handleActionEdit, + handleActionRemove, + handleCancelForm, +} = genCrudHandler({ + create, + update, + remove, +}) diff --git a/app/lib/constants.ts b/app/lib/constants.ts index c7daf608..a1b0ff01 100644 --- a/app/lib/constants.ts +++ b/app/lib/constants.ts @@ -486,4 +486,16 @@ export const SpecimenTypeOptList: { label: string; value: SpecimenType }[] = [ { label: 'Mikrobiologi', value: 'mikrobiologi' }, { label: 'Laborat', value: 'laborat' }, { label: 'Tidak perlu', value: 'tidak perlu' }, +] + +export type PrbProgramType = "ashma" | "diabetes mellitus" | "hipertensi" | "penyakit jantung" | "ppok" | "schizopherenia" | "stroke" | "systemic lupus erythematosus" +export const PrbProgramTypeOptList: { label: string; value: PrbProgramType }[] = [ + { label: 'ASHMA', value: 'ashma' }, + { label: 'Diabetes Mellitus', value: 'diabetes mellitus' }, + { label: 'Hipertensi', value: 'hipertensi' }, + { label: 'Penyakit Jantung', value: 'penyakit jantung' }, + { label: 'PPOK (Penyakit Paru Obstruktif Kronik)', value: 'ppok' }, + { label: 'Schizopherenia', value: 'schizopherenia' }, + { label: 'Stroke', value: 'stroke' }, + { label: 'Systemic Lupus Erythematosus', value: 'systemic lupus erythematosus' }, ] \ No newline at end of file diff --git a/app/lib/utils.ts b/app/lib/utils.ts index e201a439..180320ae 100644 --- a/app/lib/utils.ts +++ b/app/lib/utils.ts @@ -1,5 +1,6 @@ import type { ClassValue } from 'clsx' import { clsx } from 'clsx' +import { format } from 'date-fns' import { twMerge } from 'tailwind-merge' import { toast } from '~/components/pub/ui/toast' @@ -106,6 +107,11 @@ export function calculateAge(birthDate: Date | string | null | undefined): strin } } +export function formatDateToDatetimeLocal(inputDate: Date) { + const formattedString = format(inputDate, "yyyy-MM-dd'T'HH:mm") + return formattedString +} + /** * Converts a plain JavaScript object (including File objects) into a FormData instance. diff --git a/app/models/prb.ts b/app/models/prb.ts new file mode 100644 index 00000000..2997b5b3 --- /dev/null +++ b/app/models/prb.ts @@ -0,0 +1,37 @@ +import { type Base, genBase } from "./_base" +import { genDoctor, type Doctor } from "./doctor" +import { genEncounter, type Encounter } from "./encounter" +import { genSpecialist, type Specialist } from "./specialist" +import { genSubspecialist, type Subspecialist } from "./subspecialist" +import { genUnit, type Unit } from "./unit" + +export interface Prb extends Base { + encounter_id: number + encounter: Encounter + unit_id: number + unit: Unit + specialist_id: number + specialist: Specialist + subspecialist_id: number + subspecialist: Subspecialist + doctor_id: number + doctor: Doctor + date: '' +} + +export function genPrb(): Prb { + return { + ...genBase(), + encounter_id: 0, + encounter: genEncounter(), + unit_id: 0, + unit: genUnit(), + specialist_id: 0, + specialist: genSpecialist(), + subspecialist_id: 0, + subspecialist: genSubspecialist(), + doctor_id: 0, + doctor: genDoctor(), + date: '' + } +} diff --git a/app/models/vaccine-data.ts b/app/models/vaccine-data.ts new file mode 100644 index 00000000..86032b2a --- /dev/null +++ b/app/models/vaccine-data.ts @@ -0,0 +1,37 @@ +import { type Base, genBase } from "./_base" +import { genDoctor, type Doctor } from "./doctor" +import { genEncounter, type Encounter } from "./encounter" +import { genSpecialist, type Specialist } from "./specialist" +import { genSubspecialist, type Subspecialist } from "./subspecialist" +import { genUnit, type Unit } from "./unit" + +export interface VaccineData extends Base { + encounter_id: number + encounter: Encounter + unit_id: number + unit: Unit + specialist_id: number + specialist: Specialist + subspecialist_id: number + subspecialist: Subspecialist + doctor_id: number + doctor: Doctor + date: '' +} + +export function genVaccineData(): VaccineData { + return { + ...genBase(), + encounter_id: 0, + encounter: genEncounter(), + unit_id: 0, + unit: genUnit(), + specialist_id: 0, + specialist: genSpecialist(), + subspecialist_id: 0, + subspecialist: genSubspecialist(), + doctor_id: 0, + doctor: genDoctor(), + date: '' + } +} diff --git a/app/pages/(features)/integration/bpjs/prb/[prb_id]/edit.vue b/app/pages/(features)/integration/bpjs/prb/[prb_id]/edit.vue new file mode 100644 index 00000000..abf741bf --- /dev/null +++ b/app/pages/(features)/integration/bpjs/prb/[prb_id]/edit.vue @@ -0,0 +1,41 @@ + + + diff --git a/app/pages/(features)/integration/bpjs/prb/[prb_id]/index.vue b/app/pages/(features)/integration/bpjs/prb/[prb_id]/index.vue new file mode 100644 index 00000000..1d66b563 --- /dev/null +++ b/app/pages/(features)/integration/bpjs/prb/[prb_id]/index.vue @@ -0,0 +1,41 @@ + + + diff --git a/app/pages/(features)/integration/bpjs/prb/add.vue b/app/pages/(features)/integration/bpjs/prb/add.vue new file mode 100644 index 00000000..19b029f9 --- /dev/null +++ b/app/pages/(features)/integration/bpjs/prb/add.vue @@ -0,0 +1,41 @@ + + + diff --git a/app/pages/(features)/integration/bpjs/prb/index.vue b/app/pages/(features)/integration/bpjs/prb/index.vue new file mode 100644 index 00000000..7a6ca683 --- /dev/null +++ b/app/pages/(features)/integration/bpjs/prb/index.vue @@ -0,0 +1,41 @@ + + + diff --git a/app/pages/(features)/rehab/encounter/[id]/prb/[prb_id]/edit.vue b/app/pages/(features)/rehab/encounter/[id]/prb/[prb_id]/edit.vue new file mode 100644 index 00000000..e1059769 --- /dev/null +++ b/app/pages/(features)/rehab/encounter/[id]/prb/[prb_id]/edit.vue @@ -0,0 +1,41 @@ + + + diff --git a/app/pages/(features)/rehab/encounter/[id]/prb/[prb_id]/index.vue b/app/pages/(features)/rehab/encounter/[id]/prb/[prb_id]/index.vue new file mode 100644 index 00000000..1d66b563 --- /dev/null +++ b/app/pages/(features)/rehab/encounter/[id]/prb/[prb_id]/index.vue @@ -0,0 +1,41 @@ + + + diff --git a/app/pages/(features)/rehab/encounter/[id]/prb/add.vue b/app/pages/(features)/rehab/encounter/[id]/prb/add.vue new file mode 100644 index 00000000..b168fcb5 --- /dev/null +++ b/app/pages/(features)/rehab/encounter/[id]/prb/add.vue @@ -0,0 +1,41 @@ + + + diff --git a/app/pages/(features)/rehab/encounter/[id]/process.vue b/app/pages/(features)/rehab/encounter/[id]/process.vue index 68cc7c02..02246607 100644 --- a/app/pages/(features)/rehab/encounter/[id]/process.vue +++ b/app/pages/(features)/rehab/encounter/[id]/process.vue @@ -2,7 +2,7 @@ import type { PagePermission } from '~/models/role' import Error from '~/components/pub/my-ui/error/error.vue' import { PAGE_PERMISSIONS } from '~/lib/page-permission' -import EncounterProcess from '~/components/content/encounter/process.vue' +import EncounterProcess from '~/components/content/encounter/process-bu.vue' definePageMeta({ middleware: ['rbac'], diff --git a/app/pages/(features)/rehab/encounter/[id]/vaccine-data/[vaccine_data_id]/index.vue b/app/pages/(features)/rehab/encounter/[id]/vaccine-data/[vaccine_data_id]/index.vue new file mode 100644 index 00000000..322d0ad8 --- /dev/null +++ b/app/pages/(features)/rehab/encounter/[id]/vaccine-data/[vaccine_data_id]/index.vue @@ -0,0 +1,41 @@ + + + diff --git a/app/pages/(features)/rehab/encounter/[id]/vaccine-data/add.vue b/app/pages/(features)/rehab/encounter/[id]/vaccine-data/add.vue new file mode 100644 index 00000000..df4c33b9 --- /dev/null +++ b/app/pages/(features)/rehab/encounter/[id]/vaccine-data/add.vue @@ -0,0 +1,41 @@ + + + diff --git a/app/schemas/prb-medicine.schema.ts b/app/schemas/prb-medicine.schema.ts new file mode 100644 index 00000000..32b7b9c5 --- /dev/null +++ b/app/schemas/prb-medicine.schema.ts @@ -0,0 +1,27 @@ +import { z } from 'zod' + +const PrbMedicineSchema = z.object({ + a1: z.string({ + required_error: 'Mohon isi', + }).optional(), + a2: z.string({ + required_error: 'Mohon isi', + }), + a3: z.string({ + required_error: 'Mohon isi', + }), + a4: z.string({ + required_error: 'Mohon isi', + }).optional(), + a5: z.string({ + required_error: 'Mohon isi', + }), + a6: z.string({ + required_error: 'Mohon isi', + }), +}) + +type PrbMedicineFormData = z.infer + +export { PrbMedicineSchema } +export type { PrbMedicineFormData } diff --git a/app/schemas/prb.schema.ts b/app/schemas/prb.schema.ts new file mode 100644 index 00000000..2cbb88a8 --- /dev/null +++ b/app/schemas/prb.schema.ts @@ -0,0 +1,47 @@ +import { z } from 'zod' + +const PrbSchema = z.object({ + sepStatus: z.string({ + required_error: 'Mohon isi status SEP', + }).default('SEP Internal'), + unit_code: z.string({ + required_error: 'Mohon isi Unit', + }), + specialist_code: z.string({ + required_error: 'Mohon isi Spesialis', + }), + subspecialist_code: z.string({ + required_error: 'Mohon isi Sub Spesialis', + }), + doctor_code: z.string({ + required_error: 'Mohon isi DPJP', + }), + encounter_code: z.string().optional(), + date: z.string({ + required_error: 'Mohon lengkapi Tanggal Kontrol', + }) + .refine( + (date) => { + // Jika kosong, return false untuk required validation + if (!date || date.trim() === '') return false + + // Jika ada isi, validasi format tanggal + try { + const dateObj = new Date(date) + // Cek apakah tanggal valid dan tahun >= 1900 + return !isNaN(dateObj.getTime()) && dateObj.getFullYear() >= 1900 + } catch { + return false + } + }, + { + message: 'Mohon lengkapi Tanggal Kontrol dengan format yang valid', + }, + ) + .transform((dateStr) => new Date(dateStr).toISOString()), +}) + +type PrbFormData = z.infer + +export { PrbSchema } +export type { PrbFormData } diff --git a/app/schemas/vaccine-data.schema.ts b/app/schemas/vaccine-data.schema.ts new file mode 100644 index 00000000..0a31dae8 --- /dev/null +++ b/app/schemas/vaccine-data.schema.ts @@ -0,0 +1,47 @@ +import { z } from 'zod' + +const VaccineDataSchema = z.object({ + sepStatus: z.string({ + required_error: 'Mohon isi status SEP', + }).default('SEP Internal'), + unit_code: z.string({ + required_error: 'Mohon isi Unit', + }), + specialist_code: z.string({ + required_error: 'Mohon isi Spesialis', + }), + subspecialist_code: z.string({ + required_error: 'Mohon isi Sub Spesialis', + }), + doctor_code: z.string({ + required_error: 'Mohon isi DPJP', + }), + encounter_code: z.string().optional(), + date: z.string({ + required_error: 'Mohon lengkapi Tanggal Kontrol', + }) + .refine( + (date) => { + // Jika kosong, return false untuk required validation + if (!date || date.trim() === '') return false + + // Jika ada isi, validasi format tanggal + try { + const dateObj = new Date(date) + // Cek apakah tanggal valid dan tahun >= 1900 + return !isNaN(dateObj.getTime()) && dateObj.getFullYear() >= 1900 + } catch { + return false + } + }, + { + message: 'Mohon lengkapi Tanggal Kontrol dengan format yang valid', + }, + ) + .transform((dateStr) => new Date(dateStr).toISOString()), +}) + +type VaccineDataFormData = z.infer + +export { VaccineDataSchema } +export type { VaccineDataFormData } diff --git a/app/services/medicine.service.ts b/app/services/medicine.service.ts index 57a52103..00ea34e3 100644 --- a/app/services/medicine.service.ts +++ b/app/services/medicine.service.ts @@ -1,4 +1,5 @@ // Base +import type { Medicine } from '~/models/medicine' import * as base from './_crud-base' const path = '/api/v1/medicine' @@ -23,3 +24,16 @@ export function update(id: number | string, data: any) { export function remove(id: number | string) { return base.remove(path, id, name) } + +export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> { + let data: { value: string; label: string }[] = [] + const result = await getList(params) + if (result.success) { + const resultData = result.body?.data || [] + data = resultData.map((item: Medicine) => ({ + value: item.code, + label: item.name, + })) + } + return data +} \ No newline at end of file diff --git a/app/services/prb.service.ts b/app/services/prb.service.ts new file mode 100644 index 00000000..865a0b99 --- /dev/null +++ b/app/services/prb.service.ts @@ -0,0 +1,28 @@ +// Base +import * as base from './_crud-base' + +// Constants +import { encounterClassCodes } from '~/lib/constants' + +const path = '/api/v1/prb' +const name = 'prb' + +export function create(data: any) { + return base.create(path, data, name) +} + +export function getList(params: any = null) { + return base.getList(path, params, name) +} + +export function getDetail(id: number | string, params?: any) { + return base.getDetail(path, id, name, params) +} + +export function update(id: number | string, data: any) { + return base.update(path, id, data, name) +} + +export function remove(id: number | string) { + return base.remove(path, id, name) +} \ No newline at end of file diff --git a/app/services/vaccine-data.service.ts b/app/services/vaccine-data.service.ts new file mode 100644 index 00000000..6e8aaa89 --- /dev/null +++ b/app/services/vaccine-data.service.ts @@ -0,0 +1,28 @@ +// Base +import * as base from './_crud-base' + +// Constants +import { encounterClassCodes } from '~/lib/constants' + +const path = '/api/v1/vaccine-data' +const name = 'vaccine-data' + +export function create(data: any) { + return base.create(path, data, name) +} + +export function getList(params: any = null) { + return base.getList(path, params, name) +} + +export function getDetail(id: number | string, params?: any) { + return base.getDetail(path, id, name, params) +} + +export function update(id: number | string, data: any) { + return base.update(path, id, data, name) +} + +export function remove(id: number | string) { + return base.remove(path, id, name) +} \ No newline at end of file diff --git a/public/side-menu-items/system.json b/public/side-menu-items/system.json index c46775aa..19d20336 100644 --- a/public/side-menu-items/system.json +++ b/public/side-menu-items/system.json @@ -200,6 +200,11 @@ "icon": "i-lucide-circuit-board", "link": "/integration/bpjs-vclaim/member" }, + { + "title": "PRB", + "icon": "i-lucide-circuit-board", + "link": "/integration/bpjs/prb" + }, { "title": "Surat Kontrol", "icon": "i-lucide-circuit-board",