From 7ddb14accc1fa640ab5a728fb8d7d0dbc1dce38f Mon Sep 17 00:00:00 2001
From: Munawwirul Jamal
Date: Mon, 13 Oct 2025 16:38:23 +0700
Subject: [PATCH 01/35] dev: hotfix, added userQueryCRUD
---
app/composables/useQueryCRUD.ts | 54 +++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)
create mode 100644 app/composables/useQueryCRUD.ts
diff --git a/app/composables/useQueryCRUD.ts b/app/composables/useQueryCRUD.ts
new file mode 100644
index 00000000..a5c532b7
--- /dev/null
+++ b/app/composables/useQueryCRUD.ts
@@ -0,0 +1,54 @@
+import { computed } from 'vue'
+import { useRoute, useRouter } from 'vue-router'
+
+export function useQueryCRUDMode(key: string = 'mode') {
+ const route = useRoute()
+ const router = useRouter()
+
+ type ModeType = 'list' | 'entry'
+ const mode = useState('route-query-' + key, () => 'list')
+ const modeSrc = computed({
+ get: () => (route.query[key] && route.query[key] === 'entry' ? 'entry' : 'list'),
+ set: (val) => {
+ mode.value = val
+ router.push({
+ path: route.path,
+ query: {
+ ...route.query,
+ [key]: val,
+ },
+ })
+ },
+ })
+
+ const goToEntry = () => {
+ modeSrc.value = 'entry'
+ }
+ const backToList = () => {
+ modeSrc.value = 'list'
+ }
+
+ return { mode, goToEntry, backToList }
+}
+
+export function useQueryCRUDRecordId(key: string = 'record-id') {
+ const route = useRoute()
+ const router = useRouter()
+
+ const recordId = useState('route-query-' + key, () => '')
+ computed({
+ get: () => route.query[key],
+ set: (val: string) => {
+ recordId.value = val
+ router.replace({
+ path: route.path,
+ query: {
+ ...route.query,
+ [key]: val,
+ },
+ })
+ },
+ })
+
+ return { recordId }
+}
From 39af6052e729186ae9eae74d435352c178873110 Mon Sep 17 00:00:00 2001
From: Andrian Roshandy
Date: Mon, 20 Oct 2025 11:22:54 +0700
Subject: [PATCH 02/35] feat/device-order-58: wip
---
.../device-order-item/list-entry.config.ts | 36 +++++
.../app/device-order-item/list-entry.vue | 13 ++
.../app/device-order/entry-form.vue | 6 +
.../app/device-order/list.config.ts | 42 +++++
app/components/app/device-order/list.vue | 35 +++++
app/components/content/device-order/entry.vue | 37 +++++
app/components/content/device-order/list.vue | 145 ++++++++++++++++++
app/components/content/device-order/main.vue | 12 ++
app/handlers/device-order-item.handler.ts | 24 +++
app/handlers/device-order.handler.ts | 24 +++
app/schemas/device-order.schema.ts | 12 ++
app/services/device-order-item.service.ts | 26 ++++
app/services/device-order.service.ts | 26 ++++
13 files changed, 438 insertions(+)
create mode 100644 app/components/app/device-order-item/list-entry.config.ts
create mode 100644 app/components/app/device-order-item/list-entry.vue
create mode 100644 app/components/app/device-order/entry-form.vue
create mode 100644 app/components/app/device-order/list.config.ts
create mode 100644 app/components/app/device-order/list.vue
create mode 100644 app/components/content/device-order/entry.vue
create mode 100644 app/components/content/device-order/list.vue
create mode 100644 app/components/content/device-order/main.vue
create mode 100644 app/handlers/device-order-item.handler.ts
create mode 100644 app/handlers/device-order.handler.ts
create mode 100644 app/schemas/device-order.schema.ts
create mode 100644 app/services/device-order-item.service.ts
create mode 100644 app/services/device-order.service.ts
diff --git a/app/components/app/device-order-item/list-entry.config.ts b/app/components/app/device-order-item/list-entry.config.ts
new file mode 100644
index 00000000..f2f3ef86
--- /dev/null
+++ b/app/components/app/device-order-item/list-entry.config.ts
@@ -0,0 +1,36 @@
+import { defineAsyncComponent } from 'vue'
+import type { Config } from '~/components/pub/my-ui/data-table'
+
+
+const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-ud.vue'))
+
+export const config: Config = {
+ cols: [{}, {}, { width: 50 }],
+ headers: [[{ label: 'Nama' }, { label: 'Jumlah' }, { label: '' }]],
+ keys: ['name', 'count', 'action'],
+ delKeyNames: [
+ { key: 'name', label: 'Nama' },
+ { key: 'count', label: 'Jumlah' },
+ ],
+ skeletonSize: 10
+ // funcParsed: {
+ // parent: (rec: unknown): unknown => {
+ // const recX = rec as SmallDetailDto
+ // return recX.parent?.name || '-'
+ // },
+ // },
+ // funcComponent: {
+ // action(rec: object, idx: any) {
+ // const res: RecComponent = {
+ // idx,
+ // rec: rec as object,
+ // component: action,
+ // props: {
+ // size: 'sm',
+ // },
+ // }
+ // return res
+ // },
+ // }
+}
+
diff --git a/app/components/app/device-order-item/list-entry.vue b/app/components/app/device-order-item/list-entry.vue
new file mode 100644
index 00000000..26f6691d
--- /dev/null
+++ b/app/components/app/device-order-item/list-entry.vue
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+ Tambah
+
+
+
diff --git a/app/components/app/device-order/entry-form.vue b/app/components/app/device-order/entry-form.vue
new file mode 100644
index 00000000..bea2b6eb
--- /dev/null
+++ b/app/components/app/device-order/entry-form.vue
@@ -0,0 +1,6 @@
+
+
+
+ Test
+
diff --git a/app/components/app/device-order/list.config.ts b/app/components/app/device-order/list.config.ts
new file mode 100644
index 00000000..7580c576
--- /dev/null
+++ b/app/components/app/device-order/list.config.ts
@@ -0,0 +1,42 @@
+import type { Config } from '~/components/pub/my-ui/data-table'
+import type { DeviceOrder } from '~/models/device-order'
+import { defineAsyncComponent } from 'vue'
+
+const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-ud.vue'))
+
+export const config: Config = {
+ cols: [{ width: 120 }, { }, { }, { width: 50 }],
+ headers: [[{ label: 'Tanggal' }, { label: 'DPJP' }, { label: 'Alat Kesehatan' }, { label: '' }]],
+ keys: ['createdAt', 'encounter.doctor.person.name', 'items', 'action'],
+ delKeyNames: [
+ { key: 'code', label: 'Kode' },
+ { key: 'name', label: 'Nama' },
+ ],
+ skeletonSize: 10,
+ htmls: {
+ items: (rec: unknown): unknown => {
+ const recX = rec as DeviceOrder
+ return recX.items?.length || 0
+ },
+ }
+ // funcParsed: {
+ // parent: (rec: unknown): unknown => {
+ // const recX = rec as SmallDetailDto
+ // return recX.parent?.name || '-'
+ // },
+ // },
+ // funcComponent: {
+ // action(rec: object, idx: any) {
+ // const res: RecComponent = {
+ // idx,
+ // rec: rec as object,
+ // component: action,
+ // props: {
+ // size: 'sm',
+ // },
+ // }
+ // return res
+ // },
+ // }
+}
+
diff --git a/app/components/app/device-order/list.vue b/app/components/app/device-order/list.vue
new file mode 100644
index 00000000..37b24ea3
--- /dev/null
+++ b/app/components/app/device-order/list.vue
@@ -0,0 +1,35 @@
+
+
+
+
+
diff --git a/app/components/content/device-order/entry.vue b/app/components/content/device-order/entry.vue
new file mode 100644
index 00000000..6d76d685
--- /dev/null
+++ b/app/components/content/device-order/entry.vue
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/content/device-order/list.vue b/app/components/content/device-order/list.vue
new file mode 100644
index 00000000..e62a2fbd
--- /dev/null
+++ b/app/components/content/device-order/list.vue
@@ -0,0 +1,145 @@
+
+
+
+
+
+
+
+
+ handleActionRemove(recId, getMyList, toast)"
+ @cancel=""
+ >
+
+
+
+ ID:
+ {{ record?.id }}
+
+
+ Nama:
+ {{ record.name }}
+
+
+ Kode:
+ {{ record.code }}
+
+
+
+
+
diff --git a/app/components/content/device-order/main.vue b/app/components/content/device-order/main.vue
new file mode 100644
index 00000000..ae5a9ca8
--- /dev/null
+++ b/app/components/content/device-order/main.vue
@@ -0,0 +1,12 @@
+
+
+
+
+
+
diff --git a/app/handlers/device-order-item.handler.ts b/app/handlers/device-order-item.handler.ts
new file mode 100644
index 00000000..b1df996b
--- /dev/null
+++ b/app/handlers/device-order-item.handler.ts
@@ -0,0 +1,24 @@
+// Handlers
+import { genCrudHandler } from '~/handlers/_handler'
+
+// Services
+import { create, update, remove } from '~/services/device-order-item.service'
+
+export const {
+ recId,
+ recAction,
+ recItem,
+ isReadonly,
+ isProcessing,
+ isFormEntryDialogOpen,
+ isRecordConfirmationOpen,
+ onResetState,
+ handleActionSave,
+ handleActionEdit,
+ handleActionRemove,
+ handleCancelForm,
+} = genCrudHandler({
+ create,
+ update,
+ remove,
+})
diff --git a/app/handlers/device-order.handler.ts b/app/handlers/device-order.handler.ts
new file mode 100644
index 00000000..b1df996b
--- /dev/null
+++ b/app/handlers/device-order.handler.ts
@@ -0,0 +1,24 @@
+// Handlers
+import { genCrudHandler } from '~/handlers/_handler'
+
+// Services
+import { create, update, remove } from '~/services/device-order-item.service'
+
+export const {
+ recId,
+ recAction,
+ recItem,
+ isReadonly,
+ isProcessing,
+ isFormEntryDialogOpen,
+ isRecordConfirmationOpen,
+ onResetState,
+ handleActionSave,
+ handleActionEdit,
+ handleActionRemove,
+ handleCancelForm,
+} = genCrudHandler({
+ create,
+ update,
+ remove,
+})
diff --git a/app/schemas/device-order.schema.ts b/app/schemas/device-order.schema.ts
new file mode 100644
index 00000000..b0c2a56c
--- /dev/null
+++ b/app/schemas/device-order.schema.ts
@@ -0,0 +1,12 @@
+import { z } from 'zod'
+import type { DeviceOrder } from '~/models/device-order'
+
+const DeviceOrderSchema = z.object({
+ encounter_id: z.number({ required_error: 'Kode harus diisi' }),
+ doctor_id: z.number({ required_error: 'Kode harus diisi' }),
+})
+
+type DeviceOrderFormData = z.infer & Partial
+
+export { DeviceOrderSchema }
+export type { DeviceOrderFormData }
diff --git a/app/services/device-order-item.service.ts b/app/services/device-order-item.service.ts
new file mode 100644
index 00000000..33b92b8c
--- /dev/null
+++ b/app/services/device-order-item.service.ts
@@ -0,0 +1,26 @@
+// Base
+import * as base from './_crud-base'
+
+const path = '/api/v1/device-order-item'
+const name = 'device-order-item'
+
+export function create(data: any) {
+ console.log('service create', data)
+ return base.create(path, data, name)
+}
+
+export function getList(params: any = null) {
+ return base.getList(path, params, name)
+}
+
+export function getDetail(id: number | string) {
+ return base.getDetail(path, id, name)
+}
+
+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)
+}
diff --git a/app/services/device-order.service.ts b/app/services/device-order.service.ts
new file mode 100644
index 00000000..b8d5372c
--- /dev/null
+++ b/app/services/device-order.service.ts
@@ -0,0 +1,26 @@
+// Base
+import * as base from './_crud-base'
+
+const path = '/api/v1/device-order'
+const name = 'device-order'
+
+export function create(data: any) {
+ console.log('service create', data)
+ return base.create(path, data, name)
+}
+
+export function getList(params: any = null) {
+ return base.getList(path, params, name)
+}
+
+export function getDetail(id: number | string) {
+ return base.getDetail(path, id, name)
+}
+
+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)
+}
From 7f3fe813c547c6fdc58a0194827aca885d49a344 Mon Sep 17 00:00:00 2001
From: Andrian Roshandy
Date: Thu, 23 Oct 2025 14:09:01 +0700
Subject: [PATCH 03/35] feat/device-order: wip
---
app/components/content/device-order/list.vue | 24 ++++++++++++++------
app/components/content/encounter/process.vue | 3 ++-
app/handlers/device-order.handler.ts | 5 ++--
app/services/device-order-item.service.ts | 1 -
4 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/app/components/content/device-order/list.vue b/app/components/content/device-order/list.vue
index e62a2fbd..8c53f244 100644
--- a/app/components/content/device-order/list.vue
+++ b/app/components/content/device-order/list.vue
@@ -32,8 +32,15 @@ import {
handleCancelForm,
} from '~/handlers/device-order.handler'
-// Services
+//
import { getList } from '~/services/device-order.service'
+import type { Encounter } from '~/models/encounter'
+
+// Props
+interface Props {
+ encounter: Encounter
+}
+const props = defineProps()
const route = useRoute()
const title = ref('')
@@ -57,7 +64,7 @@ const {
sort: 'createdAt:asc',
'page-number': params['page-number'] || 0,
'page-size': params['page-size'] || 10,
- includes: 'parent,childrens',
+ includes: 'encounter',
})
return { success: result.success || false, body: result.body || {} }
},
@@ -82,11 +89,14 @@ const headerPrep: HeaderPrep = {
label: 'Tambah',
icon: 'i-lucide-plus',
onClick: async () => {
- recItem.value = null
- recId.value = 0
- isReadonly.value = false
- // await handleActionSave(recItem, getMyList, () => {}, () => {})
- goToEntry()
+ const data = {
+ encounter_id: props.encounter.id,
+ }
+ const dateResp = await handleActionSave(data, getMyList, () => {}, () => {})
+ if (dateResp.success) {
+ const currentData = dateResp.body.data || []
+ // goToEntry()
+ }
},
},
}
diff --git a/app/components/content/encounter/process.vue b/app/components/content/encounter/process.vue
index 6fc620b5..d4279504 100644
--- a/app/components/content/encounter/process.vue
+++ b/app/components/content/encounter/process.vue
@@ -17,6 +17,7 @@ import EarlyMedicalAssesmentList from '~/components/content/soapi/entry.vue'
// import AssesmentFunctionList from '~/components/content/assesment-function/list.vue'
import PrescriptionList from '~/components/content/prescription/list.vue'
import EarlyMedicalRehabList from '~/components/content/soapi/entry.vue'
+import DeviceOrder from '~/components/content/device-order/main.vue'
import Consultation from '~/components/content/consultation/list.vue'
const route = useRoute()
@@ -49,7 +50,7 @@ const tabs: TabItem[] = [
{ value: 'consent', label: 'General Consent' },
{ value: 'patient-note', label: 'CPRJ' },
{ value: 'prescription', label: 'Order Obat', component: PrescriptionList },
- { value: 'device', label: 'Order Alkes' },
+ { value: 'device-order', label: 'Order Alkes', component: DeviceOrder, props: { encounter: data } },
{ value: 'mcu-radiology', label: 'Order Radiologi' },
{ value: 'mcu-lab-pc', label: 'Order Lab PK' },
{ value: 'mcu-lab-micro', label: 'Order Lab Mikro' },
diff --git a/app/handlers/device-order.handler.ts b/app/handlers/device-order.handler.ts
index b1df996b..25529894 100644
--- a/app/handlers/device-order.handler.ts
+++ b/app/handlers/device-order.handler.ts
@@ -1,8 +1,9 @@
// Handlers
import { genCrudHandler } from '~/handlers/_handler'
+import type { DeviceOrder, CreateDto } from '~/models/device-order'
// Services
-import { create, update, remove } from '~/services/device-order-item.service'
+import { create, update, remove } from '~/services/device-order.service'
export const {
recId,
@@ -17,7 +18,7 @@ export const {
handleActionEdit,
handleActionRemove,
handleCancelForm,
-} = genCrudHandler({
+} = genCrudHandler({
create,
update,
remove,
diff --git a/app/services/device-order-item.service.ts b/app/services/device-order-item.service.ts
index 33b92b8c..b2eab0f4 100644
--- a/app/services/device-order-item.service.ts
+++ b/app/services/device-order-item.service.ts
@@ -5,7 +5,6 @@ const path = '/api/v1/device-order-item'
const name = 'device-order-item'
export function create(data: any) {
- console.log('service create', data)
return base.create(path, data, name)
}
From fc308809b848512a664659a51475e634e08f06f4 Mon Sep 17 00:00:00 2001
From: hasyim_kai
Date: Wed, 29 Oct 2025 14:57:19 +0700
Subject: [PATCH 04/35] Feat: add UI Rehab Medik > Proses > Resume
---
.../app/resume/_common/select-arrangement.vue | 72 +++++++
.../app/resume/_common/select-date.vue | 121 ++++++++++++
.../app/resume/_common/select-death-cause.vue | 71 +++++++
.../app/resume/_common/select-faskes.vue | 70 +++++++
.../_common/select-primary-diagnosis.vue | 70 +++++++
.../_common/select-secondary-diagnosis.vue | 71 +++++++
app/components/app/resume/add.vue | 185 ++++++++++++++++++
app/components/app/resume/list.cfg.ts | 93 +++++++++
app/components/app/resume/list.vue | 43 ++++
app/components/content/encounter/process.vue | 3 +-
app/components/content/resume/add.vue | 104 ++++++++++
app/components/content/resume/list.vue | 151 ++++++++++++++
.../pub/my-ui/form/text-area-input.vue | 86 ++++++++
.../pub/my-ui/nav-footer/ba-dr-su.vue | 3 +-
app/pages/(features)/resume/add.vue | 41 ++++
app/schemas/resume.schema.ts | 42 ++++
16 files changed, 1224 insertions(+), 2 deletions(-)
create mode 100644 app/components/app/resume/_common/select-arrangement.vue
create mode 100644 app/components/app/resume/_common/select-date.vue
create mode 100644 app/components/app/resume/_common/select-death-cause.vue
create mode 100644 app/components/app/resume/_common/select-faskes.vue
create mode 100644 app/components/app/resume/_common/select-primary-diagnosis.vue
create mode 100644 app/components/app/resume/_common/select-secondary-diagnosis.vue
create mode 100644 app/components/app/resume/add.vue
create mode 100644 app/components/app/resume/list.cfg.ts
create mode 100644 app/components/app/resume/list.vue
create mode 100644 app/components/content/resume/add.vue
create mode 100644 app/components/content/resume/list.vue
create mode 100644 app/components/pub/my-ui/form/text-area-input.vue
create mode 100644 app/pages/(features)/resume/add.vue
create mode 100644 app/schemas/resume.schema.ts
diff --git a/app/components/app/resume/_common/select-arrangement.vue b/app/components/app/resume/_common/select-arrangement.vue
new file mode 100644
index 00000000..9a945d44
--- /dev/null
+++ b/app/components/app/resume/_common/select-arrangement.vue
@@ -0,0 +1,72 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/resume/_common/select-date.vue b/app/components/app/resume/_common/select-date.vue
new file mode 100644
index 00000000..74245e7e
--- /dev/null
+++ b/app/components/app/resume/_common/select-date.vue
@@ -0,0 +1,121 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+ {
+ const dateStr = typeof value === 'number' ? String(value) : value
+ patientAge = calculateAge(dateStr)
+ }
+ "
+ />
+
+
+
+
+
+
+
diff --git a/app/components/app/resume/_common/select-death-cause.vue b/app/components/app/resume/_common/select-death-cause.vue
new file mode 100644
index 00000000..a155b139
--- /dev/null
+++ b/app/components/app/resume/_common/select-death-cause.vue
@@ -0,0 +1,71 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/resume/_common/select-faskes.vue b/app/components/app/resume/_common/select-faskes.vue
new file mode 100644
index 00000000..0852195b
--- /dev/null
+++ b/app/components/app/resume/_common/select-faskes.vue
@@ -0,0 +1,70 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/resume/_common/select-primary-diagnosis.vue b/app/components/app/resume/_common/select-primary-diagnosis.vue
new file mode 100644
index 00000000..0852195b
--- /dev/null
+++ b/app/components/app/resume/_common/select-primary-diagnosis.vue
@@ -0,0 +1,70 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/resume/_common/select-secondary-diagnosis.vue b/app/components/app/resume/_common/select-secondary-diagnosis.vue
new file mode 100644
index 00000000..a155b139
--- /dev/null
+++ b/app/components/app/resume/_common/select-secondary-diagnosis.vue
@@ -0,0 +1,71 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/resume/add.vue b/app/components/app/resume/add.vue
new file mode 100644
index 00000000..2e12f872
--- /dev/null
+++ b/app/components/app/resume/add.vue
@@ -0,0 +1,185 @@
+
+
+
+
+
diff --git a/app/components/app/resume/list.cfg.ts b/app/components/app/resume/list.cfg.ts
new file mode 100644
index 00000000..38f8f5d7
--- /dev/null
+++ b/app/components/app/resume/list.cfg.ts
@@ -0,0 +1,93 @@
+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-dud.vue'))
+
+export const config: Config = {
+ cols: [{}, {}, {}, {}, {width: 3},],
+
+ headers: [
+ [
+ { label: 'Tgl Rencana Kontrol' },
+ { label: 'Spesialis/Sub Spesialis' },
+ { label: 'DPJP' },
+ { label: 'Status SEP' },
+ { label: 'Action' },
+ ],
+ ],
+
+ keys: ['birth_date', 'number', 'person.name', 'birth_date', 'action'],
+
+ delKeyNames: [
+ { key: 'code', label: 'Kode' },
+ { key: 'name', label: 'Nama' },
+ ],
+
+ parses: {
+ patientId: (rec: unknown): unknown => {
+ const patient = rec as Patient
+ return patient.number
+ },
+ identity_number: (rec: unknown): unknown => {
+ const { person } = rec as Patient
+
+ if (person.nationality == 'WNA') {
+ return person.passportNumber
+ }
+
+ return person.residentIdentityNumber || '-'
+ },
+ birth_date: (rec: unknown): unknown => {
+ const { person } = rec as Patient
+
+ if (typeof person.birthDate == 'object' && person.birthDate) {
+ return (person.birthDate as Date).toLocaleDateString('id-ID')
+ } else if (typeof person.birthDate == 'string') {
+ return (person.birthDate as string).substring(0, 10)
+ }
+ return person.birthDate
+ },
+ patient_age: (rec: unknown): unknown => {
+ const { person } = rec as Patient
+ return calculateAge(person.birthDate)
+ },
+ gender: (rec: unknown): unknown => {
+ const { person } = rec as Patient
+
+ if (typeof person.gender_code == 'number' && person.gender_code >= 0) {
+ return person.gender_code
+ } else if (typeof person.gender_code === 'string' && person.gender_code) {
+ return genderCodes[person.gender_code] || '-'
+ }
+ return '-'
+ },
+ education: (rec: unknown): unknown => {
+ const { person } = rec as Patient
+ if (typeof person.education_code == 'number' && person.education_code >= 0) {
+ return person.education_code
+ } else if (typeof person.education_code === 'string' && person.education_code) {
+ return educationCodes[person.education_code] || '-'
+ }
+ return '-'
+ },
+ },
+
+ components: {
+ action(rec, idx) {
+ return {
+ idx,
+ rec: rec as object,
+ component: action,
+ }
+ },
+ },
+
+ htmls: {
+ patient_address(_rec) {
+ return '-'
+ },
+ },
+}
diff --git a/app/components/app/resume/list.vue b/app/components/app/resume/list.vue
new file mode 100644
index 00000000..c4c101e5
--- /dev/null
+++ b/app/components/app/resume/list.vue
@@ -0,0 +1,43 @@
+
+
+
+
+ Pemeriksaan Pasien
+
+ {{ new Date().toLocaleDateString('id-ID') }}
+ {{ new Date().toLocaleDateString('id-ID') }}
+ {{ `-` }}
+ {{ `-` }}
+ {{ `-` }}
+
+
+ Diagnosis
+
+ {{ `-` }}
+ {{ `-` }}
+
+
+ Tindakan Operatif/Non Operatif
+
+ {{ `-` }}
+ {{ `-` }}
+ {{ `-` }}
+
+
+ Penatalaksanaan
+
+ {{ `-` }}
+
+
+
diff --git a/app/components/content/encounter/process.vue b/app/components/content/encounter/process.vue
index 71c7fe3d..9b6308f2 100644
--- a/app/components/content/encounter/process.vue
+++ b/app/components/content/encounter/process.vue
@@ -16,6 +16,7 @@ import EarlyMedicalAssesmentList from '~/components/content/soapi/entry.vue'
import EarlyMedicalRehabList from '~/components/content/soapi/entry.vue'
import PrescriptionList from '~/components/content/prescription/list.vue'
import Consultation from '~/components/content/consultation/list.vue'
+import ResumeList from '~/components/content/resume/list.vue'
const route = useRoute()
const router = useRouter()
@@ -58,7 +59,7 @@ const tabs: TabItem[] = [
{ value: 'medical-action', label: 'Order Ruang Tindakan' },
{ value: 'mcu-result', label: 'Hasil Penunjang' },
{ value: 'consultation', label: 'Konsultasi', component: Consultation, props: { encounter: data } },
- { value: 'resume', label: 'Resume' },
+ { value: 'resume', label: 'Resume', component: ResumeList, props: { encounter: data } },
{ value: 'control', label: 'Surat Kontrol' },
{ value: 'screening', label: 'Skrinning MPP' },
{ value: 'supporting-document', label: 'Upload Dokumen Pendukung' },
diff --git a/app/components/content/resume/add.vue b/app/components/content/resume/add.vue
new file mode 100644
index 00000000..6df169c6
--- /dev/null
+++ b/app/components/content/resume/add.vue
@@ -0,0 +1,104 @@
+
+
+
+ Tambah Resume
+
+
+
+
+
+
diff --git a/app/components/content/resume/list.vue b/app/components/content/resume/list.vue
new file mode 100644
index 00000000..5c5e3658
--- /dev/null
+++ b/app/components/content/resume/list.vue
@@ -0,0 +1,151 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/components/pub/my-ui/form/text-area-input.vue b/app/components/pub/my-ui/form/text-area-input.vue
new file mode 100644
index 00000000..7747e727
--- /dev/null
+++ b/app/components/pub/my-ui/form/text-area-input.vue
@@ -0,0 +1,86 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/components/pub/my-ui/nav-footer/ba-dr-su.vue b/app/components/pub/my-ui/nav-footer/ba-dr-su.vue
index 4598817b..e38e12fa 100644
--- a/app/components/pub/my-ui/nav-footer/ba-dr-su.vue
+++ b/app/components/pub/my-ui/nav-footer/ba-dr-su.vue
@@ -1,5 +1,6 @@
+
+
+
+
+
+
+
diff --git a/app/schemas/resume.schema.ts b/app/schemas/resume.schema.ts
new file mode 100644
index 00000000..99539414
--- /dev/null
+++ b/app/schemas/resume.schema.ts
@@ -0,0 +1,42 @@
+import { z } from 'zod'
+import type { CreateDto } from '~/models/consultation'
+
+export type ResumeArrangementType = "krs" | "mrs" | "pindahIgd" | "rujuk" | "rujukBalik" | "meninggal" | "other"
+
+const ResumeSchema = z.object({
+ inDate: z.string({ required_error: 'Tanggal harus diisi' }),
+ outDate: z.string({ required_error: 'Tanggal harus diisi' }),
+ anamnesis: z.number({ required_error: 'Anamnesis harus diisi' })
+ .min(1, 'Anamnesis minimum 1 karakter')
+ .max(2048, 'Anamnesis maksimum 2048 karakter'),
+ physicalCheckup: z.string({ required_error: 'Uraian harus diisi' })
+ .min(1, 'Uraian minimum 1 karakter')
+ .max(2048, 'Uraian maksimum 2048 karakter'),
+ supplementCheckup: z.string({ required_error: 'Uraian harus diisi' })
+ .min(1, 'Uraian minimum 1 karakter')
+ .max(2048, 'Uraian maksimum 2048 karakter'),
+
+ primaryDiagnosis: z.string({ required_error: 'Diagnosis harus diisi' }),
+ secondaryDiagnosis: z.array(z.string()).optional().default([]),
+
+ primaryOperativeNonOperativeAct: z.string({ required_error: 'Diagnosis harus diisi' }),
+ secondaryOperativeNonOperativeAct: z.array(z.string()).optional().default([]),
+ medikamentosa: z.string({ required_error: 'Uraian harus diisi' })
+ .min(1, 'Uraian minimum 1 karakter')
+ .max(2048, 'Uraian maksimum 2048 karakter'),
+
+ arrangement: z.custom().default("krs"),
+ faskes: z.string({ required_error: 'Faskes harus diisi' }).optional(),
+ clinic: z.string({ required_error: 'Klinik harus diisi' }).optional(),
+ deathDate: z.string({ required_error: 'Tanggal harus diisi' }).optional(),
+ deathCause: z.array(z.string()).optional().default([]),
+ keterangan: z.string({ required_error: 'Uraian harus diisi' })
+ .min(1, 'Uraian minimum 1 karakter')
+ .max(2048, 'Uraian maksimum 2048 karakter')
+ .optional(),
+})
+
+type ResumeFormData = z.infer & (CreateDto)
+
+export { ResumeSchema }
+export type { ResumeFormData }
From 53bd8e7f6e2b22b03690947f52b42744a17703ee Mon Sep 17 00:00:00 2001
From: hasyim_kai
Date: Fri, 7 Nov 2025 08:55:23 +0700
Subject: [PATCH 05/35] Fix: refactor rehab medik - Resume UI
---
.../app/resume/_common/print-btn.vue | 22 +
.../resume/_common/select-concious-level.vue | 70 +++
.../_common/select-following-arrangement.vue | 70 +++
.../select-hospital-leave-condition.vue | 70 +++
.../_common/select-hospital-leave-method.vue | 70 +++
.../app/resume/_common/select-icd-10.vue | 70 +++
.../app/resume/_common/select-icd-9.vue | 70 +++
...select-national-program-service-status.vue | 70 +++
.../select-national-program-service.vue | 70 +++
.../app/resume/_common/select-pain-scale.vue | 70 +++
.../app/resume/_common/verify-badge.vue | 67 +++
app/components/app/resume/add.vue | 468 ++++++++++++++----
.../history-list/action-history-dialog.vue | 66 +++
.../resume/history-list/action-list.cfg.ts | 94 ++++
.../consultation-history-dialog.vue | 66 +++
.../history-list/consultation-list.cfg.ts | 51 ++
.../history-list/farmacy-history-dialog.vue | 66 +++
.../resume/history-list/farmacy-list.cfg.ts | 39 ++
.../national-program-history-dialog.vue | 65 +++
.../history-list/national-program-list.cfg.ts | 30 ++
.../supporting-history-dialog.vue | 66 +++
.../history-list/supporting-list.cfg.ts | 39 ++
app/components/app/resume/list.cfg.ts | 20 +-
app/components/app/resume/list.vue | 50 +-
app/components/app/resume/verify-dialog.vue | 97 ++++
app/components/content/resume/add.vue | 98 +++-
app/components/content/resume/list.vue | 142 ++++--
.../pub/my-ui/data/dropdown-action-dvvp.vue | 103 ++++
app/components/pub/my-ui/data/types.ts | 3 +
app/components/pub/my-ui/form/input-base.vue | 8 +-
.../pub/my-ui/form/text-area-input.vue | 2 +-
app/schemas/resume.schema.ts | 35 +-
32 files changed, 2142 insertions(+), 185 deletions(-)
create mode 100644 app/components/app/resume/_common/print-btn.vue
create mode 100644 app/components/app/resume/_common/select-concious-level.vue
create mode 100644 app/components/app/resume/_common/select-following-arrangement.vue
create mode 100644 app/components/app/resume/_common/select-hospital-leave-condition.vue
create mode 100644 app/components/app/resume/_common/select-hospital-leave-method.vue
create mode 100644 app/components/app/resume/_common/select-icd-10.vue
create mode 100644 app/components/app/resume/_common/select-icd-9.vue
create mode 100644 app/components/app/resume/_common/select-national-program-service-status.vue
create mode 100644 app/components/app/resume/_common/select-national-program-service.vue
create mode 100644 app/components/app/resume/_common/select-pain-scale.vue
create mode 100644 app/components/app/resume/_common/verify-badge.vue
create mode 100644 app/components/app/resume/history-list/action-history-dialog.vue
create mode 100644 app/components/app/resume/history-list/action-list.cfg.ts
create mode 100644 app/components/app/resume/history-list/consultation-history-dialog.vue
create mode 100644 app/components/app/resume/history-list/consultation-list.cfg.ts
create mode 100644 app/components/app/resume/history-list/farmacy-history-dialog.vue
create mode 100644 app/components/app/resume/history-list/farmacy-list.cfg.ts
create mode 100644 app/components/app/resume/history-list/national-program-history-dialog.vue
create mode 100644 app/components/app/resume/history-list/national-program-list.cfg.ts
create mode 100644 app/components/app/resume/history-list/supporting-history-dialog.vue
create mode 100644 app/components/app/resume/history-list/supporting-list.cfg.ts
create mode 100644 app/components/app/resume/verify-dialog.vue
create mode 100644 app/components/pub/my-ui/data/dropdown-action-dvvp.vue
diff --git a/app/components/app/resume/_common/print-btn.vue b/app/components/app/resume/_common/print-btn.vue
new file mode 100644
index 00000000..5688d007
--- /dev/null
+++ b/app/components/app/resume/_common/print-btn.vue
@@ -0,0 +1,22 @@
+
+
+
+
+
+ {{ props.btnTxt || 'Lampiran' }}
+
+
\ No newline at end of file
diff --git a/app/components/app/resume/_common/select-concious-level.vue b/app/components/app/resume/_common/select-concious-level.vue
new file mode 100644
index 00000000..0852195b
--- /dev/null
+++ b/app/components/app/resume/_common/select-concious-level.vue
@@ -0,0 +1,70 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/resume/_common/select-following-arrangement.vue b/app/components/app/resume/_common/select-following-arrangement.vue
new file mode 100644
index 00000000..0852195b
--- /dev/null
+++ b/app/components/app/resume/_common/select-following-arrangement.vue
@@ -0,0 +1,70 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/resume/_common/select-hospital-leave-condition.vue b/app/components/app/resume/_common/select-hospital-leave-condition.vue
new file mode 100644
index 00000000..0852195b
--- /dev/null
+++ b/app/components/app/resume/_common/select-hospital-leave-condition.vue
@@ -0,0 +1,70 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/resume/_common/select-hospital-leave-method.vue b/app/components/app/resume/_common/select-hospital-leave-method.vue
new file mode 100644
index 00000000..0852195b
--- /dev/null
+++ b/app/components/app/resume/_common/select-hospital-leave-method.vue
@@ -0,0 +1,70 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/resume/_common/select-icd-10.vue b/app/components/app/resume/_common/select-icd-10.vue
new file mode 100644
index 00000000..0852195b
--- /dev/null
+++ b/app/components/app/resume/_common/select-icd-10.vue
@@ -0,0 +1,70 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/resume/_common/select-icd-9.vue b/app/components/app/resume/_common/select-icd-9.vue
new file mode 100644
index 00000000..0852195b
--- /dev/null
+++ b/app/components/app/resume/_common/select-icd-9.vue
@@ -0,0 +1,70 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/resume/_common/select-national-program-service-status.vue b/app/components/app/resume/_common/select-national-program-service-status.vue
new file mode 100644
index 00000000..0852195b
--- /dev/null
+++ b/app/components/app/resume/_common/select-national-program-service-status.vue
@@ -0,0 +1,70 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/resume/_common/select-national-program-service.vue b/app/components/app/resume/_common/select-national-program-service.vue
new file mode 100644
index 00000000..0852195b
--- /dev/null
+++ b/app/components/app/resume/_common/select-national-program-service.vue
@@ -0,0 +1,70 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/resume/_common/select-pain-scale.vue b/app/components/app/resume/_common/select-pain-scale.vue
new file mode 100644
index 00000000..0852195b
--- /dev/null
+++ b/app/components/app/resume/_common/select-pain-scale.vue
@@ -0,0 +1,70 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/resume/_common/verify-badge.vue b/app/components/app/resume/_common/verify-badge.vue
new file mode 100644
index 00000000..8a999895
--- /dev/null
+++ b/app/components/app/resume/_common/verify-badge.vue
@@ -0,0 +1,67 @@
+
+
+
+
+
+ {{ statusText }}
+
+
+
\ No newline at end of file
diff --git a/app/components/app/resume/add.vue b/app/components/app/resume/add.vue
index 2e12f872..d1423735 100644
--- a/app/components/app/resume/add.vue
+++ b/app/components/app/resume/add.vue
@@ -8,12 +8,19 @@ import InputBase from '~/components/pub/my-ui/form/input-base.vue'
import * as DE from '~/components/pub/my-ui/doc-entry'
import TextAreaInput from '~/components/pub/my-ui/form/text-area-input.vue'
-import SelectSecondaryDiagnosis from './_common/select-secondary-diagnosis.vue'
-import SelectPrimaryDiagnosis from './_common/select-primary-diagnosis.vue'
import SelectArrangement from './_common/select-arrangement.vue'
import type { ResumeArrangementType } from '~/schemas/resume.schema'
import SelectFaskes from './_common/select-faskes.vue'
import SelectDeathCause from './_common/select-death-cause.vue'
+import SelectIcd10 from './_common/select-icd-10.vue'
+import SelectIcd9 from './_common/select-icd-9.vue'
+import SelectConciousLevel from './_common/select-concious-level.vue'
+import SelectPainScale from './_common/select-pain-scale.vue'
+import SelectNationalProgramService from './_common/select-national-program-service.vue'
+import SelectNationalProgramServiceStatus from './_common/select-national-program-service-status.vue'
+import SelectHospitalLeaveCondition from './_common/select-hospital-leave-condition.vue'
+import SelectFollowingArrangement from './_common/select-following-arrangement.vue'
+import SelectHospitalLeaveMethod from './_common/select-hospital-leave-method.vue'
const props = defineProps<{
schema: any
@@ -22,6 +29,11 @@ const props = defineProps<{
errors?: FormErrors
}>()
+const isActionHistoryOpen = inject(`isActionHistoryOpen`) as Ref
+const isConsultationHistoryOpen = inject(`isConsultationHistoryOpen`) as Ref
+const isSupportingHistoryOpen = inject(`isSupportingHistoryOpen`) as Ref
+const isFarmacyHistoryOpen = inject(`isFarmacyHistoryOpen`) as Ref
+const isNationalProgramServiceHistoryOpen = inject(`isNationalProgramServiceHistoryOpen`) as Ref
const formSchema = toTypedSchema(props.schema)
const formRef = ref()
@@ -31,101 +43,369 @@ defineExpose({
setValues: (values: any, shouldValidate = true) => formRef.value?.setValues(values, shouldValidate),
values: computed(() => formRef.value?.values),
})
+
+const DEFAULT_SECONDARY_DIAGNOSIS_VALUE = {
+ diagnosis: '',
+ icd10: '',
+ diagnosisBasis: '',
+};
+const DEFAULT_SECONDARY_ACTION_VALUE = {
+ action: '',
+ icd9: '',
+ actionBasis: '',
+};
+const DEFAULT_CONSULTATION_VALUE = {
+ consultation: '',
+ consultationReply: '',
+};
-
\ No newline at end of file
diff --git a/app/components/app/resume/verify-dialog.vue b/app/components/app/resume/verify-dialog.vue
new file mode 100644
index 00000000..1519446c
--- /dev/null
+++ b/app/components/app/resume/verify-dialog.vue
@@ -0,0 +1,97 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/components/content/resume/add.vue b/app/components/content/resume/add.vue
index 6df169c6..6fda4bf8 100644
--- a/app/components/content/resume/add.vue
+++ b/app/components/content/resume/add.vue
@@ -3,6 +3,14 @@ import type { ExposedForm } from '~/types/form';
import Action from '~/components/pub/my-ui/nav-footer/ba-dr-su.vue'
import { ResumeSchema } from '~/schemas/resume.schema';
import Confirmation from '~/components/pub/my-ui/confirmation/confirmation.vue'
+import { CalendarDate, DateFormatter, getLocalTimeZone } from '@internationalized/date';
+import type { DateRange } from 'radix-vue';
+import { getPatients } from '~/services/patient.service';
+import ActionHistoryDialog from '~/components/app/resume/history-list/action-history-dialog.vue';
+import ConsultationHistoryDialog from '~/components/app/resume/history-list/consultation-history-dialog.vue';
+import SupportingHistoryDialog from '~/components/app/resume/history-list/supporting-history-dialog.vue';
+import FarmacyHistoryDialog from '~/components/app/resume/history-list/farmacy-history-dialog.vue';
+import NationalProgramHistoryDialog from '~/components/app/resume/history-list/national-program-history-dialog.vue';
// #region Props & Emits
const props = defineProps<{
@@ -11,14 +19,60 @@ const props = defineProps<{
// form related state
const personPatientForm = ref | null>(null)
+const actionHistoryData = usePaginatedList({
+ fetchFn: (params) => getPatients({ ...params, includes: ['person', 'person-Addresses'] }),
+ entityName: 'patient',
+})
+const consultationHistoryData = usePaginatedList({
+ fetchFn: (params) => getPatients({ ...params, includes: ['person', 'person-Addresses'] }),
+ entityName: 'patient',
+})
+const supportingHistoryData = usePaginatedList({
+ fetchFn: (params) => getPatients({ ...params, includes: ['person', 'person-Addresses'] }),
+ entityName: 'patient',
+})
+const farmacyHistoryData = usePaginatedList({
+ fetchFn: (params) => getPatients({ ...params, includes: ['person', 'person-Addresses'] }),
+ entityName: 'patient',
+})
+const nationalProgramServiceHistoryData = usePaginatedList({
+ fetchFn: (params) => getPatients({ ...params, includes: ['person', 'person-Addresses'] }),
+ entityName: 'patient',
+})
// #endregion
// #region State & Computed
const router = useRouter()
const isConfirmationOpen = ref(false)
+const isActionHistoryOpen = ref(false)
+const isConsultationHistoryOpen = ref(false)
+const isSupportingHistoryOpen = ref(false)
+const isFarmacyHistoryOpen = ref(false)
+const isNationalProgramServiceHistoryOpen = ref(false)
+
+provide(`isActionHistoryOpen`, isActionHistoryOpen)
+provide(`isConsultationHistoryOpen`, isConsultationHistoryOpen)
+provide(`isSupportingHistoryOpen`, isSupportingHistoryOpen)
+provide(`isFarmacyHistoryOpen`, isFarmacyHistoryOpen)
+provide(`isNationalProgramServiceHistoryOpen`, isNationalProgramServiceHistoryOpen)
+
+const defaultDate = {
+ start: new CalendarDate(2022, 1, 20),
+ end: new CalendarDate(2022, 1, 20).add({ days: 20 }),
+}
+
+const actionHistoryDateValue = ref(defaultDate) as Ref
+const consultationHistoryDateValue = ref(defaultDate) as Ref
+const supportingHistoryDateValue = ref(defaultDate) as Ref
+const farmacyHistoryDateValue = ref(defaultDate) as Ref
+const nationalProgramServiceSearch = ref('')
+const nationalProgramServiceSelectedStatus = ref('all')
// #endregion
// #region Lifecycle Hooks
+onMounted(() => {
+
+})
// #endregion
// #region Functions
@@ -86,7 +140,7 @@ async function handleActionClick(eventType: string) {
+ :resume-arrangement-type="personPatientForm?.values.arrangement"/>
+
+
+
+
aaaaaaaaaaaaaaa
+
+
+
+
+
+
+
diff --git a/app/components/content/resume/list.vue b/app/components/content/resume/list.vue
index 5c5e3658..389c830d 100644
--- a/app/components/content/resume/list.vue
+++ b/app/components/content/resume/list.vue
@@ -10,9 +10,12 @@ import { ActionEvents } from '~/components/pub/my-ui/data/types'
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
import SummaryCard from '~/components/pub/my-ui/summary-card/summary-card.vue'
import { usePaginatedList } from '~/composables/usePaginatedList'
+import Action from '~/components/pub/my-ui/nav-footer/ba-dr-su.vue'
import { getPatients, removePatient } from '~/services/patient.service'
import DetailRow from '~/components/pub/my-ui/form/view/detail-row.vue'
+import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
+import Confirmation from '~/components/pub/my-ui/confirmation/confirmation.vue'
// #endregion
@@ -35,6 +38,7 @@ const refSearchNav: RefSearchNav = {
}
const formType = ref<`a` | `b`>(`a`)
+const isVerifyDialogOpen = ref(false)
const isRecordConfirmationOpen = ref(false)
const summaryLoading = ref(false)
@@ -69,23 +73,61 @@ async function getPatientSummary() {
summaryLoading.value = false
}
}
-function handleFormScreening(key: string) {
- switch (key) {
- case 'form-a':
- navigateTo("/screening-mpp/add/a")
- break;
- case 'preview-form-a':
- navigateTo('https://google.com', { external: true, open: { target: '_blank' } });
- break;
- case 'form-b':
- navigateTo("/screening-mpp/add/b")
- break;
- case 'preview-form-b':
- navigateTo('https://google.com', { external: true, open: { target: '_blank' } });
- break;
- default:
- break;
+
+async function handleActionClick(eventType: string) {
+ if (eventType === 'submit') {
+ // const patient: Patient = await composeFormData()
+ // let createdPatientId = 0
+
+ // const response = await handleActionSave(
+ // patient,
+ // () => {},
+ // () => {},
+ // toast,
+ // )
+
+ // const data = (response?.body?.data ?? null) as PatientBase | null
+ // if (!data) return
+ // createdPatientId = data.id
+
+ // If has callback provided redirect to callback with patientData
+ // if (props.callbackUrl) {
+ // await navigateTo(props.callbackUrl + '?patient-id=' + patient.id)
+ // return
+ // }
+
+ // Navigate to patient list or show success message
+ // await navigateTo('/outpatient/encounter')
+ // return
}
+
+ if (eventType === 'back') {
+ isVerifyDialogOpen.value = false
+ }
+}
+
+async function handleConfirmDelete() {
+ try {
+ const result = await removePatient(recId.value)
+ if (result.success) {
+ console.log('Patient deleted successfully')
+ // Refresh the list
+ await fetchData()
+ } else {
+ console.error('Failed to delete patient:', result)
+ // Handle error - show error message to user
+ }
+ } catch (error) {
+ console.error('Error deleting patient:', error)
+ // Handle error - show error message to user
+ }
+}
+
+function handleCancelConfirmation() {
+ // Reset record state when cancelled
+ recId.value = 0
+ recAction.value = ''
+ recItem.value = null
}
// #endregion
@@ -99,26 +141,15 @@ provide('table_data_loader', isLoading)
// #region Watchers
watch([recId, recAction], () => {
switch (recAction.value) {
- case ActionEvents.showDetail:
- navigateTo({
- name: 'outpatient-encounter-id',
- params: { id: recId.value },
- })
+ case ActionEvents.showVerify:
+ isVerifyDialogOpen.value = true
break
-
- case ActionEvents.showEdit:
- // TODO: Handle edit action
- // isFormEntryDialogOpen.value = true
- navigateTo({
- name: 'outpatient-encounter-id-edit',
- params: { id: recId.value },
- })
- break
-
- case ActionEvents.showConfirmDelete:
- // Trigger confirmation modal open
+ case ActionEvents.showValidate:
isRecordConfirmationOpen.value = true
break
+ case ActionEvents.showPrint:
+ navigateTo('https://google.com', {external: true,open: { target: "_blank" },});
+ break
}
})
// #endregion
@@ -126,26 +157,29 @@ watch([recId, recAction], () => {
-
-
-
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/components/pub/my-ui/data/dropdown-action-dvvp.vue b/app/components/pub/my-ui/data/dropdown-action-dvvp.vue
new file mode 100644
index 00000000..00e15096
--- /dev/null
+++ b/app/components/pub/my-ui/data/dropdown-action-dvvp.vue
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/pub/my-ui/data/types.ts b/app/components/pub/my-ui/data/types.ts
index c0d283de..c86e1752 100644
--- a/app/components/pub/my-ui/data/types.ts
+++ b/app/components/pub/my-ui/data/types.ts
@@ -76,6 +76,9 @@ export const ActionEvents = {
showEdit: 'showEdit',
showDetail: 'showDetail',
showProcess: 'showProcess',
+ showVerify: 'showVerify',
+ showValidate: 'showValidate',
+ showPrint: 'showPrint',
}
export interface DataTableLoader {
diff --git a/app/components/pub/my-ui/form/input-base.vue b/app/components/pub/my-ui/form/input-base.vue
index aeb4a4af..c31b2073 100644
--- a/app/components/pub/my-ui/form/input-base.vue
+++ b/app/components/pub/my-ui/form/input-base.vue
@@ -19,6 +19,8 @@ const props = defineProps<{
maxLength?: number
isRequired?: boolean
isDisabled?: boolean
+ rightLabel?: string
+ bottomLabel?: string
}>()
function handleInput(event: Event) {
@@ -61,14 +63,14 @@ function handleInput(event: Event) {
v-slot="{ componentField }"
:name="fieldName"
>
-
+
+ {{ rightLabel }}
+ {{ bottomLabel }}
diff --git a/app/components/pub/my-ui/form/text-area-input.vue b/app/components/pub/my-ui/form/text-area-input.vue
index 7747e727..c7b7c794 100644
--- a/app/components/pub/my-ui/form/text-area-input.vue
+++ b/app/components/pub/my-ui/form/text-area-input.vue
@@ -47,7 +47,7 @@ function handleInput(event: Event) {
().default("krs"),
faskes: z.string({ required_error: 'Faskes harus diisi' }).optional(),
clinic: z.string({ required_error: 'Klinik harus diisi' }).optional(),
deathDate: z.string({ required_error: 'Tanggal harus diisi' }).optional(),
deathCause: z.array(z.string()).optional().default([]),
+ deathCauseDescription: z.string({ required_error: 'Uraian harus diisi' })
+ .min(1, 'Uraian minimum 1 karakter')
+ .max(2048, 'Uraian maksimum 2048 karakter')
+ .optional(),
keterangan: z.string({ required_error: 'Uraian harus diisi' })
.min(1, 'Uraian minimum 1 karakter')
.max(2048, 'Uraian maksimum 2048 karakter')
From b2a512314b397f73ba9f3078960831dd99818526 Mon Sep 17 00:00:00 2001
From: hasyim_kai
Date: Fri, 7 Nov 2025 14:02:54 +0700
Subject: [PATCH 06/35] Feat: UI uplaod doc pendukung
---
.../_common/select-doc-type.vue | 81 ++++++++++++
.../app/document-upload/entry-form.vue | 77 +++++++++++
.../app/document-upload/list.cfg.ts | 39 ++++++
app/components/app/document-upload/list.vue | 31 +++++
.../content/document-upload/add.vue | 122 +++++++++++++++++
.../content/document-upload/edit.vue | 122 +++++++++++++++++
.../content/document-upload/list.vue | 123 ++++++++++++++++++
app/components/content/encounter/process.vue | 3 +-
.../pub/my-ui/nav-footer/ba-dr-su.vue | 6 +-
.../document-upload/[document_id]/edit.vue | 41 ++++++
.../encounter/[id]/document-upload/add.vue | 42 ++++++
app/schemas/document-upload.schema.ts | 13 ++
app/services/control-letter.service.ts | 28 ++++
13 files changed, 725 insertions(+), 3 deletions(-)
create mode 100644 app/components/app/document-upload/_common/select-doc-type.vue
create mode 100644 app/components/app/document-upload/entry-form.vue
create mode 100644 app/components/app/document-upload/list.cfg.ts
create mode 100644 app/components/app/document-upload/list.vue
create mode 100644 app/components/content/document-upload/add.vue
create mode 100644 app/components/content/document-upload/edit.vue
create mode 100644 app/components/content/document-upload/list.vue
create mode 100644 app/pages/(features)/rehab/encounter/[id]/document-upload/[document_id]/edit.vue
create mode 100644 app/pages/(features)/rehab/encounter/[id]/document-upload/add.vue
create mode 100644 app/schemas/document-upload.schema.ts
create mode 100644 app/services/control-letter.service.ts
diff --git a/app/components/app/document-upload/_common/select-doc-type.vue b/app/components/app/document-upload/_common/select-doc-type.vue
new file mode 100644
index 00000000..26b1bb87
--- /dev/null
+++ b/app/components/app/document-upload/_common/select-doc-type.vue
@@ -0,0 +1,81 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/document-upload/entry-form.vue b/app/components/app/document-upload/entry-form.vue
new file mode 100644
index 00000000..7197c02b
--- /dev/null
+++ b/app/components/app/document-upload/entry-form.vue
@@ -0,0 +1,77 @@
+
+
+
+
+
diff --git a/app/components/app/document-upload/list.cfg.ts b/app/components/app/document-upload/list.cfg.ts
new file mode 100644
index 00000000..dbe2a679
--- /dev/null
+++ b/app/components/app/document-upload/list.cfg.ts
@@ -0,0 +1,39 @@
+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-dud.vue'))
+
+export const config: Config = {
+ cols: [{}, {}, {}, {width: 50},],
+
+ headers: [
+ [
+ { label: 'Nama Dokumen' },
+ { label: 'Tipe Dokumen' },
+ { label: 'Petugas Upload' },
+ { label: 'Action' },
+ ],
+ ],
+
+ keys: ['specialist.name', 'subspecialist.name', 'subspecialist.name', 'action'],
+
+ delKeyNames: [
+
+ ],
+
+ parses: {
+ },
+
+ components: {
+ action(rec, idx) {
+ return {
+ idx,
+ rec: rec as object,
+ component: action,
+ }
+ },
+ },
+
+ htmls: {
+ },
+}
diff --git a/app/components/app/document-upload/list.vue b/app/components/app/document-upload/list.vue
new file mode 100644
index 00000000..8274e752
--- /dev/null
+++ b/app/components/app/document-upload/list.vue
@@ -0,0 +1,31 @@
+
+
+
+
+
diff --git a/app/components/content/document-upload/add.vue b/app/components/content/document-upload/add.vue
new file mode 100644
index 00000000..6fbc43f5
--- /dev/null
+++ b/app/components/content/document-upload/add.vue
@@ -0,0 +1,122 @@
+
+
+
+
+
Upload Dokumen
+
+
+
+
+
+
+
+
+
diff --git a/app/components/content/document-upload/edit.vue b/app/components/content/document-upload/edit.vue
new file mode 100644
index 00000000..63f1fc09
--- /dev/null
+++ b/app/components/content/document-upload/edit.vue
@@ -0,0 +1,122 @@
+
+
+
+
+
Upload Dokumen
+
+
+
+
+
+
+
+
+
diff --git a/app/components/content/document-upload/list.vue b/app/components/content/document-upload/list.vue
new file mode 100644
index 00000000..c69ac96b
--- /dev/null
+++ b/app/components/content/document-upload/list.vue
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+ ID:
+ {{ record?.id }}
+
+
+ Nama:
+ {{ record.firstName }}
+
+
+ Kode:
+ {{ record.cellphone }}
+
+
+
+
+
diff --git a/app/components/content/encounter/process.vue b/app/components/content/encounter/process.vue
index ad93387d..7d178303 100644
--- a/app/components/content/encounter/process.vue
+++ b/app/components/content/encounter/process.vue
@@ -16,6 +16,7 @@ import EarlyMedicalAssesmentList from '~/components/content/soapi/entry.vue'
import EarlyMedicalRehabList from '~/components/content/soapi/entry.vue'
import PrescriptionList from '~/components/content/prescription/list.vue'
import Consultation from '~/components/content/consultation/list.vue'
+import DocUploadList from '~/components/content/document-upload/list.vue'
const route = useRoute()
const router = useRouter()
@@ -72,7 +73,7 @@ const tabs: TabItem[] = [
{ value: 'resume', label: 'Resume' },
{ value: 'control', label: 'Surat Kontrol' },
{ value: 'screening', label: 'Skrinning MPP' },
- { value: 'supporting-document', label: 'Upload Dokumen Pendukung' },
+ { value: 'supporting-document', label: 'Upload Dokumen Pendukung', component: DocUploadList, props: { encounter: data } },
]
diff --git a/app/components/pub/my-ui/nav-footer/ba-dr-su.vue b/app/components/pub/my-ui/nav-footer/ba-dr-su.vue
index 4598817b..427eab0f 100644
--- a/app/components/pub/my-ui/nav-footer/ba-dr-su.vue
+++ b/app/components/pub/my-ui/nav-footer/ba-dr-su.vue
@@ -1,10 +1,12 @@
+
+
+
+
diff --git a/app/pages/(features)/rehab/encounter/[id]/document-upload/add.vue b/app/pages/(features)/rehab/encounter/[id]/document-upload/add.vue
new file mode 100644
index 00000000..94805d12
--- /dev/null
+++ b/app/pages/(features)/rehab/encounter/[id]/document-upload/add.vue
@@ -0,0 +1,42 @@
+
+
+
+
+
diff --git a/app/schemas/document-upload.schema.ts b/app/schemas/document-upload.schema.ts
new file mode 100644
index 00000000..ffd56e36
--- /dev/null
+++ b/app/schemas/document-upload.schema.ts
@@ -0,0 +1,13 @@
+import { z } from 'zod'
+
+const DocumentUploadSchema = z.object({
+ officer: z.string({ required_error: 'Mohon isi', }),
+ doc_name: z.number({ required_error: 'Mohon isi', }),
+ doc_type: z.number({ required_error: 'Mohon isi', }),
+ file: z.number({ required_error: 'Mohon isi', }),
+})
+
+type DocumentUploadFormData = z.infer
+
+export { DocumentUploadSchema }
+export type { DocumentUploadFormData }
diff --git a/app/services/control-letter.service.ts b/app/services/control-letter.service.ts
new file mode 100644
index 00000000..29b3722b
--- /dev/null
+++ b/app/services/control-letter.service.ts
@@ -0,0 +1,28 @@
+// Base
+import * as base from './_crud-base'
+
+// Constants
+import { encounterClassCodes } from '~/lib/constants'
+
+const path = '/api/v1/control-letter'
+const name = 'control-letter'
+
+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
From e62ee1b37e8b37f03ea8cd873263765544ff7c8a Mon Sep 17 00:00:00 2001
From: Abizrh
Date: Tue, 11 Nov 2025 08:57:49 +0700
Subject: [PATCH 07/35] =?UTF-8?q?=E2=9C=A8=20feat=20(encounter):=20impleme?=
=?UTF-8?q?nt=20general=20consent=20feature?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/components/app/general-consent/entry.vue | 241 ++++++++++++++++++
.../app/general-consent/list.cfg.ts | 57 +++++
app/components/app/general-consent/list.vue | 34 +++
app/components/content/encounter/process.vue | 3 +-
.../content/general-consent/entry.vue | 36 +++
.../content/general-consent/form.vue | 181 +++++++++++++
.../content/general-consent/list.vue | 187 ++++++++++++++
app/models/general-consent.ts | 47 ++++
app/schemas/general-consent.schema.ts | 13 +
9 files changed, 798 insertions(+), 1 deletion(-)
create mode 100644 app/components/app/general-consent/entry.vue
create mode 100644 app/components/app/general-consent/list.cfg.ts
create mode 100644 app/components/app/general-consent/list.vue
create mode 100644 app/components/content/general-consent/entry.vue
create mode 100644 app/components/content/general-consent/form.vue
create mode 100644 app/components/content/general-consent/list.vue
create mode 100644 app/models/general-consent.ts
create mode 100644 app/schemas/general-consent.schema.ts
diff --git a/app/components/app/general-consent/entry.vue b/app/components/app/general-consent/entry.vue
new file mode 100644
index 00000000..8d9c8867
--- /dev/null
+++ b/app/components/app/general-consent/entry.vue
@@ -0,0 +1,241 @@
+
+
+
+
+
diff --git a/app/components/app/general-consent/list.cfg.ts b/app/components/app/general-consent/list.cfg.ts
new file mode 100644
index 00000000..3e634d44
--- /dev/null
+++ b/app/components/app/general-consent/list.cfg.ts
@@ -0,0 +1,57 @@
+import type { Config, RecComponent, RecStrFuncComponent, RecStrFuncUnknown } from '~/components/pub/my-ui/data-table'
+import { defineAsyncComponent } from 'vue'
+import type { GeneralConsent } from '~/models/general-consent'
+
+type SmallDetailDto = any
+
+const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-ud.vue'))
+export const config: Config = {
+ cols: [{ width: 100 }, {}, {}, {}, { width: 50 }],
+ headers: [
+ [
+ { label: 'Tanggal' },
+ { label: 'Anggota Keluarga' },
+ { label: 'Penanggung Jawab' },
+ { label: 'Pemberi Informasi' },
+ { label: 'Saksi 1' },
+ { label: 'Saksi 2' },
+ { label: '' },
+ ],
+ ],
+ keys: ['date', 'dstUnit.name', 'dstDoctor.name', 'responsible', 'problem', 'solution', 'action'],
+ delKeyNames: [
+ { key: 'data', label: 'Tanggal' },
+ { key: 'dstDoctor.name', label: 'Dokter' },
+ ],
+ parses: {
+ action(rec, idx) {
+ const res: RecComponent = {
+ idx,
+ rec: rec as object,
+ component: action,
+ props: {
+ size: 'sm',
+ },
+ }
+ return res
+ },
+ date(rec) {
+ const recX = rec as GeneralConsent
+ return recX.date?.substring(0, 10) || '-'
+ },
+ },
+ components: {
+ action(rec, idx) {
+ const res: RecComponent = {
+ idx,
+ rec: rec as object,
+ component: action,
+ props: {
+ size: 'sm',
+ },
+ }
+ return res
+ },
+ } as RecStrFuncComponent,
+ htmls: {} as RecStrFuncUnknown,
+}
diff --git a/app/components/app/general-consent/list.vue b/app/components/app/general-consent/list.vue
new file mode 100644
index 00000000..46f595f5
--- /dev/null
+++ b/app/components/app/general-consent/list.vue
@@ -0,0 +1,34 @@
+
+
+
+
+
diff --git a/app/components/content/encounter/process.vue b/app/components/content/encounter/process.vue
index ad93387d..aba72c94 100644
--- a/app/components/content/encounter/process.vue
+++ b/app/components/content/encounter/process.vue
@@ -16,6 +16,7 @@ import EarlyMedicalAssesmentList from '~/components/content/soapi/entry.vue'
import EarlyMedicalRehabList from '~/components/content/soapi/entry.vue'
import PrescriptionList from '~/components/content/prescription/list.vue'
import Consultation from '~/components/content/consultation/list.vue'
+import GeneralConsentList from '~/components/content/general-consent/entry.vue'
const route = useRoute()
const router = useRouter()
@@ -58,7 +59,7 @@ const tabs: TabItem[] = [
},
{ value: 'therapy-protocol', label: 'Protokol Terapi' },
{ value: 'education-assessment', label: 'Asesmen Kebutuhan Edukasi' },
- { value: 'consent', label: 'General Consent' },
+ { value: 'consent', label: 'General Consent', component: GeneralConsentList, props: { encounter: data } },
{ value: 'patient-note', label: 'CPRJ' },
{ value: 'prescription', label: 'Order Obat', component: PrescriptionList },
{ value: 'device', label: 'Order Alkes' },
diff --git a/app/components/content/general-consent/entry.vue b/app/components/content/general-consent/entry.vue
new file mode 100644
index 00000000..5769e967
--- /dev/null
+++ b/app/components/content/general-consent/entry.vue
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
diff --git a/app/components/content/general-consent/form.vue b/app/components/content/general-consent/form.vue
new file mode 100644
index 00000000..146586ea
--- /dev/null
+++ b/app/components/content/general-consent/form.vue
@@ -0,0 +1,181 @@
+
+
+
+
+
+
+
+
diff --git a/app/components/content/general-consent/list.vue b/app/components/content/general-consent/list.vue
new file mode 100644
index 00000000..f7f53972
--- /dev/null
+++ b/app/components/content/general-consent/list.vue
@@ -0,0 +1,187 @@
+
+
+
+
+
+
+
+
+ handleActionRemove(recId, getMyList, toast)"
+ @cancel=""
+ >
+
+
+
+ ID:
+ {{ record?.id }}
+
+
+ Nama:
+ {{ record.name }}
+
+
+ Kode:
+ {{ record.code }}
+
+
+
+
+
diff --git a/app/models/general-consent.ts b/app/models/general-consent.ts
new file mode 100644
index 00000000..c12df7ca
--- /dev/null
+++ b/app/models/general-consent.ts
@@ -0,0 +1,47 @@
+export interface GeneralConsent {
+ id: number
+ encounter_id: number
+ date?: string
+ unit_id: number
+ doctor_id?: number
+ problem: string
+ solution?: string
+ repliedAt?: string
+}
+
+export interface CreateDto {
+ encounter_id: number
+ date: string
+ problem: string
+ dstUnit_id: number
+}
+
+export interface UpdateDto {
+ id: number
+ problem: string
+ unit_id: number
+}
+
+export interface DeleteDto {
+ id: number
+}
+
+export function genCreateDto(): CreateDto {
+ return {
+ encounter_id: 0,
+ problem: '',
+ unit_id: 0,
+ }
+}
+
+export function genConsultation(): GeneralConsent {
+ return {
+ id: 0,
+ encounter_id: 0,
+ unit_id: 0,
+ doctor_id: 0,
+ problem: '',
+ solution: '',
+ repliedAt: '',
+ }
+}
diff --git a/app/schemas/general-consent.schema.ts b/app/schemas/general-consent.schema.ts
new file mode 100644
index 00000000..8aa61fe7
--- /dev/null
+++ b/app/schemas/general-consent.schema.ts
@@ -0,0 +1,13 @@
+import { z } from 'zod'
+import type { CreateDto } from '~/models/general-consent'
+
+const GeneralConsentSchema = z.object({
+ date: z.string({ required_error: 'Tanggal harus diisi' }),
+ dstUnit_id: z.number({ required_error: 'Unit harus diisi' }),
+ problem: z.string({ required_error: 'Uraian harus diisi' }).min(20, 'Uraian minimum 20 karakter'),
+})
+
+type GeneralConsentFormData = z.infer & CreateDto
+
+export { GeneralConsentSchema }
+export type { GeneralConsentFormData }
From 16626a2feeb158319d2e8a5c4e6c01c8035640c7 Mon Sep 17 00:00:00 2001
From: Andrian Roshandy
Date: Thu, 13 Nov 2025 11:49:28 +0700
Subject: [PATCH 08/35] feat/prescription: added submit
---
app/components/app/prescription/list.vue | 1 -
app/components/content/prescription/list.vue | 39 ++++++++++++++++---
.../confirmation/record-confirmation.vue | 5 ++-
app/handlers/prescription.handler.ts | 2 +-
app/services/prescription.service.ts | 14 +++++++
5 files changed, 51 insertions(+), 10 deletions(-)
diff --git a/app/components/app/prescription/list.vue b/app/components/app/prescription/list.vue
index ae5126ca..fbff7b10 100644
--- a/app/components/app/prescription/list.vue
+++ b/app/components/app/prescription/list.vue
@@ -5,7 +5,6 @@ import Nav from '~/components/pub/my-ui/nav-footer/ca-ed-su.vue'
import type { Prescription } from '~/models/prescription';
import PrescriptionItem from '~/components/app/prescription-item/list.vue';
-import { add } from 'date-fns';
interface Props {
data: Prescription[]
diff --git a/app/components/content/prescription/list.vue b/app/components/content/prescription/list.vue
index 844cb04f..68e2069f 100644
--- a/app/components/content/prescription/list.vue
+++ b/app/components/content/prescription/list.vue
@@ -22,6 +22,8 @@ import {
import { getList, getDetail } from '~/services/prescription.service'
import List from '~/components/app/prescription/list.vue'
import type { Prescription } from '~/models/prescription'
+import { submit } from '~/services/prescription.service'
+import type { ToastFn } from '~/handlers/_handler'
const props = defineProps<{
encounter_id: number
@@ -31,6 +33,7 @@ const route = useRoute()
const { setQueryParams } = useQueryParam()
const title = ref('')
+const isSubmitConfirmationOpen = ref(false)
const plainEid = route.params.id
const encounter_id = (plainEid && typeof plainEid == 'string') ? parseInt(plainEid) : 0
@@ -125,13 +128,13 @@ watch([isFormEntryDialogOpen], async () => {
}
})
-function cancel(data: Prescription) {
+function confirmCancel(data: Prescription) {
recId.value = data.id
recItem.value = data
isRecordConfirmationOpen.value = true
}
-function edit(data: Prescription) {
+function goToEdit(data: Prescription) {
setQueryParams({
'mode': 'entry',
'id': data.id.toString()
@@ -139,9 +142,21 @@ function edit(data: Prescription) {
recItem.value = data
}
-function submit(data: Prescription) {
+function confirmSubmit(data: Prescription) {
+ recId.value = data.id
+ recItem.value = data
+ isSubmitConfirmationOpen.value = true
}
+async function handleActionSubmit(id: number, refresh: () => void, toast: ToastFn) {
+ const result = await submit(id)
+ if (result.success) {
+ toast({ title: 'Berhasil', description: 'Resep telah di ajukan', variant: 'default' })
+ setTimeout(refresh, 300)
+ } else {
+ toast({ title: 'Gagal', description: 'Gagal menjalankan perintah', variant: 'destructive' })
+ }
+}
@@ -150,9 +165,9 @@ function submit(data: Prescription) {
v-if="!isLoading.dataListLoading"
:data="data"
:pagination-meta="paginationMeta"
- @cancel="cancel"
- @edit="edit"
- @submit="submit"
+ @cancel="confirmCancel"
+ @edit="goToEdit"
+ @submit="confirmSubmit"
/>
+
+ handleActionSubmit(recId, getMyList, toast)"
+ @cancel=""
+ >
+
diff --git a/app/components/pub/my-ui/confirmation/record-confirmation.vue b/app/components/pub/my-ui/confirmation/record-confirmation.vue
index cff54b2b..b241b2c4 100644
--- a/app/components/pub/my-ui/confirmation/record-confirmation.vue
+++ b/app/components/pub/my-ui/confirmation/record-confirmation.vue
@@ -119,8 +119,9 @@ function handleCancel() {
diff --git a/app/handlers/prescription.handler.ts b/app/handlers/prescription.handler.ts
index 62e1861e..10bea176 100644
--- a/app/handlers/prescription.handler.ts
+++ b/app/handlers/prescription.handler.ts
@@ -1,4 +1,4 @@
-import { createCrudHandler, genCrudHandler } from '~/handlers/_handler'
+import { genCrudHandler } from '~/handlers/_handler'
import { create, update, remove } from '~/services/prescription.service'
export const {
diff --git a/app/services/prescription.service.ts b/app/services/prescription.service.ts
index 150357ab..7bdc9f51 100644
--- a/app/services/prescription.service.ts
+++ b/app/services/prescription.service.ts
@@ -1,4 +1,5 @@
import * as base from './_crud-base'
+import { xfetch } from '~/composables/useXfetch'
const path = '/api/v1/prescription'
const name = 'prescription'
@@ -22,3 +23,16 @@ export function update(id: number | string, data: any) {
export function remove(id: number | string) {
return base.remove(path, id)
}
+
+export async function submit(id: number) {
+ try {
+ const resp = await xfetch(`${path}/${id}/submit`, 'PATCH')
+ const result: any = {}
+ result.success = resp.success
+ result.body = (resp.body as Record) || {}
+ return result
+ } catch (error) {
+ console.error(`Error submitting ${name}:`, error)
+ throw new Error(`Failed to submit ${name}`)
+ }
+}
From 56109564cb3c473172a86de167b7cce816a36973 Mon Sep 17 00:00:00 2001
From: hasyim_kai
Date: Thu, 13 Nov 2025 16:16:26 +0700
Subject: [PATCH 09/35] Feat: API Integration supporting doc upload
---
.../_common/select-doc-type.vue | 14 +---
.../app/document-upload/entry-form.vue | 10 +--
.../app/document-upload/list.cfg.ts | 4 +-
app/components/app/document-upload/list.vue | 6 +-
.../content/document-upload/add.vue | 46 ++++++-----
.../content/document-upload/edit.vue | 54 ++++++++-----
.../content/document-upload/list.vue | 27 ++++---
app/components/content/encounter/process.vue | 19 +++--
.../pub/my-ui/data/dropdown-action-dd.vue | 80 +++++++++++++++++++
app/components/pub/my-ui/form/file-field.vue | 2 +-
app/handlers/supporting-document.handler.ts | 24 ++++++
app/lib/constants.ts | 38 +++++++++
app/lib/utils.ts | 48 +++++++++++
app/models/encounter-document.ts | 29 +++++++
app/models/encounter.ts | 5 +-
.../rehab/encounter/[id]/process.vue | 14 ++--
.../(features)/rehab/encounter/index.vue | 8 +-
app/schemas/document-upload.schema.ts | 19 ++++-
app/services/supporting-document.service.ts | 55 +++++++++++++
19 files changed, 401 insertions(+), 101 deletions(-)
create mode 100644 app/components/pub/my-ui/data/dropdown-action-dd.vue
create mode 100644 app/handlers/supporting-document.handler.ts
create mode 100644 app/models/encounter-document.ts
create mode 100644 app/services/supporting-document.service.ts
diff --git a/app/components/app/document-upload/_common/select-doc-type.vue b/app/components/app/document-upload/_common/select-doc-type.vue
index 26b1bb87..0e86f596 100644
--- a/app/components/app/document-upload/_common/select-doc-type.vue
+++ b/app/components/app/document-upload/_common/select-doc-type.vue
@@ -2,7 +2,7 @@
import type { FormErrors } from '~/types/error'
import Combobox from '~/components/pub/my-ui/combobox/combobox.vue'
import { cn, mapToComboboxOptList } from '~/lib/utils'
-import { occupationCodes } from '~/lib/constants'
+import { supportingDocTypeCode, supportingDocOpt, type supportingDocTypeCodeKey } from '~/lib/constants'
import { getValueLabelList as getDoctorLabelList } from '~/services/doctor.service'
import { getValueLabelList as getUnitLabelList } from '~/services/unit.service'
@@ -31,16 +31,6 @@ const {
labelClass,
} = props
-const docTypeOpts : Item[] = [
- {
- label: 'Surat Keterangan Sehat',
- value: 'sksehat',
- },
- {
- label: 'Surat Keterangan Sakit',
- value: 'sksakit',
- },
-]
@@ -67,7 +57,7 @@ const docTypeOpts : Item[] = [
class="focus:ring-0 focus:ring-offset-0"
:id="fieldName"
v-bind="componentField"
- :items="docTypeOpts"
+ :items="supportingDocOpt"
:placeholder="placeholder"
search-placeholder="Cari..."
empty-message="Data tidak ditemukan"
diff --git a/app/components/app/document-upload/entry-form.vue b/app/components/app/document-upload/entry-form.vue
index 7197c02b..f97a5161 100644
--- a/app/components/app/document-upload/entry-form.vue
+++ b/app/components/app/document-upload/entry-form.vue
@@ -12,10 +12,6 @@ const props = defineProps<{
schema: any
initialValues?: any
errors?: FormErrors
-
- selectedUnitId?: number | null
- selectedSpecialistId?: number | null
- selectedSubSpecialistId?: number | null
}>()
const formSchema = toTypedSchema(props.schema)
@@ -51,19 +47,19 @@ defineExpose({
import('~/components/pub/my-ui/data/dropdown-action-dud.vue'))
+const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dd.vue'))
export const config: Config = {
cols: [{}, {}, {}, {width: 50},],
@@ -15,7 +15,7 @@ export const config: Config = {
],
],
- keys: ['specialist.name', 'subspecialist.name', 'subspecialist.name', 'action'],
+ keys: ['fileName', 'type_code', 'employee.name', 'action'],
delKeyNames: [
diff --git a/app/components/app/document-upload/list.vue b/app/components/app/document-upload/list.vue
index 8274e752..dde32820 100644
--- a/app/components/app/document-upload/list.vue
+++ b/app/components/app/document-upload/list.vue
@@ -5,7 +5,7 @@ import { config } from './list.cfg'
interface Props {
data: any[]
- paginationMeta: PaginationMeta
+ // paginationMeta: PaginationMeta
}
defineProps()
@@ -24,8 +24,8 @@ function handlePageChange(page: number) {
-
+
+
diff --git a/app/components/content/document-upload/add.vue b/app/components/content/document-upload/add.vue
index 6fbc43f5..5ee3d862 100644
--- a/app/components/content/document-upload/add.vue
+++ b/app/components/content/document-upload/add.vue
@@ -2,10 +2,12 @@
import { useRouter } from 'vue-router'
import type { ExposedForm } from '~/types/form'
import Action from '~/components/pub/my-ui/nav-footer/ba-dr-su.vue'
-import { handleActionSave,} from '~/handlers/patient.handler'
+import { handleActionSave,} from '~/handlers/supporting-document.handler'
import { toast } from '~/components/pub/ui/toast'
import Confirmation from '~/components/pub/my-ui/confirmation/confirmation.vue'
import { DocumentUploadSchema } from '~/schemas/document-upload.schema'
+import { uploadAttachment } from '~/services/supporting-document.service'
+import { printFormData, toFormData } from '~/lib/utils'
// #region Props & Emits
const props = defineProps<{
@@ -16,11 +18,15 @@ const props = defineProps<{
const route = useRoute()
const encounterId = typeof route.params.id == 'string' ? parseInt(route.params.id) : 0
const inputForm = ref | null>(null)
+const { user } = useUserStore()
// #endregion
// #region State & Computed
const router = useRouter()
const isConfirmationOpen = ref(false)
+const initialValues = {
+ officer: user.user_name,
+}
// #endregion
// #region Lifecycle Hooks
@@ -31,42 +37,42 @@ function goBack() {
router.go(-1)
}
+
async function handleConfirmAdd() {
- const controlLetter = await composeFormData()
- let createdControlLetterId = 0
-
- const response = await handleActionSave(
- controlLetter,
- () => { },
- () => { },
- toast,
- )
+ const inputData = await composeFormData()
+ const inputFormData: FormData = toFormData(inputData)
+ const response = await handleActionSave(inputFormData, () => { }, () => { }, toast, )
const data = (response?.body?.data ?? null)
if (!data) return
- createdControlLetterId = data.id
// // If has callback provided redirect to callback with patientData
if (props.callbackUrl) {
- navigateTo(props.callbackUrl + '?control-letter-id=' + controlLetter.id)
+ navigateTo(props.callbackUrl + '?control-letter-id=' + inputData.id)
}
-
goBack()
}
async function composeFormData(): Promise {
- const [controlLetter,] = await Promise.all([
+ inputForm.value?.setValues({
+ ...inputForm.value?.values,
+ ref_id: encounterId,
+ upload_employee_id: user.user_id
+ })
+
+ const [inputFormState,] = await Promise.all([
inputForm.value?.validate(),
])
- const results = [controlLetter]
+ const results = [inputFormState]
const allValid = results.every((r) => r?.valid)
// exit, if form errors happend during validation
- if (!allValid) return Promise.reject('Form validation failed')
-
- const formData = controlLetter?.values
- formData.encounter_id = encounterId
+ if (!allValid) {
+ toast({ title: 'Form validation failed', variant: 'destructive',})
+ return Promise.reject('Form validation failed')
+ }
+ const formData = inputFormState?.values
return new Promise((resolve) => resolve(formData))
}
// #endregion region
@@ -82,7 +88,6 @@ async function handleActionClick(eventType: string) {
await navigateTo(props.callbackUrl)
return
}
-
goBack()
}
}
@@ -103,6 +108,7 @@ function handleCancelAdd() {
diff --git a/app/components/content/document-upload/edit.vue b/app/components/content/document-upload/edit.vue
index 63f1fc09..c4033fb2 100644
--- a/app/components/content/document-upload/edit.vue
+++ b/app/components/content/document-upload/edit.vue
@@ -2,10 +2,11 @@
import { useRouter } from 'vue-router'
import type { ExposedForm } from '~/types/form'
import Action from '~/components/pub/my-ui/nav-footer/ba-dr-su.vue'
-import { handleActionSave,} from '~/handlers/patient.handler'
+import { handleActionSave,} from '~/handlers/supporting-document.handler'
import { toast } from '~/components/pub/ui/toast'
import Confirmation from '~/components/pub/my-ui/confirmation/confirmation.vue'
import { DocumentUploadSchema } from '~/schemas/document-upload.schema'
+import { getDetail } from '~/services/supporting-document.service'
// #region Props & Emits
const props = defineProps<{
@@ -15,15 +16,26 @@ const props = defineProps<{
// form related state
const route = useRoute()
const encounterId = typeof route.params.id == 'string' ? parseInt(route.params.id) : 0
+const docId = typeof route.params.document_id == 'string' ? parseInt(route.params.document_id) : 0
const inputForm = ref
| null>(null)
// #endregion
// #region State & Computed
const router = useRouter()
const isConfirmationOpen = ref(false)
+const { user } = useUserStore()
+const initialValues = {
+ officer: user.user_name,
+}
// #endregion
// #region Lifecycle Hooks
+onMounted(async () => {
+ const result = await getDetail(docId)
+ if (result.success) {
+ inputForm.value?.setValues(result.body.data)
+ }
+})
// #endregion
// #region Functions
@@ -32,40 +44,39 @@ function goBack() {
}
async function handleConfirmAdd() {
- const controlLetter = await composeFormData()
- let createdControlLetterId = 0
+ const inputData = await composeFormData()
+ let createdDataId = 0
- const response = await handleActionSave(
- controlLetter,
- () => { },
- () => { },
- toast,
- )
+ // const response = await handleActionSave(
+ // inputData,
+ // () => { },
+ // () => { },
+ // toast,
+ // )
- const data = (response?.body?.data ?? null)
- if (!data) return
- createdControlLetterId = data.id
+ // const data = (response?.body?.data ?? null)
+ // if (!data) return
+ // createdDataId = data.id
- // // If has callback provided redirect to callback with patientData
- if (props.callbackUrl) {
- navigateTo(props.callbackUrl + '?control-letter-id=' + controlLetter.id)
- }
-
- goBack()
+ // // // If has callback provided redirect to callback with patientData
+ // if (props.callbackUrl) {
+ // navigateTo(props.callbackUrl + '?control-letter-id=' + inputData.id)
+ // }
+ // goBack()
}
async function composeFormData(): Promise {
- const [controlLetter,] = await Promise.all([
+ const [inputFormState,] = await Promise.all([
inputForm.value?.validate(),
])
- const results = [controlLetter]
+ const results = [inputFormState]
const allValid = results.every((r) => r?.valid)
// exit, if form errors happend during validation
if (!allValid) return Promise.reject('Form validation failed')
- const formData = controlLetter?.values
+ const formData = inputFormState?.values
formData.encounter_id = encounterId
return new Promise((resolve) => resolve(formData))
}
@@ -103,6 +114,7 @@ function handleCancelAdd() {
diff --git a/app/components/content/document-upload/list.vue b/app/components/content/document-upload/list.vue
index c69ac96b..94f9dd9f 100644
--- a/app/components/content/document-upload/list.vue
+++ b/app/components/content/document-upload/list.vue
@@ -4,28 +4,31 @@ import { ActionEvents } from '~/components/pub/my-ui/data/types'
import type { HeaderPrep, } from '~/components/pub/my-ui/data/types'
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
import { usePaginatedList } from '~/composables/usePaginatedList'
-import { getList, remove } from '~/services/control-letter.service'
+import { getList, remove } from '~/services/supporting-document.service'
import { toast } from '~/components/pub/ui/toast'
import type { Encounter } from '~/models/encounter'
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
+import { genEncounterDocument } from '~/models/encounter-document'
// #endregion
// #region State
const props = defineProps<{
encounter?: Encounter
+ refresh: () => void
}>()
+
const route = useRoute()
const encounterId = typeof route.params.id == 'string' ? parseInt(route.params.id) : 0
-const { data, isLoading, paginationMeta, searchInput, handlePageChange, handleSearch, fetchData } = usePaginatedList({
- fetchFn: (params) => getList({ ...params, includes: 'specialist,subspecialist,doctor-employee-person', }),
- entityName: 'control-letter',
+const dummy = computed(() => {
+ return props.encounter?.encounterDocuments || []
})
const isRecordConfirmationOpen = ref(false)
const recId = ref
(0)
const recAction = ref('')
const recItem = ref(null)
+const timestamp = ref(0)
const headerPrep: HeaderPrep = {
title: "Upload Dokumen",
@@ -53,7 +56,7 @@ async function handleConfirmDelete(record: any, action: string) {
const result = await remove(record.id)
if (result.success) {
toast({ title: 'Berhasil', description: 'Data berhasil dihapus', variant: 'default' })
- await fetchData()
+ props.refresh()
} else {
toast({ title: 'Gagal', description: `Data gagal dihapus`, variant: 'destructive' })
}
@@ -63,6 +66,7 @@ async function handleConfirmDelete(record: any, action: string) {
}
}
+
function handleCancelConfirmation() {
// Reset record state when cancelled
recId.value = 0
@@ -75,13 +79,14 @@ function handleCancelConfirmation() {
provide('rec_id', recId)
provide('rec_action', recAction)
provide('rec_item', recItem)
+provide('timestamp', timestamp)
// #endregion
// #region Watchers
-watch([recId, recAction], () => {
+watch([recId, recAction, timestamp], () => {
switch (recAction.value) {
case ActionEvents.showDetail:
- navigateTo("https://google.com", { external: true, open: { target: '_blank' } })
+ navigateTo(recItem.value.filePath, { external: true, open: { target: '_blank' } })
break
case ActionEvents.showEdit:
navigateTo({
@@ -99,7 +104,7 @@ watch([recId, recAction], () => {
-
+
@@ -111,11 +116,7 @@ watch([recId, recAction], () => {
Nama:
- {{ record.firstName }}
-
-
- Kode:
- {{ record.cellphone }}
+ {{ record.name }}
diff --git a/app/components/content/encounter/process.vue b/app/components/content/encounter/process.vue
index 7d178303..1f9a37a1 100644
--- a/app/components/content/encounter/process.vue
+++ b/app/components/content/encounter/process.vue
@@ -17,6 +17,7 @@ import EarlyMedicalRehabList from '~/components/content/soapi/entry.vue'
import PrescriptionList from '~/components/content/prescription/list.vue'
import Consultation from '~/components/content/consultation/list.vue'
import DocUploadList from '~/components/content/document-upload/list.vue'
+import { genEncounter } from '~/models/encounter'
const route = useRoute()
const router = useRouter()
@@ -30,12 +31,18 @@ const activeTab = computed({
})
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 data = ref(genEncounter())
+
+async function fetchDetail() {
+ const res = await getDetail(id, {
+ includes: 'patient,patient-person,patient-person-addresses,unit,Appointment_Doctor,Appointment_Doctor-employee,Appointment_Doctor-employee-person,EncounterDocuments',
+ })
+ if(res.body?.data) data.value = res.body?.data
+}
+
+onMounted(() => {
+ fetchDetail()
})
-const dataResBody = dataRes.body ?? null
-const data = dataResBody?.data ?? null
const tabs: TabItem[] = [
{ value: 'status', label: 'Status Masuk/Keluar', component: Status, props: { encounter: data } },
@@ -73,7 +80,7 @@ const tabs: TabItem[] = [
{ value: 'resume', label: 'Resume' },
{ value: 'control', label: 'Surat Kontrol' },
{ value: 'screening', label: 'Skrinning MPP' },
- { value: 'supporting-document', label: 'Upload Dokumen Pendukung', component: DocUploadList, props: { encounter: data } },
+ { value: 'supporting-document', label: 'Upload Dokumen Pendukung', component: DocUploadList, props: { encounter: data, }, },
]
diff --git a/app/components/pub/my-ui/data/dropdown-action-dd.vue b/app/components/pub/my-ui/data/dropdown-action-dd.vue
new file mode 100644
index 00000000..a6a99c9a
--- /dev/null
+++ b/app/components/pub/my-ui/data/dropdown-action-dd.vue
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/pub/my-ui/form/file-field.vue b/app/components/pub/my-ui/form/file-field.vue
index bc6a86c9..31885a6f 100644
--- a/app/components/pub/my-ui/form/file-field.vue
+++ b/app/components/pub/my-ui/form/file-field.vue
@@ -62,7 +62,7 @@ async function onFileChange(event: Event, handleChange: (value: any) => void) {
@change="onFileChange($event, handleChange)"
type="file"
:disabled="isDisabled"
- v-bind="componentField"
+ v-bind="{ onBlur: componentField.onBlur }"
:placeholder="placeholder"
:class="cn('focus:border-primary focus:ring-2 focus:ring-primary focus:ring-offset-0')"
/>
diff --git a/app/handlers/supporting-document.handler.ts b/app/handlers/supporting-document.handler.ts
new file mode 100644
index 00000000..70b29612
--- /dev/null
+++ b/app/handlers/supporting-document.handler.ts
@@ -0,0 +1,24 @@
+// Handlers
+import { genCrudHandler } from '~/handlers/_handler'
+
+// Services
+import { create, update, remove } from '~/services/supporting-document.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 3a52b22e..f684594e 100644
--- a/app/lib/constants.ts
+++ b/app/lib/constants.ts
@@ -383,3 +383,41 @@ export const medicalActionTypeCode: Record = {
} as const
export type medicalActionTypeCodeKey = keyof typeof medicalActionTypeCode
+
+export const encounterDocTypeCode: Record = {
+ "person-resident-number": 'person-resident-number',
+ "person-driving-license": 'person-driving-license',
+ "person-passport": 'person-passport',
+ "person-family-card": 'person-family-card',
+ "mcu-item-result": 'mcu-item-result',
+ "vclaim-sep": 'vclaim-sep',
+ "vclaim-sipp": 'vclaim-sipp',
+} as const
+export type encounterDocTypeCodeKey = keyof typeof encounterDocTypeCode
+export const encounterDocOpt: { label: string; value: encounterDocTypeCodeKey }[] = [
+ { label: 'KTP', value: 'person-resident-number' },
+ { label: 'SIM', value: 'person-driving-license' },
+ { label: 'Passport', value: 'person-passport' },
+ { label: 'Kartu Keluarga', value: 'person-family-card' },
+ { label: 'Hasil MCU', value: 'mcu-item-result' },
+ { label: 'Klaim SEP', value: 'vclaim-sep' },
+ { label: 'Klaim SIPP', value: 'vclaim-sipp' },
+]
+
+
+export const supportingDocTypeCode = {
+ "encounter-patient": 'encounter-patient',
+ "encounter-suport": 'encounter-suport',
+ "encounter-other": 'encounter-other',
+} as const
+export const supportingDocTypeLabel = {
+ "encounter-patient": 'Data Pasien',
+ "encounter-suport": 'Data Penunjang',
+ "encounter-other": 'Lain - Lain',
+} as const
+export type supportingDocTypeCodeKey = keyof typeof supportingDocTypeCode
+export const supportingDocOpt = [
+ { label: 'Data Pasien', value: 'encounter-patient' },
+ { label: 'Data Penunjang', value: 'encounter-suport' },
+ { label: 'Lain - Lain', value: 'encounter-other' },
+]
diff --git a/app/lib/utils.ts b/app/lib/utils.ts
index 357d8700..9c0aada8 100644
--- a/app/lib/utils.ts
+++ b/app/lib/utils.ts
@@ -104,3 +104,51 @@ export function calculateAge(birthDate: Date | string | null | undefined): strin
return `${years} tahun ${months} bulan`
}
}
+
+
+/**
+ * Converts a plain JavaScript object (including File objects) into a FormData instance.
+ * @param {object} data - The object to convert (e.g., form values).
+ * @returns {FormData} The new FormData object suitable for API submission.
+ */
+export function toFormData(data: Record): FormData {
+ const formData = new FormData();
+
+ for (const key in data) {
+ if (Object.prototype.hasOwnProperty.call(data, key)) {
+ const value = data[key];
+
+ // Handle File objects, Blobs, or standard JSON values
+ if (value !== null && value !== undefined) {
+ // Check if the value is a File/Blob instance
+ if (value instanceof File || value instanceof Blob) {
+ // Append the file directly
+ formData.append(key, value);
+ } else if (typeof value === 'object') {
+ // Handle nested objects/arrays by stringifying them (optional, depends on API)
+ // Note: Most APIs expect nested data to be handled separately or passed as JSON string
+ // For simplicity, we stringify non-File objects.
+ formData.append(key, JSON.stringify(value));
+ } else {
+ // Append standard string, number, or boolean values
+ formData.append(key, value);
+ }
+ }
+ }
+ }
+
+ return formData;
+}
+
+export function printFormData(formData: FormData) {
+ console.log("--- FormData Contents ---");
+ // Use the entries() iterator to loop through key/value pairs
+ for (const [key, value] of formData.entries()) {
+ if (value instanceof File) {
+ console.log(`Key: ${key}, Value: [File: ${value.name}, Type: ${value.type}, Size: ${value.size} bytes]`);
+ } else {
+ console.log(`Key: ${key}, Value: "${value}"`);
+ }
+ }
+ console.log("-------------------------");
+}
\ No newline at end of file
diff --git a/app/models/encounter-document.ts b/app/models/encounter-document.ts
new file mode 100644
index 00000000..c4f9898c
--- /dev/null
+++ b/app/models/encounter-document.ts
@@ -0,0 +1,29 @@
+import { type Base, genBase } from "./_base"
+import { supportingDocOpt, supportingDocTypeCode, supportingDocTypeLabel, type supportingDocTypeCodeKey } from '~/lib/constants'
+import { genEmployee, type Employee } from "./employee"
+import { genEncounter, type Encounter } from "./encounter"
+
+export interface EncounterDocument extends Base {
+ encounter_id: number
+ encounter?: Encounter
+ upload_employee_id: number
+ employee?: Employee
+ type_code: string
+ name: string
+ filePath: string
+ fileName: string
+}
+
+export function genEncounterDocument(): EncounterDocument {
+ return {
+ ...genBase(),
+ encounter_id: 2,
+ encounter: genEncounter(),
+ upload_employee_id: 0,
+ employee: genEmployee(),
+ type_code: supportingDocTypeLabel["encounter-patient"],
+ name: 'example',
+ filePath: 'https://bing.com',
+ fileName: 'example',
+ }
+}
diff --git a/app/models/encounter.ts b/app/models/encounter.ts
index fb2c0b04..55fbdfa4 100644
--- a/app/models/encounter.ts
+++ b/app/models/encounter.ts
@@ -1,6 +1,7 @@
import type { DeathCause } from "./death-cause"
import { type Doctor, genDoctor } from "./doctor"
import { genEmployee, type Employee } from "./employee"
+import type { EncounterDocument } from "./encounter-document"
import type { InternalReference } from "./internal-reference"
import { type Patient, genPatient } from "./patient"
import type { Specialist } from "./specialist"
@@ -37,6 +38,7 @@ export interface Encounter {
internalReferences?: InternalReference[]
deathCause?: DeathCause
status_code: string
+ encounterDocuments: EncounterDocument[]
}
export function genEncounter(): Encounter {
@@ -54,7 +56,8 @@ export function genEncounter(): Encounter {
appointment_doctor_id: 0,
appointment_doctor: genDoctor(),
medicalDischargeEducation: '',
- status_code: ''
+ status_code: '',
+ encounterDocuments: [],
}
}
diff --git a/app/pages/(features)/rehab/encounter/[id]/process.vue b/app/pages/(features)/rehab/encounter/[id]/process.vue
index 3fa7525a..abd0efa7 100644
--- a/app/pages/(features)/rehab/encounter/[id]/process.vue
+++ b/app/pages/(features)/rehab/encounter/[id]/process.vue
@@ -22,15 +22,15 @@ const { checkRole, hasCreateAccess } = useRBAC()
// Check if user has access to this page
const hasAccess = checkRole(roleAccess)
-if (!hasAccess) {
- throw createError({
- statusCode: 403,
- statusMessage: 'Access denied',
- })
-}
+// if (!hasAccess) {
+// throw createError({
+// statusCode: 403,
+// statusMessage: 'Access denied',
+// })
+// }
// Define permission-based computed properties
-const canCreate = hasCreateAccess(roleAccess)
+const canCreate = true // hasCreateAccess(roleAccess)
diff --git a/app/pages/(features)/rehab/encounter/index.vue b/app/pages/(features)/rehab/encounter/index.vue
index 7a8564a8..9deaeb1f 100644
--- a/app/pages/(features)/rehab/encounter/index.vue
+++ b/app/pages/(features)/rehab/encounter/index.vue
@@ -22,12 +22,12 @@ const { checkRole, hasReadAccess } = useRBAC()
// Check if user has access to this page
const hasAccess = checkRole(roleAccess)
-if (!hasAccess) {
- navigateTo('/403')
-}
+// if (!hasAccess) {
+// navigateTo('/403')
+// }
// Define permission-based computed properties
-const canRead = hasReadAccess(roleAccess)
+const canRead = true // hasReadAccess(roleAccess)
diff --git a/app/schemas/document-upload.schema.ts b/app/schemas/document-upload.schema.ts
index ffd56e36..7f7de622 100644
--- a/app/schemas/document-upload.schema.ts
+++ b/app/schemas/document-upload.schema.ts
@@ -1,10 +1,21 @@
import { z } from 'zod'
+const ACCEPTED_UPLOAD_TYPES = ['image/jpeg', 'image/png', 'application/pdf']
+const MAX_SIZE_BYTES = 1 * 1024 * 1024 // 1MB
+
const DocumentUploadSchema = z.object({
- officer: z.string({ required_error: 'Mohon isi', }),
- doc_name: z.number({ required_error: 'Mohon isi', }),
- doc_type: z.number({ required_error: 'Mohon isi', }),
- file: z.number({ required_error: 'Mohon isi', }),
+ entityType_code: z.string().default('encounter'),
+ ref_id: z.number(),
+ upload_employee_id: z.number(),
+ name: z.string({ required_error: 'Mohon isi', }),
+ type_code: z.string({ required_error: 'Mohon isi', }),
+ content: z.custom()
+ .refine((f) => f, { message: 'File tidak boleh kosong' })
+ .refine((f) => !f || f instanceof File, { message: 'Harus berupa file yang valid' })
+ .refine((f) => !f || ACCEPTED_UPLOAD_TYPES.includes(f.type), {
+ message: 'Format file harus JPG, PNG, atau PDF',
+ })
+ .refine((f) => !f || f.size <= MAX_SIZE_BYTES, { message: 'Maksimal 1MB' }),
})
type DocumentUploadFormData = z.infer
diff --git a/app/services/supporting-document.service.ts b/app/services/supporting-document.service.ts
new file mode 100644
index 00000000..b02cec0e
--- /dev/null
+++ b/app/services/supporting-document.service.ts
@@ -0,0 +1,55 @@
+// Base
+import * as base from './_crud-base'
+
+// Constants
+import { encounterClassCodes, uploadCode, type UploadCodeKey } from '~/lib/constants'
+
+const path = '/api/v1/upload'
+const name = 'upload'
+
+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)
+}
+
+export async function uploadAttachment(file: File, userId: number, key: UploadCodeKey) {
+ try {
+ const resolvedKey = uploadCode[key]
+ if (!resolvedKey) {
+ throw new Error(`Invalid upload code key: ${key}`)
+ }
+
+ // siapkan form-data body
+ const formData = new FormData()
+ formData.append('code', resolvedKey)
+ formData.append('content', file)
+
+ // kirim via xfetch
+ const resp = await xfetch(`${path}/${userId}/upload`, 'POST', formData)
+
+ // struktur hasil sama seperti patchPatient
+ const result: any = {}
+ result.success = resp.success
+ result.body = (resp.body as Record) || {}
+
+ return result
+ } catch (error) {
+ console.error('Error uploading attachment:', error)
+ throw new Error('Failed to upload attachment')
+ }
+}
\ No newline at end of file
From 1d03258f4403122fabf43148c739756191470971 Mon Sep 17 00:00:00 2001
From: hasyim_kai
Date: Fri, 14 Nov 2025 14:08:47 +0700
Subject: [PATCH 10/35] Fix: Typo uplaod doc type
---
app/lib/constants.ts | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/lib/constants.ts b/app/lib/constants.ts
index f684594e..430b2902 100644
--- a/app/lib/constants.ts
+++ b/app/lib/constants.ts
@@ -407,17 +407,17 @@ export const encounterDocOpt: { label: string; value: encounterDocTypeCodeKey }[
export const supportingDocTypeCode = {
"encounter-patient": 'encounter-patient',
- "encounter-suport": 'encounter-suport',
+ "encounter-support": 'encounter-support',
"encounter-other": 'encounter-other',
} as const
export const supportingDocTypeLabel = {
"encounter-patient": 'Data Pasien',
- "encounter-suport": 'Data Penunjang',
+ "encounter-support": 'Data Penunjang',
"encounter-other": 'Lain - Lain',
} as const
export type supportingDocTypeCodeKey = keyof typeof supportingDocTypeCode
export const supportingDocOpt = [
{ label: 'Data Pasien', value: 'encounter-patient' },
- { label: 'Data Penunjang', value: 'encounter-suport' },
+ { label: 'Data Penunjang', value: 'encounter-support' },
{ label: 'Lain - Lain', value: 'encounter-other' },
]
From 60c13649d9ccc0653136bfc41e70c3ab73278a80 Mon Sep 17 00:00:00 2001
From: hasyim_kai
Date: Fri, 14 Nov 2025 14:55:32 +0700
Subject: [PATCH 11/35] Fix: debug Uplaod Doc
---
app/components/app/document-upload/list.vue | 6 ++--
.../content/document-upload/add.vue | 2 +-
.../content/document-upload/list.vue | 35 +++++++++++++------
app/services/supporting-document.service.ts | 7 ++--
4 files changed, 33 insertions(+), 17 deletions(-)
diff --git a/app/components/app/document-upload/list.vue b/app/components/app/document-upload/list.vue
index dde32820..8274e752 100644
--- a/app/components/app/document-upload/list.vue
+++ b/app/components/app/document-upload/list.vue
@@ -5,7 +5,7 @@ import { config } from './list.cfg'
interface Props {
data: any[]
- // paginationMeta: PaginationMeta
+ paginationMeta: PaginationMeta
}
defineProps()
@@ -24,8 +24,8 @@ function handlePageChange(page: number) {
-
-
+
diff --git a/app/components/content/document-upload/add.vue b/app/components/content/document-upload/add.vue
index 5ee3d862..7d42f4f6 100644
--- a/app/components/content/document-upload/add.vue
+++ b/app/components/content/document-upload/add.vue
@@ -57,7 +57,7 @@ async function composeFormData(): Promise {
inputForm.value?.setValues({
...inputForm.value?.values,
ref_id: encounterId,
- upload_employee_id: user.user_id
+ upload_employee_id: user.employee_id
})
const [inputFormState,] = await Promise.all([
diff --git a/app/components/content/document-upload/list.vue b/app/components/content/document-upload/list.vue
index 94f9dd9f..be690871 100644
--- a/app/components/content/document-upload/list.vue
+++ b/app/components/content/document-upload/list.vue
@@ -1,14 +1,12 @@
-
-
+
+
@@ -114,9 +129,9 @@ watch([recId, recAction, timestamp], () => {
ID:
{{ record?.id }}
-
+
Nama:
- {{ record.name }}
+ {{ record?.name }}
diff --git a/app/services/supporting-document.service.ts b/app/services/supporting-document.service.ts
index b02cec0e..46eaffa9 100644
--- a/app/services/supporting-document.service.ts
+++ b/app/services/supporting-document.service.ts
@@ -4,11 +4,12 @@ import * as base from './_crud-base'
// Constants
import { encounterClassCodes, uploadCode, type UploadCodeKey } from '~/lib/constants'
-const path = '/api/v1/upload'
-const name = 'upload'
+const path = '/api/v1/encounter-document'
+const create_path = '/api/v1/upload'
+const name = 'encounter-document'
export function create(data: any) {
- return base.create(path, data, name)
+ return base.create(create_path, data, name)
}
export function getList(params: any = null) {
From bb0017ffcb8ec0b0a53b01ffeba3e04d3a247995 Mon Sep 17 00:00:00 2001
From: hasyim_kai
Date: Fri, 14 Nov 2025 15:47:11 +0700
Subject: [PATCH 12/35] Fix: refactor constList Uplaod Doc
---
.../app/document-upload/_common/select-doc-type.vue | 2 +-
app/components/app/document-upload/list.cfg.ts | 5 +++++
app/lib/constants.ts | 10 +++++++---
app/models/encounter-document.ts | 4 ++--
4 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/app/components/app/document-upload/_common/select-doc-type.vue b/app/components/app/document-upload/_common/select-doc-type.vue
index 0e86f596..70f78a7b 100644
--- a/app/components/app/document-upload/_common/select-doc-type.vue
+++ b/app/components/app/document-upload/_common/select-doc-type.vue
@@ -2,7 +2,7 @@
import type { FormErrors } from '~/types/error'
import Combobox from '~/components/pub/my-ui/combobox/combobox.vue'
import { cn, mapToComboboxOptList } from '~/lib/utils'
-import { supportingDocTypeCode, supportingDocOpt, type supportingDocTypeCodeKey } from '~/lib/constants'
+import { docTypeCode, supportingDocOpt, type docTypeCodeKey } from '~/lib/constants'
import { getValueLabelList as getDoctorLabelList } from '~/services/doctor.service'
import { getValueLabelList as getUnitLabelList } from '~/services/unit.service'
diff --git a/app/components/app/document-upload/list.cfg.ts b/app/components/app/document-upload/list.cfg.ts
index 508ad3ea..7f275d31 100644
--- a/app/components/app/document-upload/list.cfg.ts
+++ b/app/components/app/document-upload/list.cfg.ts
@@ -1,5 +1,6 @@
import type { Config } from '~/components/pub/my-ui/data-table'
import { defineAsyncComponent } from 'vue'
+import { docTypeCode, docTypeLabel, type docTypeCodeKey } from '~/lib/constants'
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dd.vue'))
@@ -22,6 +23,10 @@ export const config: Config = {
],
parses: {
+ type_code: (v: unknown) => {
+ console.log(v)
+ return docTypeLabel[v as docTypeCodeKey]
+ },
},
components: {
diff --git a/app/lib/constants.ts b/app/lib/constants.ts
index 430b2902..48fb5c8c 100644
--- a/app/lib/constants.ts
+++ b/app/lib/constants.ts
@@ -405,17 +405,21 @@ export const encounterDocOpt: { label: string; value: encounterDocTypeCodeKey }[
]
-export const supportingDocTypeCode = {
+export const docTypeCode = {
"encounter-patient": 'encounter-patient',
"encounter-support": 'encounter-support',
"encounter-other": 'encounter-other',
+ "vclaim-sep": 'vclaim-sep',
+ "vclaim-sipp": 'vclaim-sipp',
} as const
-export const supportingDocTypeLabel = {
+export const docTypeLabel = {
"encounter-patient": 'Data Pasien',
"encounter-support": 'Data Penunjang',
"encounter-other": 'Lain - Lain',
+ "vclaim-sep": 'SEP',
+ "vclaim-sipp": 'SIPP',
} as const
-export type supportingDocTypeCodeKey = keyof typeof supportingDocTypeCode
+export type docTypeCodeKey = keyof typeof docTypeCode
export const supportingDocOpt = [
{ label: 'Data Pasien', value: 'encounter-patient' },
{ label: 'Data Penunjang', value: 'encounter-support' },
diff --git a/app/models/encounter-document.ts b/app/models/encounter-document.ts
index c4f9898c..5a98ccd5 100644
--- a/app/models/encounter-document.ts
+++ b/app/models/encounter-document.ts
@@ -1,5 +1,5 @@
import { type Base, genBase } from "./_base"
-import { supportingDocOpt, supportingDocTypeCode, supportingDocTypeLabel, type supportingDocTypeCodeKey } from '~/lib/constants'
+import { docTypeLabel, } from '~/lib/constants'
import { genEmployee, type Employee } from "./employee"
import { genEncounter, type Encounter } from "./encounter"
@@ -21,7 +21,7 @@ export function genEncounterDocument(): EncounterDocument {
encounter: genEncounter(),
upload_employee_id: 0,
employee: genEmployee(),
- type_code: supportingDocTypeLabel["encounter-patient"],
+ type_code: docTypeLabel["encounter-patient"],
name: 'example',
filePath: 'https://bing.com',
fileName: 'example',
From d0aa69d9a155abd09aaeb93c96e2808bddb54dfe Mon Sep 17 00:00:00 2001
From: hasyim_kai
Date: Fri, 14 Nov 2025 17:12:17 +0700
Subject: [PATCH 13/35] Fix: debug table typo Uplaod Doc
---
app/components/app/document-upload/list.cfg.ts | 3 +--
app/components/content/document-upload/list.vue | 6 +++++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/app/components/app/document-upload/list.cfg.ts b/app/components/app/document-upload/list.cfg.ts
index 7f275d31..979c916d 100644
--- a/app/components/app/document-upload/list.cfg.ts
+++ b/app/components/app/document-upload/list.cfg.ts
@@ -24,8 +24,7 @@ export const config: Config = {
parses: {
type_code: (v: unknown) => {
- console.log(v)
- return docTypeLabel[v as docTypeCodeKey]
+ return docTypeLabel[v?.type_code as docTypeCodeKey]
},
},
diff --git a/app/components/content/document-upload/list.vue b/app/components/content/document-upload/list.vue
index be690871..2ddbb77c 100644
--- a/app/components/content/document-upload/list.vue
+++ b/app/components/content/document-upload/list.vue
@@ -19,7 +19,11 @@ const route = useRoute()
const encounterId = typeof route.params.id == 'string' ? parseInt(route.params.id) : 0
const { data, paginationMeta, handlePageChange, handleSearch, searchInput, fetchData } = usePaginatedList({
- fetchFn: (params) => getList({ 'encounter-id': encounterId, ...params }),
+ fetchFn: (params) => getList({
+ 'encounter-id': encounterId,
+ // includes: "employee",
+ ...params,
+ }),
entityName: 'encounter-document',
})
From 224bc7cd610f4c09c62b3a1d1d2cf6d645e67a7d Mon Sep 17 00:00:00 2001
From: Andrian Roshandy
Date: Sat, 15 Nov 2025 20:13:15 +0700
Subject: [PATCH 14/35] feat/prescription: integrated non-mix
---
.../app/prescription-item/list-entry.cfg.ts | 2 +-
.../app/prescription-item/mix-entry.vue | 32 ++++--
.../app/prescription-item/non-mix-entry.vue | 65 ++++++++----
app/components/content/prescription/entry.vue | 98 ++++++++++++-------
app/components/content/prescription/list.vue | 10 ++
app/models/medicine.ts | 11 ++-
app/models/medicinemix-item.ts | 4 +-
app/models/prescription-item.ts | 29 +++---
8 files changed, 167 insertions(+), 84 deletions(-)
diff --git a/app/components/app/prescription-item/list-entry.cfg.ts b/app/components/app/prescription-item/list-entry.cfg.ts
index 070dd65f..19b2f3d8 100644
--- a/app/components/app/prescription-item/list-entry.cfg.ts
+++ b/app/components/app/prescription-item/list-entry.cfg.ts
@@ -20,7 +20,7 @@ export const config: Config = {
],
],
- keys: ['name', 'uom_code', 'frequency', 'multiplier', 'interval', 'total', 'action'],
+ keys: ['medicine.name', 'medicine.medicineForm.name', 'frequency', 'dose', 'interval', 'total', 'action'],
delKeyNames: [
{ key: 'code', label: 'Kode' },
diff --git a/app/components/app/prescription-item/mix-entry.vue b/app/components/app/prescription-item/mix-entry.vue
index d9b4881e..187e9569 100644
--- a/app/components/app/prescription-item/mix-entry.vue
+++ b/app/components/app/prescription-item/mix-entry.vue
@@ -1,29 +1,37 @@
-
-
+
+
Nama
-
+
+
+
Frequensi
@@ -66,7 +80,7 @@ function addItem() {
Total
-
+
Cara Pakai
@@ -102,7 +116,7 @@ function addItem() {
-
+
Tambah
diff --git a/app/components/app/prescription-item/non-mix-entry.vue b/app/components/app/prescription-item/non-mix-entry.vue
index 25970646..9115eeb9 100644
--- a/app/components/app/prescription-item/non-mix-entry.vue
+++ b/app/components/app/prescription-item/non-mix-entry.vue
@@ -2,15 +2,26 @@
import * as DE from '~/components/pub/my-ui/doc-entry'
import Separator from '~/components/pub/ui/separator/Separator.vue'
import Nav from '~/components/pub/my-ui/nav-footer/cl-sa.vue'
+import * as CB from '~/components/pub/my-ui/combobox'
-import { bigTimeUnitCodes } from '~/lib/constants'
+// import { bigTimeUnitCodes } from '~/lib/constants'
+import { type Medicine, genMedicine } from '~/models/medicine';
import type { PrescriptionItem } from '~/models/prescription-item'
const props = defineProps<{
data: PrescriptionItem
+ medicines: Medicine[]
}>()
+const { medicines } = toRefs(props)
+const medicineItems = ref([])
+const medicineForm = computed(() => {
+ const medicine = props.medicines.find(m => m.code === props.data.medicine_code)
+ return medicine ? medicine.medicineForm?.name : '--tidak diketahui--'
+})
+// const selectedMedicine_code = ref(props.data.medicine_code || '')
+
type ClickType = 'close' | 'save'
type Item = {
value: string
@@ -23,19 +34,23 @@ if(!props.data.intervalUnit_code) {
props.data.intervalUnit_code = 'day'
}
-Object.keys(bigTimeUnitCodes).forEach((key) => {
- bigTimeUnitCodeItems.push({
- value: key,
- label: bigTimeUnitCodes[key] || '',
- })
-})
-
+// Object.keys(bigTimeUnitCodes).forEach((key) => {
+// bigTimeUnitCodeItems.push({
+// value: key,
+// label: bigTimeUnitCodes[key] || '',
+// })
+// })
const emit = defineEmits<{
close: [],
save: [data: PrescriptionItem],
+ 'update:searchText': [value: string]
}>()
+watch(medicines, (data) => {
+ medicineItems.value = CB.objectsToItem(data, 'code', 'name')
+})
+
function navClick(type: ClickType) {
if (type === 'close') {
emit('close')
@@ -43,13 +58,23 @@ function navClick(type: ClickType) {
emit('save', props.data)
}
}
+
+function searchMedicineText(value: string) {
+ emit('update:searchText', value)
+}
-
-
- Nama
-
+
+
+ Nama
+
+
+
Frequensi
@@ -59,11 +84,7 @@ function navClick(type: ClickType) {
Dosis
-
- Sediaan
-
-
-
+
Total
-
+
-
+
+ Sediaan
+
+
+
Cara Pakai
diff --git a/app/components/content/prescription/entry.vue b/app/components/content/prescription/entry.vue
index 4b3fa663..3ad9d572 100644
--- a/app/components/content/prescription/entry.vue
+++ b/app/components/content/prescription/entry.vue
@@ -6,20 +6,27 @@ import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
import { useQueryCRUDMode } from '~/composables/useQueryCRUD'
import type { HeaderPrep } from '~/components/pub/my-ui/data/types'
+// medicine
+import { type Medicine } from '~/models/medicine'
+
+// prescription
import { getDetail } from '~/services/prescription.service'
+import { getList as getMedicineList } from '~/services/medicine.service'
import Detail from '~/components/app/prescription/detail.vue'
-import { getList as getPrescriptionItemList } from '~/services/prescription-item.service'
-import ItemListEntry from '~/components/app/prescription-item/list-entry.vue'
-import { type PrescriptionItem } from '~/models/prescription-item'
-
-import MixItemEntry from '~/components/app/prescription-item/mix-entry.vue'
-import { create } from '~/services/prescription-item.service';
-
-import NonMixItemEntry from '~/components/app/prescription-item/non-mix-entry.vue'
+// prescription items
import {
- recItem,
-} from '~/handlers/prescription-item.handler'
+ getList as getPrescriptionItemList,
+ create as createPrescriptionItem,
+ remove as removePrescriptionItem,
+} from '~/services/prescription-item.service'
+import { type PrescriptionItem, genPrescriptionItem } from '~/models/prescription-item'
+import ItemListEntry from '~/components/app/prescription-item/list-entry.vue'
+import type { MedicinemixItem } from '~/models/medicinemix-item';
+
+import { recItem } from '~/handlers/prescription-item.handler'
+import NonMixItemEntry from '~/components/app/prescription-item/non-mix-entry.vue'
+import MixItemEntry from '~/components/app/prescription-item/mix-entry.vue'
// props
const props = defineProps<{
@@ -27,7 +34,8 @@ const props = defineProps<{
}>()
// declaration & flows
-// const route = useRoute()
+
+// Prescription
const { getQueryParam } = useQueryParam()
const id = getQueryParam('id')
const dataRes = await getDetail(
@@ -35,21 +43,15 @@ const dataRes = await getDetail(
{ includes: 'encounter,doctor,doctor-employee,doctor-employee-person' }
)
const data = dataRes.body?.data || null
-const items = ref(data?.items || [])
-const {
- data: prescriptionItems,
- fetchData: getMyList,
-} = usePaginatedList ({
- fetchFn: async ({ page, search }) => {
- const result = await getPrescriptionItemList({ 'prescription-id': id, search, page })
- if (result.success) {
- data.value = result.body.data
- }
- return { success: result.success || false, body: result.body || {} }
- },
- entityName: 'prescription-item',
-})
+// Prescription Items
+const items = ref([])
+const mixItem = ref(genPrescriptionItem())
+const medicinemixItems = ref([])
+const nonMixItem = ref(genPrescriptionItem())
+
+mixItem.value.prescription_id = typeof id === 'string' ? parseInt(id) : 0
+nonMixItem.value.prescription_id = typeof id === 'string' ? parseInt(id) : 0
const { backToList } = useQueryCRUDMode()
@@ -60,6 +62,11 @@ const headerPrep: HeaderPrep = {
const mixDialogOpen = ref(false)
const nonMixDialogOpen = ref(false)
+const medicines = ref([])
+
+onMounted(async () => {
+ await getItems()
+})
function navClick(type: 'back' | 'delete' | 'draft' | 'submit') {
if (type === 'back') {
@@ -76,11 +83,29 @@ function addItem(mode: 'mix' | 'non-mix') {
}
function saveMix() {
- create({data})
+ createPrescriptionItem(mixItem.value)
}
-function saveNonMix(data: PrescriptionItem) {
- create({data})
+function saveNonMix() {
+ createPrescriptionItem(nonMixItem.value)
+}
+
+async function getItems() {
+ const res = await getPrescriptionItemList({ 'prescription-id': id, includes: 'medicine,medicine-medicineForm,medicineMix' })
+ if (res.success) {
+ items.value = res.body.data
+ } else {
+ items.value = []
+ }
+}
+
+async function getMedicines(value: string) {
+ const res = await getMedicineList({ 'search': value, 'includes': 'medicineForm' })
+ if (res.success) {
+ medicines.value = res.body.data
+ } else {
+ medicines.value = []
+ }
}
@@ -94,7 +119,7 @@ function saveNonMix(data: PrescriptionItem) {
@@ -105,28 +130,31 @@ function saveNonMix(data: PrescriptionItem) {
diff --git a/app/components/content/prescription/list.vue b/app/components/content/prescription/list.vue
index 68e2069f..8d83f477 100644
--- a/app/components/content/prescription/list.vue
+++ b/app/components/content/prescription/list.vue
@@ -177,6 +177,16 @@ async function handleActionSubmit(id: number, refresh: () => void, toast: ToastF
@confirm="() => handleActionRemove(recId, getMyList, toast)"
@cancel=""
>
+
+
Date: Sat, 15 Nov 2025 22:40:23 +0700
Subject: [PATCH 15/35] feat/prescription: more adjustment
---
app/components/app/prescription-item/list.cfg.ts | 3 +--
app/components/app/prescription-item/list.vue | 4 +++-
app/components/app/prescription/detail.vue | 2 +-
app/components/app/prescription/list.vue | 2 +-
app/components/content/prescription/list.vue | 2 +-
5 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/app/components/app/prescription-item/list.cfg.ts b/app/components/app/prescription-item/list.cfg.ts
index fd980bb1..5a3447ef 100644
--- a/app/components/app/prescription-item/list.cfg.ts
+++ b/app/components/app/prescription-item/list.cfg.ts
@@ -12,12 +12,11 @@ export const config: Config = {
{ label: 'Bentuk' },
{ label: 'Freq' },
{ label: 'Dosis' },
- { label: 'Interval' },
{ label: 'Total' },
],
],
- keys: ['name', 'uom_code', 'frequency', 'multiplier', 'interval', 'total'],
+ keys: ['medicine.name', 'medicine.medicineForm.name', 'frequency', 'dose', 'total'],
delKeyNames: [
{ key: 'code', label: 'Kode' },
diff --git a/app/components/app/prescription-item/list.vue b/app/components/app/prescription-item/list.vue
index ed64b09e..d8c4c107 100644
--- a/app/components/app/prescription-item/list.vue
+++ b/app/components/app/prescription-item/list.vue
@@ -1,4 +1,6 @@
-
diff --git a/app/components/app/prescription/detail.vue b/app/components/app/prescription/detail.vue
index 694eb9a1..21962532 100644
--- a/app/components/app/prescription/detail.vue
+++ b/app/components/app/prescription/detail.vue
@@ -13,7 +13,7 @@ const props = defineProps<{
Order {{ data.issuedAt?.substring(0, 10) || data.createdAt?.substring(0, 10) }} - {{ data.status_code }}
-
+
DPJP
diff --git a/app/components/app/prescription/list.vue b/app/components/app/prescription/list.vue
index fbff7b10..07d6fcaa 100644
--- a/app/components/app/prescription/list.vue
+++ b/app/components/app/prescription/list.vue
@@ -65,7 +65,7 @@ function navClick(type: 'cancel' | 'edit' | 'submit', data: Prescription): void
/>
-
+
diff --git a/app/components/content/prescription/list.vue b/app/components/content/prescription/list.vue
index 8d83f477..5042a74b 100644
--- a/app/components/content/prescription/list.vue
+++ b/app/components/content/prescription/list.vue
@@ -50,7 +50,7 @@ const {
search,
page,
'encounter-id': encounter_id,
- includes: 'doctor,doctor-employee,doctor-employee-person',
+ includes: 'doctor,doctor-employee,doctor-employee-person,items,items-medicine,items-medicine-medicineForm',
})
return { success: result.success || false, body: result.body || {} }
},
From 391469e633de8b1e81736635dec8bcc50afa6da5 Mon Sep 17 00:00:00 2001
From: Andrian Roshandy
Date: Sun, 16 Nov 2025 08:15:19 +0700
Subject: [PATCH 16/35] feat/prescription: added group and flat list
---
.../app/prescription-item/mix-entry.vue | 2 +-
.../app/prescription-item/non-mix-entry.vue | 2 +-
app/components/app/prescription/flat-list.vue | 88 +++++++++++++++++++
.../{list.vue => grouped-list.vue} | 0
app/components/content/prescription/list.vue | 47 ++++++++--
.../pub/my-ui/data-table/data-table.vue | 4 +-
6 files changed, 130 insertions(+), 13 deletions(-)
create mode 100644 app/components/app/prescription/flat-list.vue
rename app/components/app/prescription/{list.vue => grouped-list.vue} (100%)
diff --git a/app/components/app/prescription-item/mix-entry.vue b/app/components/app/prescription-item/mix-entry.vue
index 187e9569..5a3c74fd 100644
--- a/app/components/app/prescription-item/mix-entry.vue
+++ b/app/components/app/prescription-item/mix-entry.vue
@@ -29,7 +29,7 @@ const emit = defineEmits<{
}>()
watch(medicines, (data) => {
- medicineItems.value = CB.objectsToItem(data, 'code', 'name')
+ medicineItems.value = CB.objectsToItems(data, 'code', 'name')
})
function navClick(type: ClickType) {
diff --git a/app/components/app/prescription-item/non-mix-entry.vue b/app/components/app/prescription-item/non-mix-entry.vue
index 9115eeb9..90cf3e01 100644
--- a/app/components/app/prescription-item/non-mix-entry.vue
+++ b/app/components/app/prescription-item/non-mix-entry.vue
@@ -48,7 +48,7 @@ const emit = defineEmits<{
}>()
watch(medicines, (data) => {
- medicineItems.value = CB.objectsToItem(data, 'code', 'name')
+ medicineItems.value = CB.objectsToItems(data, 'code', 'name')
})
function navClick(type: ClickType) {
diff --git a/app/components/app/prescription/flat-list.vue b/app/components/app/prescription/flat-list.vue
new file mode 100644
index 00000000..cf563ef2
--- /dev/null
+++ b/app/components/app/prescription/flat-list.vue
@@ -0,0 +1,88 @@
+
+
+
+
+
Belum Ada Data
+
+
+
+ Tambah Order
+
+
+
+
+
+
+ Tgl Order
+ DPJP
+ PPDS
+ Jenis Obat
+ Status
+
+
+
+
+
+
+ {{ item.issuedAt?.substring(0, 10) || item.createdAt?.substring(0, 10) }}
+
+
+ {{ item.doctor?.employee?.person?.name || '-' }}
+
+
+
+
+
+ Racikan: {{ item.items.filter(function(element){ return element.isMix}).length }}
+
+
+ Non Racikan: {{ item.items.filter(function(element){ return !element.isMix}).length }}
+
+
+
+ {{ item.status_code }}
+
+
+ { navClick(type, item) }"
+ />
+
+
+
+
+
+
+
diff --git a/app/components/app/prescription/list.vue b/app/components/app/prescription/grouped-list.vue
similarity index 100%
rename from app/components/app/prescription/list.vue
rename to app/components/app/prescription/grouped-list.vue
diff --git a/app/components/content/prescription/list.vue b/app/components/content/prescription/list.vue
index 5042a74b..af24808f 100644
--- a/app/components/content/prescription/list.vue
+++ b/app/components/content/prescription/list.vue
@@ -20,7 +20,8 @@ import {
// Services
import { getList, getDetail } from '~/services/prescription.service'
-import List from '~/components/app/prescription/list.vue'
+import FlatList from '~/components/app/prescription/flat-list.vue'
+import Grouped from '~/components/app/prescription/grouped-list.vue'
import type { Prescription } from '~/models/prescription'
import { submit } from '~/services/prescription.service'
import type { ToastFn } from '~/handlers/_handler'
@@ -57,9 +58,25 @@ const {
entityName: 'prescription'
})
+function updateProvidedVal(val: boolean) {
+ flatMode.value = val
+}
+const flatMode = ref(false)
+const flatModeLabel = ref('Mode Flat: Tidak')
+provide('flatMode', { flatMode, updateProvidedVal })
+watch(flatMode, (newVal) => {
+ flatModeLabel.value = newVal ? 'Mode Flat: Ya' : 'Mode Flat: Tidak'
+})
+
const headerPrep: HeaderPrep = {
title: 'Order Obat',
icon: 'i-lucide-box',
+ components: [
+ {
+ component: defineAsyncComponent(() => import('~/components/pub/my-ui/toggle/provided-toggle.vue')),
+ props: { variant: 'outline', label: flatModeLabel, providedKey: 'flatMode' }
+ },
+ ],
refSearchNav: {
placeholder: 'Cari (min. 3 karakter)...',
minLength: 3,
@@ -161,14 +178,26 @@ async function handleActionSubmit(id: number, refresh: () => void, toast: ToastF
-
+
+
+
+
+
+
([])
function toggleSelection(row: any, event?: Event) {
if (event) event.stopPropagation() // cegah event bubble ke TableRow
- const isMultiple = props.selectMode === 'multiple' // props.selectMode === 'multi' ||
+ const isMultiple = props.selectMode === 'multiple' // props.selectMode === 'multi' ||
// gunakan pembanding berdasarkan id atau stringify data
const findIndex = selected.value.findIndex((r) => JSON.stringify(r) === JSON.stringify(row))
@@ -128,7 +128,7 @@ function handleActionCellClick(event: Event, _cellRef: string) {
'bg-green-50':
props.selectMode === 'single' && selected.some((r) => JSON.stringify(r) === JSON.stringify(row)),
'bg-blue-50':
- (props.selectMode === 'multiple') && // props.selectMode === 'multi' ||
+ (props.selectMode === 'multiple') && // props.selectMode === 'multi' ||
selected.some((r) => JSON.stringify(r) === JSON.stringify(row)),
}"
@click="toggleSelection(row)"
From 7253272681411379b732340e1d84556c914d595d Mon Sep 17 00:00:00 2001
From: Andrian Roshandy
Date: Sun, 16 Nov 2025 11:21:02 +0700
Subject: [PATCH 17/35] feat/device-order: adjustment wip
---
.../app/device-order/list.config.ts | 35 ++++--
app/components/app/device-order/list.vue | 8 +-
app/components/content/device-order/list.vue | 106 +++++++++++++-----
app/models/device-order.ts | 3 +
4 files changed, 110 insertions(+), 42 deletions(-)
diff --git a/app/components/app/device-order/list.config.ts b/app/components/app/device-order/list.config.ts
index 7580c576..0e0d068d 100644
--- a/app/components/app/device-order/list.config.ts
+++ b/app/components/app/device-order/list.config.ts
@@ -1,13 +1,20 @@
import type { Config } from '~/components/pub/my-ui/data-table'
import type { DeviceOrder } from '~/models/device-order'
-import { defineAsyncComponent } from 'vue'
+// import type {} from
+// import { defineAsyncComponent } from 'vue'
+
+// const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-ud.vue'))
-const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-ud.vue'))
export const config: Config = {
- cols: [{ width: 120 }, { }, { }, { width: 50 }],
- headers: [[{ label: 'Tanggal' }, { label: 'DPJP' }, { label: 'Alat Kesehatan' }, { label: '' }]],
- keys: ['createdAt', 'encounter.doctor.person.name', 'items', 'action'],
+ cols: [{ width: 120 }, { }, { }, { }, { width: 50 }],
+ headers: [[
+ { label: 'Tanggal' },
+ { label: 'DPJP' },
+ { label: 'Alat Kesehatan' },
+ { label: 'Status' },
+ { label: '' }]],
+ keys: ['createdAt', 'doctor.employee.person.name', 'items', 'status_code', 'action'],
delKeyNames: [
{ key: 'code', label: 'Kode' },
{ key: 'name', label: 'Nama' },
@@ -18,13 +25,17 @@ export const config: Config = {
const recX = rec as DeviceOrder
return recX.items?.length || 0
},
- }
- // funcParsed: {
- // parent: (rec: unknown): unknown => {
- // const recX = rec as SmallDetailDto
- // return recX.parent?.name || '-'
- // },
- // },
+ },
+ parses: {
+ createdAt: (rec: unknown): unknown => {
+ const recX = rec as DeviceOrder
+ return recX.createdAt ? new Date(recX.createdAt).toLocaleDateString() : '-'
+ },
+ // parent: (rec: unknown): unknown => {
+ // const recX = rec as SmallDetailDto
+ // return recX.parent?.name || '-'
+ // },
+ },
// funcComponent: {
// action(rec: object, idx: any) {
// const res: RecComponent = {
diff --git a/app/components/app/device-order/list.vue b/app/components/app/device-order/list.vue
index 37b24ea3..83f57dd6 100644
--- a/app/components/app/device-order/list.vue
+++ b/app/components/app/device-order/list.vue
@@ -8,12 +8,10 @@ import type { PaginationMeta } from '~/components/pub/my-ui/pagination/paginatio
// Configs
import { config } from './list.config'
-interface Props {
+defineProps<{
data: any[]
paginationMeta: PaginationMeta
-}
-
-defineProps()
+}>()
const emit = defineEmits<{
pageChange: [page: number]
@@ -28,7 +26,7 @@ function handlePageChange(page: number) {
diff --git a/app/components/content/device-order/list.vue b/app/components/content/device-order/list.vue
index 1d0bd0fa..6c23cfc0 100644
--- a/app/components/content/device-order/list.vue
+++ b/app/components/content/device-order/list.vue
@@ -32,21 +32,18 @@ import {
handleCancelForm,
} from '~/handlers/device-order.handler'
-//
-import { getList } from '~/services/device-order.service'
-
-// Props
-interface Props {
- encounter_id: number
-}
-const props = defineProps()
+// Services
+import { getList, getDetail } from '~/services/device-order.service'
const route = useRoute()
-const title = ref('')
+const { setQueryParams } = useQueryParam()
+
+const plainEid = route.params.id
+const encounter_id = (plainEid && typeof plainEid == 'string') ? parseInt(plainEid) : 0
// const { mode, openForm, backToList } = useQueryMode()
const { mode, goToEntry, backToList } = useQueryCRUDMode()
-const { recordId } = useQueryCRUDRecordId()
+// const { recordId } = useQueryCRUDRecordId()
const {
data,
@@ -59,18 +56,18 @@ const {
} = usePaginatedList({
fetchFn: async (params: any) => {
const result = await getList({
+ 'encounter-id': encounter_id,
search: params.search,
- sort: 'createdAt:asc',
+ includes: 'doctor,doctor-employee,doctor-employee-person,items',
'page-number': params['page-number'] || 0,
'page-size': params['page-size'] || 10,
- // includes: 'encounter',
- includes: 'parent,childrens',
})
return { success: result.success || false, body: result.body || {} }
},
entityName: 'device-order',
})
+const voidFn = () => {}
const headerPrep: HeaderPrep = {
title: 'Order Alkes',
icon: 'i-lucide-box',
@@ -89,19 +86,18 @@ const headerPrep: HeaderPrep = {
label: 'Tambah',
icon: 'i-lucide-plus',
onClick: async () => {
- const data = {
- encounter_id: props.encounter_id,
- }
- const dateResp = await handleActionSave(data, getMyList, () => {}, () => {})
- if (dateResp.success) {
- const currentData = dateResp.body.data || []
- // goToEntry()
- }
recItem.value = null
recId.value = 0
isReadonly.value = false
+ const saveResp = await handleActionSave({ encounter_id }, voidFn, voidFn, voidFn)
+ if (saveResp.success) {
+ setQueryParams({
+ 'mode': 'entry',
+ 'id': saveResp.body?.data?.id.toString()
+ })
+ }
// await handleActionSave(recItem, getMyList, () => {}, () => {})
- goToEntry()
+ // goToEntry()
},
},
}
@@ -111,10 +107,66 @@ provide('rec_action', recAction)
provide('rec_item', recItem)
provide('table_data_loader', isLoading)
-// Watch for row actions when recId or recAction changes
-onMounted(async () => {
- await getMyList()
+watch([recId, recAction], () => {
+ switch (recAction.value) {
+ case ActionEvents.showDetail:
+ getMyDetail(recId.value)
+ isReadonly.value = true
+ break
+ case ActionEvents.showEdit:
+ getMyDetail(recId.value)
+ isReadonly.value = false
+ break
+ case ActionEvents.showConfirmDelete:
+ break
+ }
})
+
+// watch([isFormEntryDialogOpen], async () => {
+// if (isFormEntryDialogOpen.value) {
+// isFormEntryDialogOpen.value = false;
+// const saveResp = await handleActionSave({ encounter_id }, getMyList, () =>{}, toast)
+// if (saveResp.success) {
+// setQueryParams({
+// 'mode': 'entry',
+// 'id': saveResp.body?.data?.id.toString()
+// })
+// }
+// }
+// })
+
+// Watch for row actions when recId or recAction changes
+// onMounted(async () => {
+// await getMyList()
+// })
+
+// Functions
+const getMyDetail = async (id: number | string) => {
+ const result = await getDetail(id)
+ if (result.success) {
+ const currentValue = result.body?.data || {}
+ recItem.value = currentValue
+ isFormEntryDialogOpen.value = true
+ }
+}
+
+function cancel(data: DeviceOrder) {
+ recId.value = data.id
+ recItem.value = data
+ isRecordConfirmationOpen.value = true
+}
+
+function edit(data: DeviceOrder) {
+ setQueryParams({
+ 'mode': 'entry',
+ 'id': data.id.toString()
+ })
+ recItem.value = data
+}
+
+function submit(data: DeviceOrder) {
+}
+
@@ -127,8 +179,12 @@ onMounted(async () => {
/>
diff --git a/app/models/device-order.ts b/app/models/device-order.ts
index 884340c5..f2e88b0f 100644
--- a/app/models/device-order.ts
+++ b/app/models/device-order.ts
@@ -1,9 +1,11 @@
import { type Base, genBase } from "./_base"
+import type { DeviceOrderItem } from "./device-order-item"
export interface DeviceOrder extends Base {
encounter_id: number
doctor_id: number
status_code?: string
+ items: DeviceOrderItem[]
}
export function genDeviceOrder(): DeviceOrder {
@@ -11,5 +13,6 @@ export function genDeviceOrder(): DeviceOrder {
...genBase(),
encounter_id: 0,
doctor_id: 0,
+ items: []
}
}
From 0da8701a6c725e283a23c6ce69b52b30644bab74 Mon Sep 17 00:00:00 2001
From: Andrian Roshandy
Date: Sun, 16 Nov 2025 08:15:19 +0700
Subject: [PATCH 18/35] feat/prescription: added group and flat list
---
.../app/prescription-item/mix-entry.vue | 2 +-
.../app/prescription-item/non-mix-entry.vue | 2 +-
app/components/app/prescription/flat-list.vue | 88 +++++++++++++++++
.../{list.vue => grouped-list.vue} | 0
app/components/content/prescription/list.vue | 94 +++++++++++++++----
.../pub/my-ui/data-table/data-table.vue | 4 +-
6 files changed, 168 insertions(+), 22 deletions(-)
create mode 100644 app/components/app/prescription/flat-list.vue
rename app/components/app/prescription/{list.vue => grouped-list.vue} (100%)
diff --git a/app/components/app/prescription-item/mix-entry.vue b/app/components/app/prescription-item/mix-entry.vue
index 187e9569..5a3c74fd 100644
--- a/app/components/app/prescription-item/mix-entry.vue
+++ b/app/components/app/prescription-item/mix-entry.vue
@@ -29,7 +29,7 @@ const emit = defineEmits<{
}>()
watch(medicines, (data) => {
- medicineItems.value = CB.objectsToItem(data, 'code', 'name')
+ medicineItems.value = CB.objectsToItems(data, 'code', 'name')
})
function navClick(type: ClickType) {
diff --git a/app/components/app/prescription-item/non-mix-entry.vue b/app/components/app/prescription-item/non-mix-entry.vue
index 9115eeb9..90cf3e01 100644
--- a/app/components/app/prescription-item/non-mix-entry.vue
+++ b/app/components/app/prescription-item/non-mix-entry.vue
@@ -48,7 +48,7 @@ const emit = defineEmits<{
}>()
watch(medicines, (data) => {
- medicineItems.value = CB.objectsToItem(data, 'code', 'name')
+ medicineItems.value = CB.objectsToItems(data, 'code', 'name')
})
function navClick(type: ClickType) {
diff --git a/app/components/app/prescription/flat-list.vue b/app/components/app/prescription/flat-list.vue
new file mode 100644
index 00000000..cf563ef2
--- /dev/null
+++ b/app/components/app/prescription/flat-list.vue
@@ -0,0 +1,88 @@
+
+
+
+
+
Belum Ada Data
+
+
+
+ Tambah Order
+
+
+
+
+
+
+ Tgl Order
+ DPJP
+ PPDS
+ Jenis Obat
+ Status
+
+
+
+
+
+
+ {{ item.issuedAt?.substring(0, 10) || item.createdAt?.substring(0, 10) }}
+
+
+ {{ item.doctor?.employee?.person?.name || '-' }}
+
+
+
+
+
+ Racikan: {{ item.items.filter(function(element){ return element.isMix}).length }}
+
+
+ Non Racikan: {{ item.items.filter(function(element){ return !element.isMix}).length }}
+
+
+
+ {{ item.status_code }}
+
+
+ { navClick(type, item) }"
+ />
+
+
+
+
+
+
+
diff --git a/app/components/app/prescription/list.vue b/app/components/app/prescription/grouped-list.vue
similarity index 100%
rename from app/components/app/prescription/list.vue
rename to app/components/app/prescription/grouped-list.vue
diff --git a/app/components/content/prescription/list.vue b/app/components/content/prescription/list.vue
index 5042a74b..9447a748 100644
--- a/app/components/content/prescription/list.vue
+++ b/app/components/content/prescription/list.vue
@@ -1,6 +1,8 @@
- Nama
-
-
-
+ Nama
+
+
+
- Frequensi
-
+ Frequensi
+
- Dosis
-
+ Dosis
+
- Sediaan
-
+ Sediaan
+
- Total
-
+ Total
+
- Cara Pakai
-
+ Cara Pakai
+
Daftar Obat
@@ -91,20 +94,29 @@ function searchMedicineText(value: string) {
Nama
Dosis
- Satuan
- ..
+
+
-
+
-
+
-
+
+
+
+
+
diff --git a/app/components/app/prescription-item/non-mix-entry.vue b/app/components/app/prescription-item/non-mix-entry.vue
index 90cf3e01..78ee9ada 100644
--- a/app/components/app/prescription-item/non-mix-entry.vue
+++ b/app/components/app/prescription-item/non-mix-entry.vue
@@ -6,7 +6,7 @@ import * as CB from '~/components/pub/my-ui/combobox'
// import { bigTimeUnitCodes } from '~/lib/constants'
-import { type Medicine, genMedicine } from '~/models/medicine';
+import { type Medicine } from '~/models/medicine';
import type { PrescriptionItem } from '~/models/prescription-item'
const props = defineProps<{
@@ -20,7 +20,6 @@ const medicineForm = computed(() => {
const medicine = props.medicines.find(m => m.code === props.data.medicine_code)
return medicine ? medicine.medicineForm?.name : '--tidak diketahui--'
})
-// const selectedMedicine_code = ref(props.data.medicine_code || '')
type ClickType = 'close' | 'save'
type Item = {
@@ -28,19 +27,10 @@ type Item = {
label: string
}
-const bigTimeUnitCodeItems: Item[] = []
-
if(!props.data.intervalUnit_code) {
props.data.intervalUnit_code = 'day'
}
-// Object.keys(bigTimeUnitCodes).forEach((key) => {
-// bigTimeUnitCodeItems.push({
-// value: key,
-// label: bigTimeUnitCodes[key] || '',
-// })
-// })
-
const emit = defineEmits<{
close: [],
save: [data: PrescriptionItem],
@@ -105,7 +95,7 @@ function searchMedicineText(value: string) {
Cara Pakai
-
+
diff --git a/app/components/app/prescription/entry.vue b/app/components/app/prescription/entry.vue
index ef8756e8..af59a87d 100644
--- a/app/components/app/prescription/entry.vue
+++ b/app/components/app/prescription/entry.vue
@@ -1,17 +1,25 @@
+
+
-
+
Tgl Order
-
+
Status
-
+
@@ -21,13 +29,13 @@
DPJP
-
+
PPDS
-
+
diff --git a/app/components/content/prescription/entry.vue b/app/components/content/prescription/entry.vue
index 3ad9d572..46768432 100644
--- a/app/components/content/prescription/entry.vue
+++ b/app/components/content/prescription/entry.vue
@@ -1,112 +1,216 @@
@@ -116,20 +220,49 @@ async function getMedicines(value: string) {
class="mb-4 xl:mb-5"
/>
-
+
+
+
+
+
+
+
+
+
+
+
@@ -137,24 +270,97 @@ async function getMedicines(value: string) {
:data="mixItem"
:items="medicinemixItems"
:medicines="medicines"
- @close="mixDialogOpen = false"
+ @close="mixDialogOpenStatus = false"
@save="saveMix"
@update:searchText="getMedicines"
/>
+
+
+
+
+
+
+ Nama
+
+
+ {{ recItem.medicine.name }}
+
+
+
+ Dosis
+
+
+ {{ recItem.dose }}
+
+
+
+ Sediaan
+
+
+ {{ recItem.medicine.medicineForm.name }}
+
+
+
+ Jumlah
+
+
+ {{ recItem.quantity }}
+
+
+
+ Cara Pakai
+
+
+ {{ recItem.Usage }}
+
+
+
+
+
+
+ handleActionRemove(recId, getPrescriptionItems, toast)"
+ @cancel=""
+ >
+
+
+
+ ID:
+ {{ record?.id }}
+
+
+ Nama:
+ {{ record.name }}
+
+
+ Kode:
+ {{ record.code }}
+
+
+
+
diff --git a/app/components/content/prescription/list.vue b/app/components/content/prescription/list.vue
index 9447a748..753c6885 100644
--- a/app/components/content/prescription/list.vue
+++ b/app/components/content/prescription/list.vue
@@ -4,7 +4,7 @@ import { usePaginatedList } from '~/composables/usePaginatedList'
// Pubs component
import { toast } from '~/components/pub/ui/toast'
-import { ActionEvents, type HeaderPrep } from '~/components/pub/my-ui/data/types'
+import { type HeaderPrep } from '~/components/pub/my-ui/data/types'
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
@@ -14,7 +14,6 @@ import {
recAction,
recItem,
isReadonly,
- isFormEntryDialogOpen,
isRecordConfirmationOpen,
handleActionRemove,
handleActionSave,
@@ -112,68 +111,6 @@ provide('rec_action', recAction)
provide('rec_item', recItem)
provide('table_data_loader', isLoading)
-// Watch for row actions when recId or recAction changes
-watch([recId, recAction], () => {
- switch (recAction.value) {
- case ActionEvents.showDetail:
- getMyDetail(recId.value)
- isReadonly.value = true
- break
- case ActionEvents.showEdit:
- getMyDetail(recId.value)
- isReadonly.value = false
- break
- case ActionEvents.showConfirmDelete:
- break
- }
-})
-
-// watch([isFormEntryDialogOpen], async () => {
-// if (isFormEntryDialogOpen.value) {
-// }
-// })
-
-// Functions
-const getMyDetail = async (id: number | string) => {
- const result = await getDetail(id)
- if (result.success) {
- const currentValue = result.body?.data || {}
- recItem.value = currentValue
- isFormEntryDialogOpen.value = true
- }
-}
-
-// Watch for row actions when recId or recAction changes
-watch([recId, recAction], () => {
- switch (recAction.value) {
- case ActionEvents.showDetail:
- getMyDetail(recId.value)
- title.value = 'Detail Konsultasi'
- isReadonly.value = true
- break
- case ActionEvents.showEdit:
- getMyDetail(recId.value)
- title.value = 'Edit Konsultasi'
- isReadonly.value = false
- break
- case ActionEvents.showConfirmDelete:
- break
- }
-})
-
-watch([isFormEntryDialogOpen], async () => {
- if (isFormEntryDialogOpen.value) {
- isFormEntryDialogOpen.value = false;
- const saveResp = await handleActionSave({ encounter_id }, getMyList, () =>{}, toast)
- if (saveResp.success) {
- setQueryParams({
- 'mode': 'entry',
- 'id': saveResp.body?.data?.id.toString()
- })
- }
- }
-})
-
function confirmCancel(data: Prescription) {
recId.value = data.id
recItem.value = data
@@ -235,15 +172,15 @@ async function handleActionSubmit(id: number, refresh: () => void, toast: ToastF
@confirm="() => handleActionRemove(recId, getMyList, toast)"
@cancel=""
>
-
-
Tanggal
-
:
-
:
+
+
Tanggal
+
:
+
{{ recItem.createdAt.substring(0, 10) }}
-
Tanggal
-
:
-
:
+
DPJP
+
:
+
{{ recItem.doctor?.employee?.person?.name }}
@@ -257,5 +194,15 @@ async function handleActionSubmit(id: number, refresh: () => void, toast: ToastF
@confirm="() => handleActionSubmit(recId, getMyList, toast)"
@cancel=""
>
+
+
Tanggal
+
:
+
{{ recItem.createdAt.substring(0, 10) }}
+
+
+
DPJP
+
:
+
{{ recItem.doctor?.employee?.person?.name }}
+
From dc0bcc36066591ee157ad4b6b0bd78b50164e174 Mon Sep 17 00:00:00 2001
From: hasyim_kai
Date: Mon, 17 Nov 2025 09:26:29 +0700
Subject: [PATCH 20/35] Feat: integration Medicine Form
---
.../app/medicine-form/entry-form.vue | 119 ++++++
app/components/app/medicine-form/list-cfg.ts | 38 ++
app/components/app/medicine-form/list.vue | 35 ++
app/components/app/medicine/entry-form.vue | 20 +
app/components/app/medicine/list-cfg.ts | 6 +-
app/components/content/medicine-form/list.vue | 193 +++++++++
app/components/content/medicine/list.vue | 6 +-
app/handlers/medicine-form.handler.ts | 21 +
app/models/medicine-form.ts | 38 ++
.../medicine-form/index.vue | 38 ++
.../tools-equipment-src/medicine/index.vue | 8 +-
app/schemas/medicine.schema.ts | 1 +
app/services/medicine-form.service.ts | 41 ++
public/side-menu-items/sys.json | 367 ++++++++++++++++++
public/side-menu-items/system.json | 4 +
15 files changed, 929 insertions(+), 6 deletions(-)
create mode 100644 app/components/app/medicine-form/entry-form.vue
create mode 100644 app/components/app/medicine-form/list-cfg.ts
create mode 100644 app/components/app/medicine-form/list.vue
create mode 100644 app/components/content/medicine-form/list.vue
create mode 100644 app/handlers/medicine-form.handler.ts
create mode 100644 app/models/medicine-form.ts
create mode 100644 app/pages/(features)/tools-equipment-src/medicine-form/index.vue
create mode 100644 app/services/medicine-form.service.ts
create mode 100644 public/side-menu-items/sys.json
diff --git a/app/components/app/medicine-form/entry-form.vue b/app/components/app/medicine-form/entry-form.vue
new file mode 100644
index 00000000..fb26631e
--- /dev/null
+++ b/app/components/app/medicine-form/entry-form.vue
@@ -0,0 +1,119 @@
+
+
+
+
+
+
+ Kode
+
+
+
+ |
+
+ Nama
+
+
+
+ |
+
+
+
+ Kembali
+
+
+ Simpan
+
+
+
+
diff --git a/app/components/app/medicine-form/list-cfg.ts b/app/components/app/medicine-form/list-cfg.ts
new file mode 100644
index 00000000..5b66812a
--- /dev/null
+++ b/app/components/app/medicine-form/list-cfg.ts
@@ -0,0 +1,38 @@
+import type { Config, RecComponent } from '~/components/pub/my-ui/data-table'
+import { defineAsyncComponent } from 'vue'
+
+const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-ud.vue'))
+
+export const config: Config = {
+ cols: [{}, {}, { width: 50 }],
+
+ headers: [
+ [
+ { label: 'Kode' },
+ { label: 'Nama' },
+ { label: 'Aksi' },
+ ],
+ ],
+
+ keys: ['code', 'name', 'action'],
+
+ delKeyNames: [
+ { key: 'code', label: 'Kode' },
+ { key: 'name', label: 'Nama' },
+ ],
+
+ parses: {},
+
+ components: {
+ action(rec, idx) {
+ const res: RecComponent = {
+ idx,
+ rec: rec as object,
+ component: action,
+ }
+ return res
+ },
+ },
+
+ htmls: {},
+}
diff --git a/app/components/app/medicine-form/list.vue b/app/components/app/medicine-form/list.vue
new file mode 100644
index 00000000..e4544c2f
--- /dev/null
+++ b/app/components/app/medicine-form/list.vue
@@ -0,0 +1,35 @@
+
+
+
+
+
diff --git a/app/components/app/medicine/entry-form.vue b/app/components/app/medicine/entry-form.vue
index 42989fcb..af4df34f 100644
--- a/app/components/app/medicine/entry-form.vue
+++ b/app/components/app/medicine/entry-form.vue
@@ -18,6 +18,7 @@ interface Props {
isReadonly?: boolean
medicineGroups?: { value: string; label: string }[]
medicineMethods?: { value: string; label: string }[]
+ medicineForms?: { value: string; label: string }[]
uoms?: { value: string; label: string }[]
}
@@ -36,6 +37,7 @@ const { defineField, errors, meta } = useForm({
name: '',
medicineGroup_code: '',
medicineMethod_code: '',
+ medicineForm_code: '',
uom_code: '',
stock: 0,
},
@@ -45,6 +47,7 @@ const [code, codeAttrs] = defineField('code')
const [name, nameAttrs] = defineField('name')
const [medicineGroup_code, medicineGroupAttrs] = defineField('medicineGroup_code')
const [medicineMethod_code, medicineMethodAttrs] = defineField('medicineMethod_code')
+const [medicineForm_code, medicineFormAttrs] = defineField('medicineForm_code')
const [uom_code, uomAttrs] = defineField('uom_code')
const [stock, stockAttrs] = defineField('stock')
@@ -53,6 +56,7 @@ if (props.values) {
if (props.values.name !== undefined) name.value = props.values.name
if (props.values.medicineGroup_code !== undefined) medicineGroup_code.value = props.values.medicineGroup_code
if (props.values.medicineMethod_code !== undefined) medicineMethod_code.value = props.values.medicineMethod_code
+ if (props.values.medicineForm_code !== undefined) medicineForm_code.value = props.values.medicineForm_code
if (props.values.uom_code !== undefined) uom_code.value = props.values.uom_code
if (props.values.stock !== undefined) stock.value = props.values.stock
}
@@ -62,6 +66,7 @@ const resetForm = () => {
name.value = ''
medicineGroup_code.value = ''
medicineMethod_code.value = ''
+ medicineForm_code.value = '',
uom_code.value = ''
stock.value = 0
}
@@ -72,6 +77,7 @@ function onSubmitForm() {
name: name.value || '',
medicineGroup_code: medicineGroup_code.value || '',
medicineMethod_code: medicineMethod_code.value || '',
+ medicineForm_code: medicineForm_code.value || '',
uom_code: uom_code.value || '',
stock: stock.value || 0,
}
@@ -138,6 +144,20 @@ function onCancelForm() {
/>
+
+ Sediaan Obat
+
+
+
+ |
Satuan
diff --git a/app/components/app/medicine/list-cfg.ts b/app/components/app/medicine/list-cfg.ts
index 059022c8..5d1740f8 100644
--- a/app/components/app/medicine/list-cfg.ts
+++ b/app/components/app/medicine/list-cfg.ts
@@ -15,12 +15,13 @@ export const config: Config = {
{ label: 'Golongan' },
{ label: 'Metode Pemberian' },
{ label: 'Satuan' },
+ { label: 'Sediaan' },
{ label: 'Stok' },
{ label: 'Aksi' },
],
],
- keys: ['code', 'name', 'group', 'method', 'unit', 'stock', 'action'],
+ keys: ['code', 'name', 'group', 'method', 'unit', 'form', 'stock', 'action'],
delKeyNames: [
{ key: 'code', label: 'Kode' },
@@ -37,6 +38,9 @@ export const config: Config = {
unit: (rec: unknown): unknown => {
return (rec as SmallDetailDto).uom?.name || '-'
},
+ form: (rec: unknown): unknown => {
+ return (rec as SmallDetailDto).medicineForm?.name || '-'
+ },
},
components: {
diff --git a/app/components/content/medicine-form/list.vue b/app/components/content/medicine-form/list.vue
new file mode 100644
index 00000000..1ca9eefe
--- /dev/null
+++ b/app/components/content/medicine-form/list.vue
@@ -0,0 +1,193 @@
+
+
+
+
+
+
+
+ {
+ onResetState()
+ isFormEntryDialogOpen = value
+ }
+ "
+ >
+ , resetForm: () => void) => {
+ if (recId > 0) {
+ handleActionEdit(recItem.code, values, getMedicineFormList, resetForm, toast)
+ return
+ }
+ handleActionSave(values, getMedicineFormList, resetForm, toast)
+ }
+ "
+ @cancel="handleCancelForm"
+ />
+
+
+
+ handleActionRemove(recItem.code, getMedicineFormList, toast)"
+ @cancel=""
+ >
+
+
+
+ ID:
+ {{ record?.id }}
+
+
+ Nama:
+ {{ record.name }}
+
+
+ Kode:
+ {{ record.code }}
+
+
+
+
+
diff --git a/app/components/content/medicine/list.vue b/app/components/content/medicine/list.vue
index 27470776..43667c33 100644
--- a/app/components/content/medicine/list.vue
+++ b/app/components/content/medicine/list.vue
@@ -37,10 +37,12 @@ import {
import { getList, getDetail } from '~/services/medicine.service'
import { getValueLabelList as getMedicineGroupList } from '~/services/medicine-group.service'
import { getValueLabelList as getMedicineMethodList } from '~/services/medicine-method.service'
+import { getValueLabelList as getMedicineFormList } from '~/services/medicine-form.service'
import { getValueLabelList as getUomList } from '~/services/uom.service'
const medicineGroups = ref<{ value: string; label: string }[]>([])
const medicineMethods = ref<{ value: string; label: string }[]>([])
+const medicineForms = ref<{ value: string; label: string }[]>([])
const uoms = ref<{ value: string; label: string }[]>([])
const title = ref('')
@@ -59,7 +61,7 @@ const {
sort: 'createdAt:asc',
'page-number': params['page-number'] || 0,
'page-size': params['page-size'] || 10,
- includes: 'medicineGroup,medicineMethod,uom',
+ includes: 'medicineGroup,medicineMethod,medicineForm,uom',
})
return { success: result.success || false, body: result.body || {} }
},
@@ -127,6 +129,7 @@ watch([recId, recAction], () => {
onMounted(async () => {
medicineGroups.value = await getMedicineGroupList({ sort: 'createdAt:asc', 'page-size': 100 })
medicineMethods.value = await getMedicineMethodList({ sort: 'createdAt:asc', 'page-size': 100 })
+ medicineForms.value = await getMedicineFormList({ sort: 'createdAt:asc', 'page-size': 100 })
uoms.value = await getUomList({ sort: 'createdAt:asc', 'page-size': 100 })
await getMedicineList()
})
@@ -163,6 +166,7 @@ onMounted(async () => {
:values="recItem"
:medicineGroups="medicineGroups"
:medicineMethods="medicineMethods"
+ :medicineForms="medicineForms"
:uoms="uoms"
:is-loading="isProcessing"
:is-readonly="isReadonly"
diff --git a/app/handlers/medicine-form.handler.ts b/app/handlers/medicine-form.handler.ts
new file mode 100644
index 00000000..6fcadb4c
--- /dev/null
+++ b/app/handlers/medicine-form.handler.ts
@@ -0,0 +1,21 @@
+import { createCrudHandler } from '~/handlers/_handler'
+import { create, update, remove } from '~/services/medicine-form.service'
+
+export const {
+ recId,
+ recAction,
+ recItem,
+ isReadonly,
+ isProcessing,
+ isFormEntryDialogOpen,
+ isRecordConfirmationOpen,
+ onResetState,
+ handleActionSave,
+ handleActionEdit,
+ handleActionRemove,
+ handleCancelForm,
+} = createCrudHandler({
+ post: create,
+ patch: update,
+ remove: remove,
+})
diff --git a/app/models/medicine-form.ts b/app/models/medicine-form.ts
new file mode 100644
index 00000000..8ca21a2b
--- /dev/null
+++ b/app/models/medicine-form.ts
@@ -0,0 +1,38 @@
+import { type Base, genBase } from "./_base"
+
+export interface MedicineForm extends Base {
+ name: string
+ code: string
+}
+
+export interface CreateDto {
+ name: string
+ code: string
+}
+
+export interface GetListDto {
+ page: number
+ size: number
+ name?: string
+ code?: string
+}
+
+export interface GetDetailDto {
+ id?: string
+}
+
+export interface UpdateDto extends CreateDto {
+ id?: number
+}
+
+export interface DeleteDto {
+ id?: string
+}
+
+export function genMedicine(): MedicineForm {
+ return {
+ ...genBase(),
+ name: 'name',
+ code: 'code',
+ }
+}
diff --git a/app/pages/(features)/tools-equipment-src/medicine-form/index.vue b/app/pages/(features)/tools-equipment-src/medicine-form/index.vue
new file mode 100644
index 00000000..120df6ea
--- /dev/null
+++ b/app/pages/(features)/tools-equipment-src/medicine-form/index.vue
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
diff --git a/app/pages/(features)/tools-equipment-src/medicine/index.vue b/app/pages/(features)/tools-equipment-src/medicine/index.vue
index 2be85f63..33f16618 100644
--- a/app/pages/(features)/tools-equipment-src/medicine/index.vue
+++ b/app/pages/(features)/tools-equipment-src/medicine/index.vue
@@ -22,12 +22,12 @@ const { checkRole, hasReadAccess } = useRBAC()
// Check if user has access to this page
const hasAccess = checkRole(roleAccess)
-if (!hasAccess) {
- navigateTo('/403')
-}
+// if (!hasAccess) {
+// navigateTo('/403')
+// }
// Define permission-based computed properties
-const canRead = hasReadAccess(roleAccess)
+const canRead = true // hasReadAccess(roleAccess)
diff --git a/app/schemas/medicine.schema.ts b/app/schemas/medicine.schema.ts
index 44113777..6443be36 100644
--- a/app/schemas/medicine.schema.ts
+++ b/app/schemas/medicine.schema.ts
@@ -5,6 +5,7 @@ export const MedicineSchema = z.object({
name: z.string({ required_error: 'Nama harus diisi' }).min(1, 'Nama minimal 1 karakter'),
medicineGroup_code: z.string({ required_error: 'Kelompok obat harus diisi' }).min(1, 'Kelompok obat harus diisi'),
medicineMethod_code: z.string({ required_error: 'Metode pemberian harus diisi' }).min(1, 'Metode pemberian harus diisi'),
+ medicineForm_code: z.string({ required_error: 'Sediaan Obat harus diisi' }).min(1, 'Sediaan Obat harus diisi'),
uom_code: z.string({ required_error: 'Satuan harus diisi' }).min(1, 'Satuan harus diisi'),
infra_id: z.number().nullable().optional(),
stock: z.preprocess((val) => Number(val), z.number({ invalid_type_error: 'Stok harus berupa angka' }).min(1, 'Stok harus lebih besar dari 0')),
diff --git a/app/services/medicine-form.service.ts b/app/services/medicine-form.service.ts
new file mode 100644
index 00000000..21874f5c
--- /dev/null
+++ b/app/services/medicine-form.service.ts
@@ -0,0 +1,41 @@
+// Base
+import * as base from './_crud-base'
+
+// Types
+import type { MedicineForm } from '~/models/medicine-form'
+
+const path = '/api/v1/medicine-form'
+const name = 'medicine-form'
+
+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) {
+ return base.getDetail(path, id, name)
+}
+
+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)
+}
+
+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: MedicineForm) => ({
+ value: item.code,
+ label: item.name,
+ }))
+ }
+ return data
+}
diff --git a/public/side-menu-items/sys.json b/public/side-menu-items/sys.json
new file mode 100644
index 00000000..700cc4b7
--- /dev/null
+++ b/public/side-menu-items/sys.json
@@ -0,0 +1,367 @@
+[
+ {
+ "heading": "Menu Utama",
+ "items": [
+ {
+ "title": "Dashboard",
+ "icon": "i-lucide-home",
+ "link": "/"
+ },
+ {
+ "title": "Rawat Jalan",
+ "icon": "i-lucide-stethoscope",
+ "children": [
+ {
+ "title": "Antrian Pendaftaran",
+ "link": "/outpatient/registration-queue"
+ },
+ {
+ "title": "Antrian Poliklinik",
+ "link": "/outpatient/polyclinic-queue"
+ },
+ {
+ "title": "Kunjungan",
+ "link": "/outpatient/encounter"
+ },
+ {
+ "title": "Konsultasi",
+ "link": "/outpatient/consultation"
+ }
+ ]
+ },
+ {
+ "title": "IGD",
+ "icon": "i-lucide-zap",
+ "children": [
+ {
+ "title": "Triase",
+ "link": "/emergency/triage"
+ },
+ {
+ "title": "Kunjungan",
+ "link": "/emergency/encounter"
+ },
+ {
+ "title": "Konsultasi",
+ "link": "/emergency/consultation"
+ }
+ ]
+ },
+ {
+ "title": "Rehab Medik",
+ "icon": "i-lucide-bike",
+ "children": [
+ {
+ "title": "Antrean Pendaftaran",
+ "link": "/rehab/registration-queue"
+ },
+ {
+ "title": "Antrean Poliklinik",
+ "link": "/rehab/polyclinic-queue"
+ },
+ {
+ "title": "Kunjungan",
+ "link": "/rehab/encounter"
+ },
+ {
+ "title": "Konsultasi",
+ "link": "/rehab/consultation"
+ }
+ ]
+ },
+ {
+ "title": "Rawat Inap",
+ "icon": "i-lucide-building-2",
+ "children": [
+ {
+ "title": "Permintaan",
+ "link": "/inpatient/request"
+ },
+ {
+ "title": "Kunjungan",
+ "link": "/inpatient/encounter"
+ },
+ {
+ "title": "Konsultasi",
+ "link": "/inpatient/consultation"
+ }
+ ]
+ },
+ {
+ "title": "Obat - Order",
+ "icon": "i-lucide-briefcase-medical",
+ "children": [
+ {
+ "title": "Permintaan",
+ "link": "/medication/order"
+ },
+ {
+ "title": "Standing Order",
+ "link": "/medication/standing-order"
+ }
+ ]
+ },
+ {
+ "title": "Lab - Order",
+ "icon": "i-lucide-microscope",
+ "link": "/pc-lab-order"
+ },
+ {
+ "title": "Lab Mikro - Order",
+ "icon": "i-lucide-microscope",
+ "link": "/micro-lab-order"
+ },
+ {
+ "title": "Lab PA - Order",
+ "icon": "i-lucide-microscope",
+ "link": "/pa-lab-order"
+ },
+ {
+ "title": "Radiologi - Order",
+ "icon": "i-lucide-radio",
+ "link": "/radiology-order"
+ },
+ {
+ "title": "Gizi",
+ "icon": "i-lucide-egg-fried",
+ "link": "/nutrition-order"
+ },
+ {
+ "title": "Pembayaran",
+ "icon": "i-lucide-banknote-arrow-up",
+ "link": "/payment"
+ }
+ ]
+ },
+ {
+ "heading": "Ruang Tindakan Rajal",
+ "items": [
+ {
+ "title": "Kemoterapi",
+ "icon": "i-lucide-droplets",
+ "link": "/outpation-action/cemotherapy"
+ },
+ {
+ "title": "Hemofilia",
+ "icon": "i-lucide-droplet-off",
+ "link": "/outpation-action/hemophilia"
+ }
+ ]
+ },
+ {
+ "heading": "Ruang Tindakan Anak",
+ "items": [
+ {
+ "title": "Thalasemi",
+ "icon": "i-lucide-baby",
+ "link": "/children-action/thalasemia"
+ },
+ {
+ "title": "Echocardiography",
+ "icon": "i-lucide-baby",
+ "link": "/children-action/echocardiography"
+ },
+ {
+ "title": "Spirometri",
+ "icon": "i-lucide-baby",
+ "link": "/children-action/spirometry"
+ }
+ ]
+ },
+ {
+ "heading": "Client",
+ "items": [
+ {
+ "title": "Pasien",
+ "icon": "i-lucide-users",
+ "link": "/client/patient"
+ },
+ {
+ "title": "Rekam Medis",
+ "icon": "i-lucide-file-text",
+ "link": "/client/medical-record"
+ }
+ ]
+ },
+ {
+ "heading": "Integrasi",
+ "items": [
+ {
+ "title": "BPJS",
+ "icon": "i-lucide-circuit-board",
+ "children": [
+ {
+ "title": "SEP",
+ "icon": "i-lucide-circuit-board",
+ "link": "/integration/bpjs/sep"
+ },
+ {
+ "title": "Peserta",
+ "icon": "i-lucide-circuit-board",
+ "link": "/integration/bpjs/member"
+ }
+ ]
+ },
+ {
+ "title": "SATUSEHAT",
+ "icon": "i-lucide-database",
+ "link": "/integration/satusehat"
+ }
+ ]
+ },
+ {
+ "heading": "Source",
+ "items": [
+ {
+ "title": "Peralatan dan Perlengkapan",
+ "icon": "i-lucide-layout-dashboard",
+ "children": [
+ {
+ "title": "Obat",
+ "link": "/tools-equipment-src/medicine"
+ },
+ {
+ "title": "Peralatan",
+ "link": "/tools-equipment-src/tools"
+ },
+ {
+ "title": "Perlengkapan (BMHP)",
+ "link": "/tools-equipment-src/equipment"
+ },
+ {
+ "title": "Metode Obat",
+ "link": "/tools-equipment-src/medicine-method"
+ },
+ {
+ "title": "Jenis Obat",
+ "link": "/tools-equipment-src/medicine-type"
+ },
+ {
+ "title": "Sediaan Obat",
+ "link": "/tools-equipment-src/medicine-form"
+ }
+ ]
+ },
+ {
+ "title": "Pengguna",
+ "icon": "i-lucide-user",
+ "children": [
+ {
+ "title": "Pegawai",
+ "link": "/human-src/employee"
+ },
+ {
+ "title": "PPDS",
+ "link": "/human-src/specialist-intern"
+ }
+ ]
+ },
+ {
+ "title": "Pemeriksaan Penunjang",
+ "icon": "i-lucide-layout-list",
+ "children": [
+ {
+ "title": "Checkup",
+ "link": "/mcu-src/mcu"
+ },
+ {
+ "title": "Prosedur",
+ "link": "/mcu-src/procedure"
+ },
+ {
+ "title": "Diagnosis",
+ "link": "/mcu-src/diagnose"
+ },
+ {
+ "title": "Medical Action",
+ "link": "/mcu-src/medical-action"
+ }
+ ]
+ },
+ {
+ "title": "Layanan",
+ "icon": "i-lucide-layout-list",
+ "children": [
+ {
+ "title": "Counter",
+ "link": "/service-src/counter"
+ },
+ {
+ "title": "Public Screen (Big Screen)",
+ "link": "/service-src/public-screen"
+ },
+ {
+ "title": "Kasur",
+ "link": "/service-src/bed"
+ },
+ {
+ "title": "Kamar",
+ "link": "/service-src/chamber"
+ },
+ {
+ "title": "Ruang",
+ "link": "/service-src/room"
+ },
+ {
+ "title": "Depo",
+ "link": "/service-src/warehouse"
+ },
+ {
+ "title": "Lantai",
+ "link": "/service-src/floor"
+ },
+ {
+ "title": "Gedung",
+ "link": "/service-src/building"
+ }
+ ]
+ },
+ {
+ "title": "Organisasi",
+ "icon": "i-lucide-network",
+ "children": [
+ {
+ "title": "Divisi",
+ "link": "/org-src/division"
+ },
+ {
+ "title": "Instalasi",
+ "link": "/org-src/installation"
+ },
+ {
+ "title": "Unit",
+ "link": "/org-src/unit"
+ },
+ {
+ "title": "Spesialis",
+ "link": "/org-src/specialist"
+ },
+ {
+ "title": "Sub Spesialis",
+ "link": "/org-src/subspecialist"
+ }
+ ]
+ },
+ {
+ "title": "Umum",
+ "icon": "i-lucide-airplay",
+ "children": [
+ {
+ "title": "Uom",
+ "link": "/common/uom"
+ }
+ ]
+ },
+ {
+ "title": "Keuangan",
+ "icon": "i-lucide-airplay",
+ "children": [
+ {
+ "title": "Item & Pricing",
+ "link": "/common/item"
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/public/side-menu-items/system.json b/public/side-menu-items/system.json
index b020b948..d5e4fbb4 100644
--- a/public/side-menu-items/system.json
+++ b/public/side-menu-items/system.json
@@ -235,6 +235,10 @@
{
"title": "Jenis Obat",
"link": "/tools-equipment-src/medicine-type"
+ },
+ {
+ "title": "Sediaan Obat",
+ "link": "/tools-equipment-src/medicine-form"
}
]
},
From 15ab43c1b143627892df2a9f82f418091b55ed7f Mon Sep 17 00:00:00 2001
From: hasyim_kai
Date: Mon, 17 Nov 2025 10:38:21 +0700
Subject: [PATCH 21/35] Feat: add verification capthca and form adjustment
---
app/assets/svg/wavey-fingerprint.svg | 1 +
.../app/resume/_common/select-arrangement.vue | 6 +-
app/components/app/resume/add.vue | 33 ++--
app/components/app/resume/verify-dialog.vue | 13 +-
app/components/content/resume/list.vue | 12 +-
.../pub/my-ui/form/text-captcha.vue | 175 ++++++++++++++++++
app/schemas/resume.schema.ts | 5 +-
app/schemas/verification.schema.ts | 19 ++
8 files changed, 236 insertions(+), 28 deletions(-)
create mode 100644 app/assets/svg/wavey-fingerprint.svg
create mode 100644 app/components/pub/my-ui/form/text-captcha.vue
create mode 100644 app/schemas/verification.schema.ts
diff --git a/app/assets/svg/wavey-fingerprint.svg b/app/assets/svg/wavey-fingerprint.svg
new file mode 100644
index 00000000..b281297f
--- /dev/null
+++ b/app/assets/svg/wavey-fingerprint.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/components/app/resume/_common/select-arrangement.vue b/app/components/app/resume/_common/select-arrangement.vue
index 9a945d44..7e236ff0 100644
--- a/app/components/app/resume/_common/select-arrangement.vue
+++ b/app/components/app/resume/_common/select-arrangement.vue
@@ -31,11 +31,9 @@ const {
const arrangementTypeOpts = [
{ label: 'KRS', value: "krs" },
{ label: 'MRS', value: "mrs" },
- { label: 'Pindah IGD', value: "pindahIgd" },
- { label: 'Rujuk', value: "rujuk" },
- { label: 'Rujuk Balik', value: "rujukBalik" },
+ { label: 'Rujuk Internal', value: "rujukInternal" },
+ { label: 'Rujuk External', value: "rujukExternal" },
{ label: 'Meninggal', value: "meninggal" },
- { label: 'Lain Lain', value: "other" },
]
diff --git a/app/components/app/resume/add.vue b/app/components/app/resume/add.vue
index d1423735..d5fa3370 100644
--- a/app/components/app/resume/add.vue
+++ b/app/components/app/resume/add.vue
@@ -19,7 +19,6 @@ import SelectPainScale from './_common/select-pain-scale.vue'
import SelectNationalProgramService from './_common/select-national-program-service.vue'
import SelectNationalProgramServiceStatus from './_common/select-national-program-service-status.vue'
import SelectHospitalLeaveCondition from './_common/select-hospital-leave-condition.vue'
-import SelectFollowingArrangement from './_common/select-following-arrangement.vue'
import SelectHospitalLeaveMethod from './_common/select-hospital-leave-method.vue'
const props = defineProps<{
@@ -58,6 +57,12 @@ const DEFAULT_CONSULTATION_VALUE = {
consultation: '',
consultationReply: '',
};
+
+const initialFormValues = {
+ secondaryDiagnosis: [DEFAULT_SECONDARY_DIAGNOSIS_VALUE],
+ secondaryOperativeNonOperativeAct: [DEFAULT_SECONDARY_ACTION_VALUE],
+ consultation: [DEFAULT_CONSULTATION_VALUE],
+}
@@ -68,7 +73,7 @@ const DEFAULT_CONSULTATION_VALUE = {
:validation-schema="formSchema"
:validate-on-mount="false"
validation-mode="onSubmit"
- :initial-values="initialValues ? initialValues : {}">
+ :initial-values="initialValues ? initialValues : initialFormValues">
Pemeriksaan Pasien
@@ -295,7 +300,7 @@ const DEFAULT_CONSULTATION_VALUE = {
@click="isFarmacyHistoryOpen = true">
Riwayat Data Farmasi
|
-
+
+
+
+
+
-
-
-
-
diff --git a/app/components/app/resume/verify-dialog.vue b/app/components/app/resume/verify-dialog.vue
index 1519446c..ca4fb554 100644
--- a/app/components/app/resume/verify-dialog.vue
+++ b/app/components/app/resume/verify-dialog.vue
@@ -8,6 +8,7 @@ import Select from '~/components/pub/my-ui/form/select.vue'
import { Form } from '~/components/pub/ui/form'
import InputBase from '~/components/pub/my-ui/form/input-base.vue'
import type { InstallationFormData } from '~/schemas/installation.schema'
+import TextCaptcha from '~/components/pub/my-ui/form/text-captcha.vue'
const props = defineProps<{
@@ -21,6 +22,7 @@ const emit = defineEmits<{
}>()
const formSchema = toTypedSchema(props.schema)
+const captchaRef = ref | null>(null)
// Form submission handler
function onSubmitForm(values: any, { resetForm }: { resetForm: () => void }) {
@@ -83,12 +85,11 @@ const items = ref([
-
+
diff --git a/app/components/content/resume/list.vue b/app/components/content/resume/list.vue
index 389c830d..ad60e0e0 100644
--- a/app/components/content/resume/list.vue
+++ b/app/components/content/resume/list.vue
@@ -16,6 +16,8 @@ import { getPatients, removePatient } from '~/services/patient.service'
import DetailRow from '~/components/pub/my-ui/form/view/detail-row.vue'
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
import Confirmation from '~/components/pub/my-ui/confirmation/confirmation.vue'
+import type { ExposedForm } from '~/types/form'
+import { VerificationSchema } from '~/schemas/verification.schema'
// #endregion
@@ -37,7 +39,7 @@ const refSearchNav: RefSearchNav = {
},
}
-const formType = ref<`a` | `b`>(`a`)
+const verificationInputForm = ref | null>(null)
const isVerifyDialogOpen = ref(false)
const isRecordConfirmationOpen = ref(false)
const summaryLoading = ref(false)
@@ -45,6 +47,8 @@ const summaryLoading = ref(false)
const recId = ref(0)
const recAction = ref('')
const recItem = ref(null)
+const isCaptchaValid = ref(false)
+provide('isCaptchaValid', isCaptchaValid)
const headerPrep: HeaderPrep = {
title: "Resume",
@@ -168,9 +172,11 @@ watch([recId, recAction], () => {
@page-change="handlePageChange"/>
-
+
diff --git a/app/components/pub/my-ui/form/text-captcha.vue b/app/components/pub/my-ui/form/text-captcha.vue
new file mode 100644
index 00000000..de9d7f4b
--- /dev/null
+++ b/app/components/pub/my-ui/form/text-captcha.vue
@@ -0,0 +1,175 @@
+
+
+
+
+
+
+
+
+
+
+
{{ errorMessage }}
+
Correct
+
Not case-sensitive
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/schemas/resume.schema.ts b/app/schemas/resume.schema.ts
index 3d529622..3e466a33 100644
--- a/app/schemas/resume.schema.ts
+++ b/app/schemas/resume.schema.ts
@@ -1,7 +1,7 @@
import { z } from 'zod'
import type { CreateDto } from '~/models/consultation'
-export type ResumeArrangementType = "krs" | "mrs" | "pindahIgd" | "rujuk" | "rujukBalik" | "meninggal" | "other"
+export type ResumeArrangementType = "krs" | "mrs" | "rujukInternal" | "rujukExternal" | "meninggal" | "other"
const SecondaryDiagnosisSchema = z.object({
diagnosis: z.string({ required_error: 'Diagnosis harus diisi' }),
@@ -53,6 +53,9 @@ const ResumeSchema = z.object({
consultation: z.array(ConsultationSchema).optional(),
arrangement: z.custom().default("krs"),
+ inpatientIndication: z.string({ required_error: 'Uraian harus diisi' })
+ .min(1, 'Uraian minimum 1 karakter')
+ .max(2048, 'Uraian maksimum 2048 karakter'),
faskes: z.string({ required_error: 'Faskes harus diisi' }).optional(),
clinic: z.string({ required_error: 'Klinik harus diisi' }).optional(),
deathDate: z.string({ required_error: 'Tanggal harus diisi' }).optional(),
diff --git a/app/schemas/verification.schema.ts b/app/schemas/verification.schema.ts
new file mode 100644
index 00000000..db0319cf
--- /dev/null
+++ b/app/schemas/verification.schema.ts
@@ -0,0 +1,19 @@
+import { z } from 'zod'
+
+const VerificationSchema = z.object({
+ name: z.string({
+ required_error: 'Mohon lengkapi Nama Anda',
+ }),
+ email: z.string({
+ required_error: 'Mohon lengkapi email',
+ }),
+ password: z.string({
+ required_error: 'Mohon lengkapi password',
+ }),
+})
+
+
+type VerificationFormData = z.infer
+
+export { VerificationSchema, }
+export type { VerificationFormData, }
\ No newline at end of file
From 7ed1cc83bfa62d8c9660ff1ee61b1f96661ef45a Mon Sep 17 00:00:00 2001
From: hasyim_kai
Date: Mon, 17 Nov 2025 15:04:01 +0700
Subject: [PATCH 22/35] Feat: add doc preview in Resume List
---
app/components/content/resume/list.vue | 8 ++++-
.../pub/my-ui/modal/doc-preview-dialog.vue | 29 +++++++++++++++++++
2 files changed, 36 insertions(+), 1 deletion(-)
create mode 100644 app/components/pub/my-ui/modal/doc-preview-dialog.vue
diff --git a/app/components/content/resume/list.vue b/app/components/content/resume/list.vue
index ad60e0e0..d8d8c721 100644
--- a/app/components/content/resume/list.vue
+++ b/app/components/content/resume/list.vue
@@ -18,6 +18,7 @@ import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
import Confirmation from '~/components/pub/my-ui/confirmation/confirmation.vue'
import type { ExposedForm } from '~/types/form'
import { VerificationSchema } from '~/schemas/verification.schema'
+import DocPreviewDialog from '~/components/pub/my-ui/modal/doc-preview-dialog.vue'
// #endregion
@@ -41,6 +42,7 @@ const refSearchNav: RefSearchNav = {
const verificationInputForm = ref | null>(null)
const isVerifyDialogOpen = ref(false)
+const isDocPreviewDialogOpen = ref(false)
const isRecordConfirmationOpen = ref(false)
const summaryLoading = ref(false)
@@ -152,7 +154,7 @@ watch([recId, recAction], () => {
isRecordConfirmationOpen.value = true
break
case ActionEvents.showPrint:
- navigateTo('https://google.com', {external: true,open: { target: "_blank" },});
+ isDocPreviewDialogOpen.value = true
break
}
})
@@ -179,6 +181,10 @@ watch([recId, recAction], () => {
+
+
+
+
+
+const props = defineProps<{
+ link: string
+}>()
+
+const emit = defineEmits<{
+ // submit: [values: InstallationFormData, resetForm: () => void]
+ // cancel: [resetForm: () => void]
+}>()
+
+// Form cancel handler
+// function onCancelForm({ resetForm }: { resetForm: () => void }) {
+// emit('cancel', resetForm)
+// }
+function onExternalLink() {
+ navigateTo(props.link, {external: true,open: { target: "_blank" },});
+}
+
+
+
+
+ Open in Browser
+
+
+
+
+
+
\ No newline at end of file
From dab6adc4a98820d8686c5a336172af586b883c24 Mon Sep 17 00:00:00 2001
From: hasyim_kai
Date: Tue, 18 Nov 2025 11:19:48 +0700
Subject: [PATCH 23/35] Fix: add role authorization in Resume
---
app/components/content/resume/list.vue | 52 +++++++++++++++++---------
app/composables/useRBAC.ts | 18 +++++++++
app/lib/utils.ts | 9 +++++
3 files changed, 62 insertions(+), 17 deletions(-)
diff --git a/app/components/content/resume/list.vue b/app/components/content/resume/list.vue
index d8d8c721..4b5b5001 100644
--- a/app/components/content/resume/list.vue
+++ b/app/components/content/resume/list.vue
@@ -19,9 +19,17 @@ import Confirmation from '~/components/pub/my-ui/confirmation/confirmation.vue'
import type { ExposedForm } from '~/types/form'
import { VerificationSchema } from '~/schemas/verification.schema'
import DocPreviewDialog from '~/components/pub/my-ui/modal/doc-preview-dialog.vue'
-
+import type { PagePermission } from '~/models/role'
+import { PAGE_PERMISSIONS } from '~/lib/page-permission'
+import { unauthorizedToast } from '~/lib/utils'
// #endregion
+
+// #region Permission
+const roleAccess: PagePermission = PAGE_PERMISSIONS['/rehab/encounter']
+const { getPagePermissions } = useRBAC()
+const pagePermission = getPagePermissions(roleAccess)
+
// #region State
const { data, isLoading, paginationMeta, searchInput, handlePageChange, handleSearch, fetchData } = usePaginatedList({
fetchFn: (params) => getPatients({ ...params, includes: ['person', 'person-Addresses'] }),
@@ -55,11 +63,13 @@ provide('isCaptchaValid', isCaptchaValid)
const headerPrep: HeaderPrep = {
title: "Resume",
icon: 'i-lucide-newspaper',
- addNav: {
- label: "Resume",
- onClick: () => navigateTo('/resume/add'),
- },
-}
+ }
+ if (pagePermission.canCreate) {
+ headerPrep.addNav = {
+ label: "Resume",
+ onClick: () => navigateTo('/resume/add'),
+ }
+ }
// #endregion
// #region Lifecycle Hooks
@@ -146,17 +156,25 @@ provide('table_data_loader', isLoading)
// #region Watchers
watch([recId, recAction], () => {
- switch (recAction.value) {
- case ActionEvents.showVerify:
- isVerifyDialogOpen.value = true
- break
- case ActionEvents.showValidate:
- isRecordConfirmationOpen.value = true
- break
- case ActionEvents.showPrint:
- isDocPreviewDialogOpen.value = true
- break
- }
+ switch (recAction.value) {
+ case ActionEvents.showVerify:
+ if(pagePermission.canUpdate) {
+ isVerifyDialogOpen.value = true
+ } else {
+ unauthorizedToast()
+ }
+ break
+ case ActionEvents.showValidate:
+ if(pagePermission.canUpdate) {
+ isRecordConfirmationOpen.value = true
+ } else {
+ unauthorizedToast()
+ }
+ break
+ case ActionEvents.showPrint:
+ isDocPreviewDialogOpen.value = true
+ break
+ }
})
// #endregion
diff --git a/app/composables/useRBAC.ts b/app/composables/useRBAC.ts
index ced57e3e..fcc28144 100644
--- a/app/composables/useRBAC.ts
+++ b/app/composables/useRBAC.ts
@@ -1,5 +1,13 @@
import type { Permission, RoleAccess } from '~/models/role'
+export interface PageOperationPermission {
+ canRead: boolean
+ canCreate: boolean
+ canUpdate: boolean
+ canDelete: boolean
+}
+
+
/**
* Check if user has access to a page
*/
@@ -36,6 +44,14 @@ export function useRBAC() {
const hasUpdateAccess = (roleAccess: RoleAccess) => checkPermission(roleAccess, 'U')
const hasDeleteAccess = (roleAccess: RoleAccess) => checkPermission(roleAccess, 'D')
+ const getPagePermissions = (roleAccess: RoleAccess): PageOperationPermission => ({
+ canRead : hasReadAccess(roleAccess),
+ canCreate: hasCreateAccess(roleAccess),
+ canUpdate: hasUpdateAccess(roleAccess),
+ canDelete: hasDeleteAccess(roleAccess),
+ })
+
+
return {
checkRole,
checkPermission,
@@ -44,5 +60,7 @@ export function useRBAC() {
hasReadAccess,
hasUpdateAccess,
hasDeleteAccess,
+ getPagePermissions,
+
}
}
diff --git a/app/lib/utils.ts b/app/lib/utils.ts
index 357d8700..64248caf 100644
--- a/app/lib/utils.ts
+++ b/app/lib/utils.ts
@@ -1,6 +1,7 @@
import type { ClassValue } from 'clsx'
import { clsx } from 'clsx'
import { twMerge } from 'tailwind-merge'
+import { toast } from '~/components/pub/ui/toast'
export interface SelectOptionType<_T = string> {
value: string
@@ -104,3 +105,11 @@ export function calculateAge(birthDate: Date | string | null | undefined): strin
return `${years} tahun ${months} bulan`
}
}
+
+export function unauthorizedToast() {
+ toast({
+ title: 'Unauthorized',
+ description: 'You are not authorized to perform this action.',
+ variant: 'destructive',
+ })
+}
\ No newline at end of file
From c98018bb4eaacbcd05763f404b40d3d4a27899dd Mon Sep 17 00:00:00 2001
From: hasyim_kai
Date: Tue, 18 Nov 2025 12:58:58 +0700
Subject: [PATCH 24/35] Squashed commit of the following:
commit bcfb4c1456b7b58c63d4969985200ceca72aee16
Merge: 1cbde57 975c87d
Author: Munawwirul Jamal <57973347+munaja@users.noreply.github.com>
Date: Mon Nov 17 11:15:14 2025 +0700
Merge pull request #147 from dikstub-rssa/feat/surat-kontrol-135
Feat: Integration Rehab Medik - Surat Kontrol
commit 975c87d99af0471f62111a455fa214abc1f2e998
Merge: f582090 1cbde57
Author: hasyim_kai
Date: Mon Nov 17 10:58:10 2025 +0700
Merge branch 'dev' into feat/surat-kontrol-135
commit f582090d18fe797e9f7e0e5b8559b1e413c7c921
Author: hasyim_kai
Date: Thu Nov 13 11:56:21 2025 +0700
Fix: Refactor surat kontrol
commit a14c4a5d3c334d3ea7b9875feb5620991511d4f0
Author: hasyim_kai
Date: Tue Nov 11 14:21:58 2025 +0700
Fix: Refactor Surat Kontrol CRUD {id} to {code}
commit 24313adef6bd3db52f23ace0675100bea1aaefad
Author: hasyim_kai
Date: Fri Nov 7 10:35:46 2025 +0700
Fix: debug back btn in add, edit, detail content page
commit 59b44b5729161b3e7c014ea440f17bf98fd8b954
Merge: 99a61a0 db15ec9
Author: Muhammad Hasyim Chaidir Ali <68959522+Hasyim-Kai@users.noreply.github.com>
Date: Fri Nov 7 09:11:10 2025 +0700
Merge branch 'dev' into feat/surat-kontrol-135
commit 99a61a0bf2edf2f924d0424600e94a1d64901e48
Author: hasyim_kai
Date: Thu Nov 6 08:06:01 2025 +0700
Feat: add right & bottom label in input base component
commit db48919325a9c3a7940cb208fee71c1d42ee9a8a
Author: hasyim_kai
Date: Wed Nov 5 13:53:43 2025 +0700
Feat: add banner in List if requirement not met
commit bd57250f7e9bcaed8e11f6533435e3c788347286
Author: hasyim_kai
Date: Wed Nov 5 13:26:48 2025 +0700
Fix: refactor getDetail url param
commit a361922e32f2e8a649edaedd9cec82131aff2793
Author: hasyim_kai
Date: Wed Nov 5 13:19:07 2025 +0700
Feat: Add & integrate add, edit, detail page
commit 331f4a6b20194964d89eb1ada2d7661d8be8f76d
Author: hasyim_kai
Date: Tue Nov 4 16:56:08 2025 +0700
Feat: Integrate Control Letter
commit 2275f4dc9991a1e51d0fba31748ff88c85d40bcf
Author: hasyim_kai
Date: Mon Oct 27 14:01:58 2025 +0700
Feat: add UI BPJS > Surat Kontrol
commit 89e0e7a2c8a20ae31ca381d3320bd81755b73c34
Author: hasyim_kai
Date: Mon Oct 27 10:21:59 2025 +0700
Feat: add UI CRUD Surat Kontrol at Rehab Medik > kunjungan > Proses
---
.../_common/dropdown-action.vue | 90 +++++++
.../control-letter/_common/history-dialog.vue | 49 ++++
.../_common/select-date-range.vue | 104 +++++++++
.../_common/select-destination-polyclinic.vue | 70 ++++++
.../_common/select-origin-polyclinic.vue | 70 ++++++
.../app/bpjs/control-letter/filter.vue | 128 ++++++++++
.../app/bpjs/control-letter/list.cfg.ts | 108 +++++++++
.../app/bpjs/control-letter/list.vue | 31 +++
.../control-letter/_common/select-date.vue | 116 +++++++++
.../control-letter/_common/select-dpjp.vue | 98 ++++++++
.../_common/select-specialist.vue | 98 ++++++++
.../_common/select-subspecialist.vue | 97 ++++++++
.../control-letter/_common/select-unit.vue | 85 +++++++
.../app/control-letter/entry-form.vue | 94 ++++++++
app/components/app/control-letter/list.cfg.ts | 64 +++++
app/components/app/control-letter/list.vue | 31 +++
app/components/app/control-letter/preview.vue | 54 +++++
.../content/bpjs/control-letter/list.vue | 220 ++++++++++++++++++
app/components/content/control-letter/add.vue | 133 +++++++++++
.../content/control-letter/detail.vue | 79 +++++++
.../content/control-letter/edit.vue | 162 +++++++++++++
.../content/control-letter/list.vue | 176 ++++++++++++++
app/components/content/encounter/process.vue | 3 +-
.../pub/my-ui/alert/warning-alert.vue | 27 +++
.../pub/my-ui/badge/status-badge.vue | 26 +++
.../pub/my-ui/confirmation/confirmation.vue | 2 +-
app/components/pub/my-ui/data/types.ts | 6 +
app/components/pub/my-ui/form/input-base.vue | 6 +-
.../pub/my-ui/nav-header/filter-dialog.vue | 85 +++++++
.../pub/my-ui/nav-header/filter.vue | 30 ++-
app/handlers/control-letter.handler.ts | 24 ++
app/lib/date.ts | 8 +
app/models/control-letter.ts | 37 +++
app/models/doctor.ts | 13 +-
.../integration/bpjs/control-letter/index.vue | 40 ++++
.../(features)/integration/bpjs/sep/add.vue | 12 +-
.../(features)/integration/bpjs/sep/index.vue | 6 +-
.../outpatient/encounter/[id]/index.vue | 41 ++++
.../[control_letter_id]/edit.vue | 41 ++++
.../[control_letter_id]/index.vue | 41 ++++
.../encounter/[id]/control-letter/add.vue | 42 ++++
app/schemas/control-letter.schema.ts | 47 ++++
app/services/doctor.service.ts | 10 +-
app/services/specialist.service.ts | 6 +-
app/services/subspecialist.service.ts | 6 +-
app/services/unit.service.ts | 6 +-
public/side-menu-items/system.json | 5 +
47 files changed, 2696 insertions(+), 31 deletions(-)
create mode 100644 app/components/app/bpjs/control-letter/_common/dropdown-action.vue
create mode 100644 app/components/app/bpjs/control-letter/_common/history-dialog.vue
create mode 100644 app/components/app/bpjs/control-letter/_common/select-date-range.vue
create mode 100644 app/components/app/bpjs/control-letter/_common/select-destination-polyclinic.vue
create mode 100644 app/components/app/bpjs/control-letter/_common/select-origin-polyclinic.vue
create mode 100644 app/components/app/bpjs/control-letter/filter.vue
create mode 100644 app/components/app/bpjs/control-letter/list.cfg.ts
create mode 100644 app/components/app/bpjs/control-letter/list.vue
create mode 100644 app/components/app/control-letter/_common/select-date.vue
create mode 100644 app/components/app/control-letter/_common/select-dpjp.vue
create mode 100644 app/components/app/control-letter/_common/select-specialist.vue
create mode 100644 app/components/app/control-letter/_common/select-subspecialist.vue
create mode 100644 app/components/app/control-letter/_common/select-unit.vue
create mode 100644 app/components/app/control-letter/entry-form.vue
create mode 100644 app/components/app/control-letter/list.cfg.ts
create mode 100644 app/components/app/control-letter/list.vue
create mode 100644 app/components/app/control-letter/preview.vue
create mode 100644 app/components/content/bpjs/control-letter/list.vue
create mode 100644 app/components/content/control-letter/add.vue
create mode 100644 app/components/content/control-letter/detail.vue
create mode 100644 app/components/content/control-letter/edit.vue
create mode 100644 app/components/content/control-letter/list.vue
create mode 100644 app/components/pub/my-ui/alert/warning-alert.vue
create mode 100644 app/components/pub/my-ui/badge/status-badge.vue
create mode 100644 app/components/pub/my-ui/nav-header/filter-dialog.vue
create mode 100644 app/handlers/control-letter.handler.ts
create mode 100644 app/models/control-letter.ts
create mode 100644 app/pages/(features)/integration/bpjs/control-letter/index.vue
create mode 100644 app/pages/(features)/outpatient/encounter/[id]/index.vue
create mode 100644 app/pages/(features)/rehab/encounter/[id]/control-letter/[control_letter_id]/edit.vue
create mode 100644 app/pages/(features)/rehab/encounter/[id]/control-letter/[control_letter_id]/index.vue
create mode 100644 app/pages/(features)/rehab/encounter/[id]/control-letter/add.vue
create mode 100644 app/schemas/control-letter.schema.ts
diff --git a/app/components/app/bpjs/control-letter/_common/dropdown-action.vue b/app/components/app/bpjs/control-letter/_common/dropdown-action.vue
new file mode 100644
index 00000000..9086c883
--- /dev/null
+++ b/app/components/app/bpjs/control-letter/_common/dropdown-action.vue
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/bpjs/control-letter/_common/history-dialog.vue b/app/components/app/bpjs/control-letter/_common/history-dialog.vue
new file mode 100644
index 00000000..00d7b32f
--- /dev/null
+++ b/app/components/app/bpjs/control-letter/_common/history-dialog.vue
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{ item?.createdAt.toLocaleDateString('id-ID') }}
+
+
{{ item.description }}
+
+
+
+
+
\ No newline at end of file
diff --git a/app/components/app/bpjs/control-letter/_common/select-date-range.vue b/app/components/app/bpjs/control-letter/_common/select-date-range.vue
new file mode 100644
index 00000000..114f8542
--- /dev/null
+++ b/app/components/app/bpjs/control-letter/_common/select-date-range.vue
@@ -0,0 +1,104 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ df.format(value.start.toDate(getLocalTimeZone())) }} -
+ {{ df.format(value.end.toDate(getLocalTimeZone())) }}
+
+
+
+ {{ df.format(value.start.toDate(getLocalTimeZone())) }}
+
+
+ Pick a date
+
+
+
+ (value.start = startDate)"
+ />
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/bpjs/control-letter/_common/select-destination-polyclinic.vue b/app/components/app/bpjs/control-letter/_common/select-destination-polyclinic.vue
new file mode 100644
index 00000000..0852195b
--- /dev/null
+++ b/app/components/app/bpjs/control-letter/_common/select-destination-polyclinic.vue
@@ -0,0 +1,70 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/bpjs/control-letter/_common/select-origin-polyclinic.vue b/app/components/app/bpjs/control-letter/_common/select-origin-polyclinic.vue
new file mode 100644
index 00000000..0852195b
--- /dev/null
+++ b/app/components/app/bpjs/control-letter/_common/select-origin-polyclinic.vue
@@ -0,0 +1,70 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/bpjs/control-letter/filter.vue b/app/components/app/bpjs/control-letter/filter.vue
new file mode 100644
index 00000000..50005069
--- /dev/null
+++ b/app/components/app/bpjs/control-letter/filter.vue
@@ -0,0 +1,128 @@
+
+
+
+
+ onSubmitForm(values, { resetForm }))">
+
+
+
+ Reset
+ Terapkan
+
+
+
+
diff --git a/app/components/app/bpjs/control-letter/list.cfg.ts b/app/components/app/bpjs/control-letter/list.cfg.ts
new file mode 100644
index 00000000..8eb7e5f4
--- /dev/null
+++ b/app/components/app/bpjs/control-letter/list.cfg.ts
@@ -0,0 +1,108 @@
+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('./_common/dropdown-action.vue'))
+const statusBadge = defineAsyncComponent(() => import('~/components/pub/my-ui/badge/status-badge.vue'))
+
+export const config: Config = {
+ cols: [{}, {}, {}, {},{}, {}, {}, {}, {}, {width: 90},{width: 10},],
+
+ headers: [
+ [
+ { label: 'No Surat' },
+ { label: 'No MR' },
+ { label: 'Nama' },
+ { label: 'Tgl Rencana Kontrol' },
+ { label: 'Tgl Penerbitan' },
+ { label: 'Klinik Asal' },
+ { label: 'Klinik Tujuan' },
+ { label: 'DPJP' },
+ { label: 'No SEP Asal' },
+ { label: 'Status' },
+ { label: 'Action' },
+ ],
+ ],
+
+ keys: ['birth_date', 'number', 'person.name', 'birth_date', 'birth_date',
+ 'birth_date', 'number', 'person.name', 'birth_date', 'status', 'action'],
+
+ delKeyNames: [
+ { key: 'code', label: 'Kode' },
+ { key: 'name', label: 'Nama' },
+ ],
+
+ parses: {
+ patientId: (rec: unknown): unknown => {
+ const patient = rec as Patient
+ return patient.number
+ },
+ identity_number: (rec: unknown): unknown => {
+ const { person } = rec as Patient
+
+ if (person.nationality == 'WNA') {
+ return person.passportNumber
+ }
+
+ return person.residentIdentityNumber || '-'
+ },
+ birth_date: (rec: unknown): unknown => {
+ const { person } = rec as Patient
+
+ if (typeof person.birthDate == 'object' && person.birthDate) {
+ return (person.birthDate as Date).toLocaleDateString('id-ID')
+ } else if (typeof person.birthDate == 'string') {
+ return (person.birthDate as string).substring(0, 10)
+ }
+ return person.birthDate
+ },
+ patient_age: (rec: unknown): unknown => {
+ const { person } = rec as Patient
+ return calculateAge(person.birthDate)
+ },
+ gender: (rec: unknown): unknown => {
+ const { person } = rec as Patient
+
+ if (typeof person.gender_code == 'number' && person.gender_code >= 0) {
+ return person.gender_code
+ } else if (typeof person.gender_code === 'string' && person.gender_code) {
+ return genderCodes[person.gender_code] || '-'
+ }
+ return '-'
+ },
+ education: (rec: unknown): unknown => {
+ const { person } = rec as Patient
+ if (typeof person.education_code == 'number' && person.education_code >= 0) {
+ return person.education_code
+ } else if (typeof person.education_code === 'string' && person.education_code) {
+ return educationCodes[person.education_code] || '-'
+ }
+ return '-'
+ },
+ },
+
+ components: {
+ action(rec, idx) {
+ return {
+ idx,
+ rec: rec as object,
+ component: action,
+ }
+ },
+ status(rec, idx) {
+ return {
+ idx,
+ rec: rec as object,
+ component: statusBadge,
+ }
+ },
+ },
+
+ htmls: {
+ patient_address(_rec) {
+ return '-'
+ },
+ },
+}
diff --git a/app/components/app/bpjs/control-letter/list.vue b/app/components/app/bpjs/control-letter/list.vue
new file mode 100644
index 00000000..8274e752
--- /dev/null
+++ b/app/components/app/bpjs/control-letter/list.vue
@@ -0,0 +1,31 @@
+
+
+
+
+
diff --git a/app/components/app/control-letter/_common/select-date.vue b/app/components/app/control-letter/_common/select-date.vue
new file mode 100644
index 00000000..057d0a63
--- /dev/null
+++ b/app/components/app/control-letter/_common/select-date.vue
@@ -0,0 +1,116 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+ {
+ const dateStr = typeof value === 'number' ? String(value) : value
+ patientAge = calculateAge(dateStr)
+ }
+ "
+ />
+
+
+
+
+
+
+
diff --git a/app/components/app/control-letter/_common/select-dpjp.vue b/app/components/app/control-letter/_common/select-dpjp.vue
new file mode 100644
index 00000000..2053ebdb
--- /dev/null
+++ b/app/components/app/control-letter/_common/select-dpjp.vue
@@ -0,0 +1,98 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/control-letter/_common/select-specialist.vue b/app/components/app/control-letter/_common/select-specialist.vue
new file mode 100644
index 00000000..cd5ee923
--- /dev/null
+++ b/app/components/app/control-letter/_common/select-specialist.vue
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+ Spesialis
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/control-letter/_common/select-subspecialist.vue b/app/components/app/control-letter/_common/select-subspecialist.vue
new file mode 100644
index 00000000..61567c0c
--- /dev/null
+++ b/app/components/app/control-letter/_common/select-subspecialist.vue
@@ -0,0 +1,97 @@
+
+
+
+
+
+
+ Sub Spesialis
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/control-letter/_common/select-unit.vue b/app/components/app/control-letter/_common/select-unit.vue
new file mode 100644
index 00000000..afe0ca0a
--- /dev/null
+++ b/app/components/app/control-letter/_common/select-unit.vue
@@ -0,0 +1,85 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/control-letter/entry-form.vue b/app/components/app/control-letter/entry-form.vue
new file mode 100644
index 00000000..2517e8b1
--- /dev/null
+++ b/app/components/app/control-letter/entry-form.vue
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/control-letter/list.cfg.ts b/app/components/app/control-letter/list.cfg.ts
new file mode 100644
index 00000000..3eb7bd84
--- /dev/null
+++ b/app/components/app/control-letter/list.cfg.ts
@@ -0,0 +1,64 @@
+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-dud.vue'))
+
+export const config: Config = {
+ cols: [{width: 180}, {}, {}, {}, {}, {width: 30},],
+
+ headers: [
+ [
+ { label: 'Tgl Rencana Kontrol' },
+ { label: 'Spesialis' },
+ { label: 'Sub Spesialis' },
+ { label: 'DPJP' },
+ { label: 'Status SEP' },
+ { label: 'Action' },
+ ],
+ ],
+
+ keys: ['date', 'specialist.name', 'subspecialist.name', 'doctor.employee.person.name', 'sep_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
+ },
+ specialist_subspecialist: (rec: unknown): unknown => {
+ return '-'
+ },
+ dpjp: (rec: unknown): unknown => {
+ // const { person } = rec as Patient
+ return '-'
+ },
+ },
+
+ components: {
+ action(rec, idx) {
+ return {
+ idx,
+ rec: rec as object,
+ component: action,
+ }
+ },
+ },
+
+ htmls: {
+ sep_status(_rec) {
+ return 'SEP Internal'
+ },
+ },
+}
diff --git a/app/components/app/control-letter/list.vue b/app/components/app/control-letter/list.vue
new file mode 100644
index 00000000..8274e752
--- /dev/null
+++ b/app/components/app/control-letter/list.vue
@@ -0,0 +1,31 @@
+
+
+
+
+
diff --git a/app/components/app/control-letter/preview.vue b/app/components/app/control-letter/preview.vue
new file mode 100644
index 00000000..e10a2b91
--- /dev/null
+++ b/app/components/app/control-letter/preview.vue
@@ -0,0 +1,54 @@
+
+
+
+
+ {{ props.instance?.date ? new Date(props.instance?.date).toLocaleDateString('id-ID') : '-' }}
+ {{ props.instance?.unit.name || '-' }}
+ {{ props.instance?.specialist.name || '-' }}
+ {{ props.instance?.subspecialist.name || '-' }}
+ {{ props.instance?.doctor.employee.person.name || '-' }}
+ {{ 'SEP INTERNAL' }}
+
+
+
+
+
diff --git a/app/components/content/bpjs/control-letter/list.vue b/app/components/content/bpjs/control-letter/list.vue
new file mode 100644
index 00000000..66ed00a5
--- /dev/null
+++ b/app/components/content/bpjs/control-letter/list.vue
@@ -0,0 +1,220 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ID:
+ {{ record?.id }}
+
+
+ Nama:
+ {{ record.firstName }}
+
+
+ Kode:
+ {{ record.cellphone }}
+
+
+
+
+
diff --git a/app/components/content/control-letter/add.vue b/app/components/content/control-letter/add.vue
new file mode 100644
index 00000000..44f03a2f
--- /dev/null
+++ b/app/components/content/control-letter/add.vue
@@ -0,0 +1,133 @@
+
+
+
+ Tambah Surat Kontrol
+
+
+
+
+
+
+
+
diff --git a/app/components/content/control-letter/detail.vue b/app/components/content/control-letter/detail.vue
new file mode 100644
index 00000000..d9019d57
--- /dev/null
+++ b/app/components/content/control-letter/detail.vue
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+
diff --git a/app/components/content/control-letter/edit.vue b/app/components/content/control-letter/edit.vue
new file mode 100644
index 00000000..99a5c282
--- /dev/null
+++ b/app/components/content/control-letter/edit.vue
@@ -0,0 +1,162 @@
+
+
+
+ Update Surat Kontrol
+
+
+
+
+
+
+
+
diff --git a/app/components/content/control-letter/list.vue b/app/components/content/control-letter/list.vue
new file mode 100644
index 00000000..c9353057
--- /dev/null
+++ b/app/components/content/control-letter/list.vue
@@ -0,0 +1,176 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ID:
+ {{ record?.id }}
+
+
+ Nama:
+ {{ record.firstName }}
+
+
+ Kode:
+ {{ record.cellphone }}
+
+
+
+
+
+
diff --git a/app/components/content/encounter/process.vue b/app/components/content/encounter/process.vue
index 267fee95..3b57e7f6 100644
--- a/app/components/content/encounter/process.vue
+++ b/app/components/content/encounter/process.vue
@@ -20,6 +20,7 @@ import Radiology from '~/components/content/radiology-order/main.vue'
import Consultation from '~/components/content/consultation/list.vue'
import DocUploadList from '~/components/content/document-upload/list.vue'
import { genEncounter } from '~/models/encounter'
+import ControlLetterList from '~/components/content/control-letter/list.vue'
const route = useRoute()
const router = useRouter()
@@ -80,7 +81,7 @@ const tabs: TabItem[] = [
{ value: 'mcu-result', label: 'Hasil Penunjang' },
{ value: 'consultation', label: 'Konsultasi', component: Consultation, props: { encounter: data } },
{ value: 'resume', label: 'Resume' },
- { value: 'control', label: 'Surat Kontrol' },
+ { value: 'control', label: 'Surat Kontrol', component: ControlLetterList, props: { encounter: data } },
{ value: 'screening', label: 'Skrinning MPP' },
{ value: 'supporting-document', label: 'Upload Dokumen Pendukung', component: DocUploadList, props: { encounter: data, }, },
]
diff --git a/app/components/pub/my-ui/alert/warning-alert.vue b/app/components/pub/my-ui/alert/warning-alert.vue
new file mode 100644
index 00000000..afdbe7ae
--- /dev/null
+++ b/app/components/pub/my-ui/alert/warning-alert.vue
@@ -0,0 +1,27 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/components/pub/my-ui/badge/status-badge.vue b/app/components/pub/my-ui/badge/status-badge.vue
new file mode 100644
index 00000000..ba8a7ea6
--- /dev/null
+++ b/app/components/pub/my-ui/badge/status-badge.vue
@@ -0,0 +1,26 @@
+
+
+
+
+
+ {{ statusText }}
+
+
+
diff --git a/app/components/pub/my-ui/confirmation/confirmation.vue b/app/components/pub/my-ui/confirmation/confirmation.vue
index 590f328d..b5c328aa 100644
--- a/app/components/pub/my-ui/confirmation/confirmation.vue
+++ b/app/components/pub/my-ui/confirmation/confirmation.vue
@@ -71,7 +71,7 @@ function handleCancel() {
-
+
diff --git a/app/components/pub/my-ui/data/types.ts b/app/components/pub/my-ui/data/types.ts
index a9b2586b..f27a5578 100644
--- a/app/components/pub/my-ui/data/types.ts
+++ b/app/components/pub/my-ui/data/types.ts
@@ -42,6 +42,12 @@ export interface RefSearchNav {
onClear: () => void
}
+export interface RefExportNav {
+ onExportPdf?: () => void
+ onExportCsv?: () => void
+ onExportExcel?: () => void
+}
+
// prepared header for relatively common usage
export interface HeaderPrep {
title?: string
diff --git a/app/components/pub/my-ui/form/input-base.vue b/app/components/pub/my-ui/form/input-base.vue
index aeb4a4af..a3743734 100644
--- a/app/components/pub/my-ui/form/input-base.vue
+++ b/app/components/pub/my-ui/form/input-base.vue
@@ -19,6 +19,8 @@ const props = defineProps<{
maxLength?: number
isRequired?: boolean
isDisabled?: boolean
+ rightLabel?: string
+ bottomLabel?: string
}>()
function handleInput(event: Event) {
@@ -61,7 +63,7 @@ function handleInput(event: Event) {
v-slot="{ componentField }"
:name="fieldName"
>
-
+
+ {{ rightLabel }}
+ {{ bottomLabel }}
diff --git a/app/components/pub/my-ui/nav-header/filter-dialog.vue b/app/components/pub/my-ui/nav-header/filter-dialog.vue
new file mode 100644
index 00000000..c0d5b854
--- /dev/null
+++ b/app/components/pub/my-ui/nav-header/filter-dialog.vue
@@ -0,0 +1,85 @@
+
+
+
+
+
diff --git a/app/components/pub/my-ui/nav-header/filter.vue b/app/components/pub/my-ui/nav-header/filter.vue
index ab28620b..74f6d8dc 100644
--- a/app/components/pub/my-ui/nav-header/filter.vue
+++ b/app/components/pub/my-ui/nav-header/filter.vue
@@ -5,11 +5,13 @@ import type { Ref } from 'vue'
import type { DateRange } from 'radix-vue'
import { CalendarDate, DateFormatter, getLocalTimeZone } from '@internationalized/date'
import { cn } from '~/lib/utils'
-import type { HeaderPrep, RefSearchNav } from '~/components/pub/my-ui/data/types'
+import type { HeaderPrep, RefExportNav, RefSearchNav } from '~/components/pub/my-ui/data/types'
const props = defineProps<{
prep: HeaderPrep
refSearchNav?: RefSearchNav
+ enableExport?: boolean
+ refExportNav?: RefExportNav
}>()
// function emitSearchNavClick() {
@@ -57,7 +59,7 @@ function onFilterClick() {
-
+
@@ -97,6 +99,30 @@ function onFilterClick() {
Filter
+
+
+
+
+
+ Ekspor
+
+
+
+
+ Ekspor PDF
+
+
+ Ekspor CSV
+
+
+ Ekspor Excel
+
+
+
+
diff --git a/app/handlers/control-letter.handler.ts b/app/handlers/control-letter.handler.ts
new file mode 100644
index 00000000..b096a178
--- /dev/null
+++ b/app/handlers/control-letter.handler.ts
@@ -0,0 +1,24 @@
+// Handlers
+import { genCrudHandler } from '~/handlers/_handler'
+
+// Services
+import { create, update, remove } from '~/services/control-letter.service'
+
+export const {
+ recId,
+ recAction,
+ recItem,
+ isReadonly,
+ isProcessing,
+ isFormEntryDialogOpen,
+ isRecordConfirmationOpen,
+ onResetState,
+ handleActionSave,
+ handleActionEdit,
+ handleActionRemove,
+ handleCancelForm,
+} = genCrudHandler({
+ create,
+ update,
+ remove,
+})
diff --git a/app/lib/date.ts b/app/lib/date.ts
index 502a6cfb..2c7b92cf 100644
--- a/app/lib/date.ts
+++ b/app/lib/date.ts
@@ -41,4 +41,12 @@ export function getAge(dateString: string, comparedDate?: string): { idFormat: s
idFormat,
extFormat
};
+}
+
+export function formatDateYyyyMmDd(isoDateString: string): string {
+ const date = new Date(isoDateString);
+ const year = date.getFullYear();
+ const month = String(date.getMonth() + 1).padStart(2, '0');
+ const day = String(date.getDate()).padStart(2, '0');
+ return `${year}-${month}-${day}`;
}
\ No newline at end of file
diff --git a/app/models/control-letter.ts b/app/models/control-letter.ts
new file mode 100644
index 00000000..8f520212
--- /dev/null
+++ b/app/models/control-letter.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 ControlLetter 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 genControlLetter(): ControlLetter {
+ 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/doctor.ts b/app/models/doctor.ts
index 3f517476..1b631907 100644
--- a/app/models/doctor.ts
+++ b/app/models/doctor.ts
@@ -8,10 +8,11 @@ export interface Doctor extends Base {
employee: Employee
ihs_number: string
sip_number: string
- unit_id?: number
- specialist_id?: number
+ code?: string
+ unit_icode?: number
+ specialist_icode?: number
specialist?: Specialist
- subspecialist_id?: number
+ subspecialist_icode?: number
subspecialist?: Subspecialist
bpjs_code?: string
}
@@ -21,9 +22,9 @@ export interface CreateDto {
employee_id: number
ihs_number: string
sip_number: string
- unit_id?: number
- specialist_id?: number
- subspecialist_id?: number
+ unit_code?: number
+ specialist_code?: number
+ subspecialist_code?: number
bpjs_code: string
}
diff --git a/app/pages/(features)/integration/bpjs/control-letter/index.vue b/app/pages/(features)/integration/bpjs/control-letter/index.vue
new file mode 100644
index 00000000..8dcb9006
--- /dev/null
+++ b/app/pages/(features)/integration/bpjs/control-letter/index.vue
@@ -0,0 +1,40 @@
+
+
+
+
+
diff --git a/app/pages/(features)/integration/bpjs/sep/add.vue b/app/pages/(features)/integration/bpjs/sep/add.vue
index 5db12aac..0658780b 100644
--- a/app/pages/(features)/integration/bpjs/sep/add.vue
+++ b/app/pages/(features)/integration/bpjs/sep/add.vue
@@ -22,12 +22,12 @@ const { checkRole, hasCreateAccess } = useRBAC()
// Check if user has access to this page
const hasAccess = checkRole(roleAccess)
-if (!hasAccess) {
- throw createError({
- statusCode: 403,
- statusMessage: 'Access denied',
- })
-}
+// if (!hasAccess) {
+// throw createError({
+// statusCode: 403,
+// statusMessage: 'Access denied',
+// })
+// }
// Define permission-based computed properties
const canCreate = true // hasCreateAccess(roleAccess)
diff --git a/app/pages/(features)/integration/bpjs/sep/index.vue b/app/pages/(features)/integration/bpjs/sep/index.vue
index b8ec57c4..d99dbb5d 100644
--- a/app/pages/(features)/integration/bpjs/sep/index.vue
+++ b/app/pages/(features)/integration/bpjs/sep/index.vue
@@ -22,9 +22,9 @@ const { checkRole, hasReadAccess } = useRBAC()
// Check if user has access to this page
const hasAccess = checkRole(roleAccess)
-if (!hasAccess) {
- navigateTo('/403')
-}
+// if (!hasAccess) {
+// navigateTo('/403')
+// }
// Define permission-based computed properties
const canRead = true // hasReadAccess(roleAccess)
diff --git a/app/pages/(features)/outpatient/encounter/[id]/index.vue b/app/pages/(features)/outpatient/encounter/[id]/index.vue
new file mode 100644
index 00000000..1864cf2c
--- /dev/null
+++ b/app/pages/(features)/outpatient/encounter/[id]/index.vue
@@ -0,0 +1,41 @@
+
+
+
+
+
diff --git a/app/pages/(features)/rehab/encounter/[id]/control-letter/[control_letter_id]/edit.vue b/app/pages/(features)/rehab/encounter/[id]/control-letter/[control_letter_id]/edit.vue
new file mode 100644
index 00000000..cc5d182f
--- /dev/null
+++ b/app/pages/(features)/rehab/encounter/[id]/control-letter/[control_letter_id]/edit.vue
@@ -0,0 +1,41 @@
+
+
+
+
+
diff --git a/app/pages/(features)/rehab/encounter/[id]/control-letter/[control_letter_id]/index.vue b/app/pages/(features)/rehab/encounter/[id]/control-letter/[control_letter_id]/index.vue
new file mode 100644
index 00000000..612315ad
--- /dev/null
+++ b/app/pages/(features)/rehab/encounter/[id]/control-letter/[control_letter_id]/index.vue
@@ -0,0 +1,41 @@
+
+
+
+
+
diff --git a/app/pages/(features)/rehab/encounter/[id]/control-letter/add.vue b/app/pages/(features)/rehab/encounter/[id]/control-letter/add.vue
new file mode 100644
index 00000000..1070a29f
--- /dev/null
+++ b/app/pages/(features)/rehab/encounter/[id]/control-letter/add.vue
@@ -0,0 +1,42 @@
+
+
+
+
+
diff --git a/app/schemas/control-letter.schema.ts b/app/schemas/control-letter.schema.ts
new file mode 100644
index 00000000..c82ffaac
--- /dev/null
+++ b/app/schemas/control-letter.schema.ts
@@ -0,0 +1,47 @@
+import { z } from 'zod'
+
+const ControlLetterSchema = 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 ControlLetterFormData = z.infer
+
+export { ControlLetterSchema }
+export type { ControlLetterFormData }
diff --git a/app/services/doctor.service.ts b/app/services/doctor.service.ts
index 74104c2c..e6ae0051 100644
--- a/app/services/doctor.service.ts
+++ b/app/services/doctor.service.ts
@@ -1,8 +1,6 @@
// Base
import * as base from './_crud-base'
-
-// Types
-import type { Doctor } from '~/models/doctor'
+import type { Doctor } from "~/models/doctor";
const path = '/api/v1/doctor'
const name = 'doctor'
@@ -27,13 +25,15 @@ export function remove(id: number | string) {
return base.remove(path, id, name)
}
-export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> {
+export async function getValueLabelList(params: any = null, useCodeAsValue = false): 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: Doctor) => ({
- value: item.id ? String(item.id) : '',
+ value: useCodeAsValue ? item.code
+ : item.id ? Number(item.id)
+ : item.id,
label: item.employee?.person?.name || '',
}))
}
diff --git a/app/services/specialist.service.ts b/app/services/specialist.service.ts
index b18eac34..d4c81b5c 100644
--- a/app/services/specialist.service.ts
+++ b/app/services/specialist.service.ts
@@ -28,13 +28,15 @@ export function remove(id: number | string) {
return base.remove(path, id, name)
}
-export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> {
+export async function getValueLabelList(params: any = null, useCodeAsValue = false): 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: Specialist) => ({
- value: item.id ? Number(item.id) : item.code,
+ value: useCodeAsValue ? item.code
+ : item.id ? Number(item.id)
+ : item.id,
label: item.name,
parent: item.unit_id ? Number(item.unit_id) : null,
}))
diff --git a/app/services/subspecialist.service.ts b/app/services/subspecialist.service.ts
index e384f059..f13c715f 100644
--- a/app/services/subspecialist.service.ts
+++ b/app/services/subspecialist.service.ts
@@ -27,13 +27,15 @@ export function remove(id: number | string) {
return base.remove(path, id, name)
}
-export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> {
+export async function getValueLabelList(params: any = null, useCodeAsValue = false): 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: Subspecialist) => ({
- value: item.id ? Number(item.id) : item.code,
+ value: useCodeAsValue ? item.code
+ : item.id ? Number(item.id)
+ : item.id,
label: item.name,
parent: item.specialist_id ? Number(item.specialist_id) : null,
}))
diff --git a/app/services/unit.service.ts b/app/services/unit.service.ts
index ec1ccec0..402504b6 100644
--- a/app/services/unit.service.ts
+++ b/app/services/unit.service.ts
@@ -27,13 +27,15 @@ export function remove(id: number | string) {
return base.remove(path, id, name)
}
-export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> {
+export async function getValueLabelList(params: any = null, useCodeAsValue = false): 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: Unit) => ({
- value: item.id,
+ value: useCodeAsValue ? item.code
+ : item.id ? Number(item.id)
+ : item.id,
label: item.name,
}))
}
diff --git a/public/side-menu-items/system.json b/public/side-menu-items/system.json
index d5e4fbb4..31890951 100644
--- a/public/side-menu-items/system.json
+++ b/public/side-menu-items/system.json
@@ -199,6 +199,11 @@
"title": "Peserta",
"icon": "i-lucide-circuit-board",
"link": "/integration/bpjs/member"
+ },
+ {
+ "title": "Surat Kontrol",
+ "icon": "i-lucide-circuit-board",
+ "link": "/integration/bpjs/control-letter"
}
]
},
From 94e4ead8fe13ad7dc518ad87d1f3f01620791d01 Mon Sep 17 00:00:00 2001
From: hasyim_kai
Date: Tue, 18 Nov 2025 13:13:52 +0700
Subject: [PATCH 25/35] Fix: debug updaate medicine master
---
app/components/content/equipment/list.vue | 5 +++--
app/components/content/medicine-group/list.vue | 5 +++--
app/components/content/medicine-method/list.vue | 5 +++--
app/components/content/medicine/list.vue | 5 +++--
app/components/content/tools/list.vue | 4 ++--
5 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/app/components/content/equipment/list.vue b/app/components/content/equipment/list.vue
index 19e5d913..0db6034c 100644
--- a/app/components/content/equipment/list.vue
+++ b/app/components/content/equipment/list.vue
@@ -110,6 +110,7 @@ watch([recId, recAction], () => {
getCurrentMaterialDetail(recId.value)
title.value = 'Edit Perlengkapan'
isReadonly.value = false
+ isFormEntryDialogOpen.value = true
break
case ActionEvents.showConfirmDelete:
isRecordConfirmationOpen.value = true
@@ -158,7 +159,7 @@ onMounted(async () => {
@submit="
(values: MaterialFormData, resetForm: any) => {
if (recId > 0) {
- handleActionEdit(recId, values, getEquipmentList, resetForm, toast)
+ handleActionEdit(recItem.code, values, getEquipmentList, resetForm, toast)
return
}
handleActionSave(values, getEquipmentList, resetForm, toast)
@@ -173,7 +174,7 @@ onMounted(async () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
- @confirm="() => handleActionRemove(recId, getEquipmentList, toast)"
+ @confirm="() => handleActionRemove(recItem.code, getEquipmentList, toast)"
@cancel=""
>
diff --git a/app/components/content/medicine-group/list.vue b/app/components/content/medicine-group/list.vue
index 80faf1ab..6c695d72 100644
--- a/app/components/content/medicine-group/list.vue
+++ b/app/components/content/medicine-group/list.vue
@@ -108,6 +108,7 @@ watch([recId, recAction], () => {
getCurrentMedicineGroupDetail(recId.value)
title.value = 'Edit Kelompok Obat'
isReadonly.value = false
+ isFormEntryDialogOpen.value = true
break
case ActionEvents.showConfirmDelete:
isRecordConfirmationOpen.value = true
@@ -154,7 +155,7 @@ onMounted(async () => {
@submit="
(values: BaseFormData | Record, resetForm: () => void) => {
if (recId > 0) {
- handleActionEdit(recId, values, getMedicineGroupList, resetForm, toast)
+ handleActionEdit(recItem.code, values, getMedicineGroupList, resetForm, toast)
return
}
handleActionSave(values, getMedicineGroupList, resetForm, toast)
@@ -169,7 +170,7 @@ onMounted(async () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
- @confirm="() => handleActionRemove(recId, getMedicineGroupList, toast)"
+ @confirm="() => handleActionRemove(recItem.code, getMedicineGroupList, toast)"
@cancel=""
>
diff --git a/app/components/content/medicine-method/list.vue b/app/components/content/medicine-method/list.vue
index 9e0e5d01..2c8fb8c6 100644
--- a/app/components/content/medicine-method/list.vue
+++ b/app/components/content/medicine-method/list.vue
@@ -108,6 +108,7 @@ watch([recId, recAction], () => {
getCurrentMedicineMethodDetail(recId.value)
title.value = 'Edit Metode Obat'
isReadonly.value = false
+ isFormEntryDialogOpen.value = true
break
case ActionEvents.showConfirmDelete:
isRecordConfirmationOpen.value = true
@@ -154,7 +155,7 @@ onMounted(async () => {
@submit="
(values: BaseFormData | Record, resetForm: () => void) => {
if (recId > 0) {
- handleActionEdit(recId, values, getMedicineMethodList, resetForm, toast)
+ handleActionEdit(recItem.code, values, getMedicineMethodList, resetForm, toast)
return
}
handleActionSave(values, getMedicineMethodList, resetForm, toast)
@@ -169,7 +170,7 @@ onMounted(async () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
- @confirm="() => handleActionRemove(recId, getMedicineMethodList, toast)"
+ @confirm="() => handleActionRemove(recItem.code, getMedicineMethodList, toast)"
@cancel=""
>
diff --git a/app/components/content/medicine/list.vue b/app/components/content/medicine/list.vue
index 43667c33..bfbf8750 100644
--- a/app/components/content/medicine/list.vue
+++ b/app/components/content/medicine/list.vue
@@ -118,6 +118,7 @@ watch([recId, recAction], () => {
case ActionEvents.showEdit:
getCurrentMedicineDetail(recId.value)
title.value = 'Edit Obat'
+ isFormEntryDialogOpen.value = true
isReadonly.value = false
break
case ActionEvents.showConfirmDelete:
@@ -173,7 +174,7 @@ onMounted(async () => {
@submit="
(values: MedicineFormData | Record, resetForm: () => void) => {
if (recId > 0) {
- handleActionEdit(recId, values, getMedicineList, resetForm, toast)
+ handleActionEdit(recItem.code, values, getMedicineList, resetForm, toast)
return
}
handleActionSave(values, getMedicineList, resetForm, toast)
@@ -188,7 +189,7 @@ onMounted(async () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
- @confirm="() => handleActionRemove(recId, getMedicineList, toast)"
+ @confirm="() => handleActionRemove(recItem.code, getMedicineList, toast)"
@cancel=""
>
diff --git a/app/components/content/tools/list.vue b/app/components/content/tools/list.vue
index da22a976..4f50199f 100644
--- a/app/components/content/tools/list.vue
+++ b/app/components/content/tools/list.vue
@@ -163,7 +163,7 @@ onMounted(async () => {
@submit="
(values: DeviceFormData, resetForm: any) => {
if (recId > 0) {
- handleActionEdit(recId, values, getToolsList, resetForm, toast)
+ handleActionEdit(recItem.code, values, getToolsList, resetForm, toast)
return
}
handleActionSave(values, getToolsList, resetForm, toast)
@@ -178,7 +178,7 @@ onMounted(async () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
- @confirm="() => handleActionRemove(recId, getToolsList, toast)"
+ @confirm="() => handleActionRemove(recItem.code, getToolsList, toast)"
@cancel=""
>
From 0a68dbf3a625fec9580310aca1d34ccf74ba2a31 Mon Sep 17 00:00:00 2001
From: hasyim_kai
Date: Tue, 18 Nov 2025 15:31:04 +0700
Subject: [PATCH 26/35] Fix: debug after reset
---
.../_common/select-doc-type.vue | 71 ++++
.../app/document-upload/entry-form.vue | 73 ++++
.../app/document-upload/list.cfg.ts | 43 ++
app/components/app/document-upload/list.vue | 31 ++
.../content/document-upload/add.vue | 128 ++++++
.../content/document-upload/edit.vue | 134 +++++++
.../content/document-upload/list.vue | 170 ++++++++
app/components/content/encounter/process.vue | 28 +-
.../pub/my-ui/data/dropdown-action-dd.vue | 80 ++++
.../pub/my-ui/data/dropdown-action-dud.vue | 11 +-
app/components/pub/my-ui/form/file-field.vue | 2 +-
.../pub/my-ui/modal/doc-preview-dialog.vue | 29 ++
.../pub/my-ui/nav-footer/ba-dr-su.vue | 2 +-
app/composables/useRBAC.ts | 15 +
app/handlers/supporting-document.handler.ts | 24 ++
app/lib/constants.ts | 42 ++
app/lib/utils.ts | 57 +++
app/models/encounter-document.ts | 29 ++
app/models/encounter.ts | 5 +-
.../encounter/[id]/control-letter/add.vue | 9 +-
.../document-upload/[document_id]/edit.vue} | 15 +-
.../encounter/[id]/document-upload/add.vue} | 27 +-
.../rehab/encounter/[id]/process.vue | 6 +-
app/schemas/document-upload.schema.ts | 24 ++
app/services/supporting-document.service.ts | 56 +++
public/side-menu-items/sys.json | 368 ++++++++++++++++++
26 files changed, 1427 insertions(+), 52 deletions(-)
create mode 100644 app/components/app/document-upload/_common/select-doc-type.vue
create mode 100644 app/components/app/document-upload/entry-form.vue
create mode 100644 app/components/app/document-upload/list.cfg.ts
create mode 100644 app/components/app/document-upload/list.vue
create mode 100644 app/components/content/document-upload/add.vue
create mode 100644 app/components/content/document-upload/edit.vue
create mode 100644 app/components/content/document-upload/list.vue
create mode 100644 app/components/pub/my-ui/data/dropdown-action-dd.vue
create mode 100644 app/components/pub/my-ui/modal/doc-preview-dialog.vue
create mode 100644 app/handlers/supporting-document.handler.ts
create mode 100644 app/models/encounter-document.ts
rename app/pages/(features)/{outpation-action/chemotherapy/list.vue => rehab/encounter/[id]/document-upload/[document_id]/edit.vue} (74%)
rename app/pages/(features)/{outpation-action/chemotherapy/[mode]/[id]/verification.vue => rehab/encounter/[id]/document-upload/add.vue} (53%)
create mode 100644 app/schemas/document-upload.schema.ts
create mode 100644 app/services/supporting-document.service.ts
create mode 100644 public/side-menu-items/sys.json
diff --git a/app/components/app/document-upload/_common/select-doc-type.vue b/app/components/app/document-upload/_common/select-doc-type.vue
new file mode 100644
index 00000000..70f78a7b
--- /dev/null
+++ b/app/components/app/document-upload/_common/select-doc-type.vue
@@ -0,0 +1,71 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/document-upload/entry-form.vue b/app/components/app/document-upload/entry-form.vue
new file mode 100644
index 00000000..f97a5161
--- /dev/null
+++ b/app/components/app/document-upload/entry-form.vue
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/document-upload/list.cfg.ts b/app/components/app/document-upload/list.cfg.ts
new file mode 100644
index 00000000..979c916d
--- /dev/null
+++ b/app/components/app/document-upload/list.cfg.ts
@@ -0,0 +1,43 @@
+import type { Config } from '~/components/pub/my-ui/data-table'
+import { defineAsyncComponent } from 'vue'
+import { docTypeCode, docTypeLabel, type docTypeCodeKey } from '~/lib/constants'
+
+const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dd.vue'))
+
+export const config: Config = {
+ cols: [{}, {}, {}, {width: 50},],
+
+ headers: [
+ [
+ { label: 'Nama Dokumen' },
+ { label: 'Tipe Dokumen' },
+ { label: 'Petugas Upload' },
+ { label: 'Action' },
+ ],
+ ],
+
+ keys: ['fileName', 'type_code', 'employee.name', 'action'],
+
+ delKeyNames: [
+
+ ],
+
+ parses: {
+ type_code: (v: unknown) => {
+ return docTypeLabel[v?.type_code as docTypeCodeKey]
+ },
+ },
+
+ components: {
+ action(rec, idx) {
+ return {
+ idx,
+ rec: rec as object,
+ component: action,
+ }
+ },
+ },
+
+ htmls: {
+ },
+}
diff --git a/app/components/app/document-upload/list.vue b/app/components/app/document-upload/list.vue
new file mode 100644
index 00000000..8274e752
--- /dev/null
+++ b/app/components/app/document-upload/list.vue
@@ -0,0 +1,31 @@
+
+
+
+
+
diff --git a/app/components/content/document-upload/add.vue b/app/components/content/document-upload/add.vue
new file mode 100644
index 00000000..7d42f4f6
--- /dev/null
+++ b/app/components/content/document-upload/add.vue
@@ -0,0 +1,128 @@
+
+
+
+
+
Upload Dokumen
+
+
+
+
+
+
+
+
+
diff --git a/app/components/content/document-upload/edit.vue b/app/components/content/document-upload/edit.vue
new file mode 100644
index 00000000..c4033fb2
--- /dev/null
+++ b/app/components/content/document-upload/edit.vue
@@ -0,0 +1,134 @@
+
+
+
+
+
Upload Dokumen
+
+
+
+
+
+
+
+
+
diff --git a/app/components/content/document-upload/list.vue b/app/components/content/document-upload/list.vue
new file mode 100644
index 00000000..4fc55bc4
--- /dev/null
+++ b/app/components/content/document-upload/list.vue
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+ ID:
+ {{ record?.id }}
+
+
+ Nama:
+ {{ record?.name }}
+
+
+
+
+
+
+
+
+
diff --git a/app/components/content/encounter/process.vue b/app/components/content/encounter/process.vue
index 23640af7..ecf44507 100644
--- a/app/components/content/encounter/process.vue
+++ b/app/components/content/encounter/process.vue
@@ -19,6 +19,8 @@ import CpLabOrder from '~/components/content/cp-lab-order/main.vue'
import Radiology from '~/components/content/radiology-order/main.vue'
import Consultation from '~/components/content/consultation/list.vue'
import ControlLetterList from '~/components/content/control-letter/list.vue'
+import DocUploadList from '~/components/content/document-upload/list.vue'
+import { genEncounter } from '~/models/encounter'
const route = useRoute()
const router = useRouter()
@@ -32,12 +34,18 @@ const activeTab = computed({
})
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 data = ref(genEncounter())
+
+async function fetchDetail() {
+ const res = await getDetail(id, {
+ includes: 'patient,patient-person,patient-person-addresses,unit,Appointment_Doctor,Appointment_Doctor-employee,Appointment_Doctor-employee-person,EncounterDocuments',
+ })
+ if(res.body?.data) data.value = res.body?.data
+}
+
+onMounted(() => {
+ fetchDetail()
})
-const dataResBody = dataRes.body ?? null
-const data = dataResBody?.data ?? null
const tabs: TabItem[] = [
{ value: 'status', label: 'Status Masuk/Keluar', component: Status, props: { encounter: data } },
@@ -63,10 +71,10 @@ const tabs: TabItem[] = [
{ value: 'education-assessment', label: 'Asesmen Kebutuhan Edukasi' },
{ value: 'consent', label: 'General Consent' },
{ value: 'patient-note', label: 'CPRJ' },
- { value: 'prescription', label: 'Order Obat', component: Prescription, props: { encounter_id: data.id } },
+ { value: 'prescription', label: 'Order Obat', component: Prescription, props: { encounter_id: data.value.id } },
{ value: 'device', label: 'Order Alkes' },
- { value: 'mcu-radiology', label: 'Order Radiologi', component: Radiology, props: { encounter_id: data.id } },
- { value: 'mcu-lab-cp', label: 'Order Lab PK', component: CpLabOrder, props: { encounter_id: data.id } },
+ { value: 'mcu-radiology', label: 'Order Radiologi', component: Radiology, props: { encounter_id: data.value.id } },
+ { value: 'mcu-lab-cp', label: 'Order Lab PK', component: CpLabOrder, props: { encounter_id: data.value.id } },
{ value: 'mcu-lab-micro', label: 'Order Lab Mikro' },
{ value: 'mcu-lab-pa', label: 'Order Lab PA' },
{ value: 'medical-action', label: 'Order Ruang Tindakan' },
@@ -75,7 +83,7 @@ const tabs: TabItem[] = [
{ value: 'resume', label: 'Resume' },
{ value: 'control', label: 'Surat Kontrol', component: ControlLetterList, props: { encounter: data } },
{ value: 'screening', label: 'Skrinning MPP' },
- { value: 'supporting-document', label: 'Upload Dokumen Pendukung' },
+ { value: 'supporting-document', label: 'Upload Dokumen Pendukung', component: DocUploadList, props: { encounter: data, }, },
]
@@ -91,4 +99,4 @@ const tabs: TabItem[] = [
@change-tab="activeTab = $event"
/>
-
+
\ No newline at end of file
diff --git a/app/components/pub/my-ui/data/dropdown-action-dd.vue b/app/components/pub/my-ui/data/dropdown-action-dd.vue
new file mode 100644
index 00000000..a6a99c9a
--- /dev/null
+++ b/app/components/pub/my-ui/data/dropdown-action-dd.vue
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/pub/my-ui/data/dropdown-action-dud.vue b/app/components/pub/my-ui/data/dropdown-action-dud.vue
index dfcf1ada..71979c7c 100644
--- a/app/components/pub/my-ui/data/dropdown-action-dud.vue
+++ b/app/components/pub/my-ui/data/dropdown-action-dud.vue
@@ -2,14 +2,9 @@
import type { LinkItem, ListItemDto } from './types'
import { ActionEvents } from './types'
-interface Props {
+const props = defineProps<{
rec: ListItemDto
- size?: 'default' | 'sm' | 'lg'
-}
-
-const props = withDefaults(defineProps
(), {
- size: 'lg',
-})
+}>()
const recId = inject[>('rec_id')!
const recAction = inject][>('rec_action')!
@@ -63,7 +58,7 @@ function del() {
]
-
+
\ No newline at end of file
diff --git a/app/composables/useRBAC.ts b/app/composables/useRBAC.ts
index ced57e3e..6cc01d72 100644
--- a/app/composables/useRBAC.ts
+++ b/app/composables/useRBAC.ts
@@ -1,5 +1,12 @@
import type { Permission, RoleAccess } from '~/models/role'
+export interface PageOperationPermission {
+ canRead: boolean
+ canCreate: boolean
+ canUpdate: boolean
+ canDelete: boolean
+}
+
/**
* Check if user has access to a page
*/
@@ -36,6 +43,13 @@ export function useRBAC() {
const hasUpdateAccess = (roleAccess: RoleAccess) => checkPermission(roleAccess, 'U')
const hasDeleteAccess = (roleAccess: RoleAccess) => checkPermission(roleAccess, 'D')
+ const getPagePermissions = (roleAccess: RoleAccess): PageOperationPermission => ({
+ canRead : hasReadAccess(roleAccess),
+ canCreate: hasCreateAccess(roleAccess),
+ canUpdate: hasUpdateAccess(roleAccess),
+ canDelete: hasDeleteAccess(roleAccess),
+ })
+
return {
checkRole,
checkPermission,
@@ -44,5 +58,6 @@ export function useRBAC() {
hasReadAccess,
hasUpdateAccess,
hasDeleteAccess,
+ getPagePermissions,
}
}
diff --git a/app/handlers/supporting-document.handler.ts b/app/handlers/supporting-document.handler.ts
new file mode 100644
index 00000000..70b29612
--- /dev/null
+++ b/app/handlers/supporting-document.handler.ts
@@ -0,0 +1,24 @@
+// Handlers
+import { genCrudHandler } from '~/handlers/_handler'
+
+// Services
+import { create, update, remove } from '~/services/supporting-document.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 3a52b22e..48fb5c8c 100644
--- a/app/lib/constants.ts
+++ b/app/lib/constants.ts
@@ -383,3 +383,45 @@ export const medicalActionTypeCode: Record
= {
} as const
export type medicalActionTypeCodeKey = keyof typeof medicalActionTypeCode
+
+export const encounterDocTypeCode: Record = {
+ "person-resident-number": 'person-resident-number',
+ "person-driving-license": 'person-driving-license',
+ "person-passport": 'person-passport',
+ "person-family-card": 'person-family-card',
+ "mcu-item-result": 'mcu-item-result',
+ "vclaim-sep": 'vclaim-sep',
+ "vclaim-sipp": 'vclaim-sipp',
+} as const
+export type encounterDocTypeCodeKey = keyof typeof encounterDocTypeCode
+export const encounterDocOpt: { label: string; value: encounterDocTypeCodeKey }[] = [
+ { label: 'KTP', value: 'person-resident-number' },
+ { label: 'SIM', value: 'person-driving-license' },
+ { label: 'Passport', value: 'person-passport' },
+ { label: 'Kartu Keluarga', value: 'person-family-card' },
+ { label: 'Hasil MCU', value: 'mcu-item-result' },
+ { label: 'Klaim SEP', value: 'vclaim-sep' },
+ { label: 'Klaim SIPP', value: 'vclaim-sipp' },
+]
+
+
+export const docTypeCode = {
+ "encounter-patient": 'encounter-patient',
+ "encounter-support": 'encounter-support',
+ "encounter-other": 'encounter-other',
+ "vclaim-sep": 'vclaim-sep',
+ "vclaim-sipp": 'vclaim-sipp',
+} as const
+export const docTypeLabel = {
+ "encounter-patient": 'Data Pasien',
+ "encounter-support": 'Data Penunjang',
+ "encounter-other": 'Lain - Lain',
+ "vclaim-sep": 'SEP',
+ "vclaim-sipp": 'SIPP',
+} as const
+export type docTypeCodeKey = keyof typeof docTypeCode
+export const supportingDocOpt = [
+ { label: 'Data Pasien', value: 'encounter-patient' },
+ { label: 'Data Penunjang', value: 'encounter-support' },
+ { label: 'Lain - Lain', value: 'encounter-other' },
+]
diff --git a/app/lib/utils.ts b/app/lib/utils.ts
index 357d8700..e201a439 100644
--- a/app/lib/utils.ts
+++ b/app/lib/utils.ts
@@ -1,6 +1,7 @@
import type { ClassValue } from 'clsx'
import { clsx } from 'clsx'
import { twMerge } from 'tailwind-merge'
+import { toast } from '~/components/pub/ui/toast'
export interface SelectOptionType<_T = string> {
value: string
@@ -104,3 +105,59 @@ export function calculateAge(birthDate: Date | string | null | undefined): strin
return `${years} tahun ${months} bulan`
}
}
+
+
+/**
+ * Converts a plain JavaScript object (including File objects) into a FormData instance.
+ * @param {object} data - The object to convert (e.g., form values).
+ * @returns {FormData} The new FormData object suitable for API submission.
+ */
+export function toFormData(data: Record): FormData {
+ const formData = new FormData();
+
+ for (const key in data) {
+ if (Object.prototype.hasOwnProperty.call(data, key)) {
+ const value = data[key];
+
+ // Handle File objects, Blobs, or standard JSON values
+ if (value !== null && value !== undefined) {
+ // Check if the value is a File/Blob instance
+ if (value instanceof File || value instanceof Blob) {
+ // Append the file directly
+ formData.append(key, value);
+ } else if (typeof value === 'object') {
+ // Handle nested objects/arrays by stringifying them (optional, depends on API)
+ // Note: Most APIs expect nested data to be handled separately or passed as JSON string
+ // For simplicity, we stringify non-File objects.
+ formData.append(key, JSON.stringify(value));
+ } else {
+ // Append standard string, number, or boolean values
+ formData.append(key, value);
+ }
+ }
+ }
+ }
+
+ return formData;
+}
+
+export function printFormData(formData: FormData) {
+ console.log("--- FormData Contents ---");
+ // Use the entries() iterator to loop through key/value pairs
+ for (const [key, value] of formData.entries()) {
+ if (value instanceof File) {
+ console.log(`Key: ${key}, Value: [File: ${value.name}, Type: ${value.type}, Size: ${value.size} bytes]`);
+ } else {
+ console.log(`Key: ${key}, Value: "${value}"`);
+ }
+ }
+ console.log("-------------------------");
+}
+
+export function unauthorizedToast() {
+ toast({
+ title: 'Unauthorized',
+ description: 'You are not authorized to perform this action.',
+ variant: 'destructive',
+ })
+}
\ No newline at end of file
diff --git a/app/models/encounter-document.ts b/app/models/encounter-document.ts
new file mode 100644
index 00000000..5a98ccd5
--- /dev/null
+++ b/app/models/encounter-document.ts
@@ -0,0 +1,29 @@
+import { type Base, genBase } from "./_base"
+import { docTypeLabel, } from '~/lib/constants'
+import { genEmployee, type Employee } from "./employee"
+import { genEncounter, type Encounter } from "./encounter"
+
+export interface EncounterDocument extends Base {
+ encounter_id: number
+ encounter?: Encounter
+ upload_employee_id: number
+ employee?: Employee
+ type_code: string
+ name: string
+ filePath: string
+ fileName: string
+}
+
+export function genEncounterDocument(): EncounterDocument {
+ return {
+ ...genBase(),
+ encounter_id: 2,
+ encounter: genEncounter(),
+ upload_employee_id: 0,
+ employee: genEmployee(),
+ type_code: docTypeLabel["encounter-patient"],
+ name: 'example',
+ filePath: 'https://bing.com',
+ fileName: 'example',
+ }
+}
diff --git a/app/models/encounter.ts b/app/models/encounter.ts
index fb2c0b04..55fbdfa4 100644
--- a/app/models/encounter.ts
+++ b/app/models/encounter.ts
@@ -1,6 +1,7 @@
import type { DeathCause } from "./death-cause"
import { type Doctor, genDoctor } from "./doctor"
import { genEmployee, type Employee } from "./employee"
+import type { EncounterDocument } from "./encounter-document"
import type { InternalReference } from "./internal-reference"
import { type Patient, genPatient } from "./patient"
import type { Specialist } from "./specialist"
@@ -37,6 +38,7 @@ export interface Encounter {
internalReferences?: InternalReference[]
deathCause?: DeathCause
status_code: string
+ encounterDocuments: EncounterDocument[]
}
export function genEncounter(): Encounter {
@@ -54,7 +56,8 @@ export function genEncounter(): Encounter {
appointment_doctor_id: 0,
appointment_doctor: genDoctor(),
medicalDischargeEducation: '',
- status_code: ''
+ status_code: '',
+ encounterDocuments: [],
}
}
diff --git a/app/pages/(features)/rehab/encounter/[id]/control-letter/add.vue b/app/pages/(features)/rehab/encounter/[id]/control-letter/add.vue
index 1070a29f..fa0b386b 100644
--- a/app/pages/(features)/rehab/encounter/[id]/control-letter/add.vue
+++ b/app/pages/(features)/rehab/encounter/[id]/control-letter/add.vue
@@ -16,9 +16,9 @@ useHead({
title: () => route.meta.title as string,
})
-const roleAccess: PagePermission = PAGE_PERMISSIONS['/patient']
+const roleAccess: PagePermission = PAGE_PERMISSIONS['/rehab/encounter']
-const { checkRole, hasReadAccess } = useRBAC()
+const { checkRole, getPagePermissions } = useRBAC()
// Check if user has access to this page
const hasAccess = checkRole(roleAccess)
@@ -27,14 +27,13 @@ const hasAccess = checkRole(roleAccess)
// }
// Define permission-based computed properties
-// const canRead = hasReadAccess(roleAccess)
-const canRead = true
+const pagePermission = getPagePermissions(roleAccess)
const callbackUrl = route.query['return-path'] as string | undefined
-
+
diff --git a/app/pages/(features)/outpation-action/chemotherapy/list.vue b/app/pages/(features)/rehab/encounter/[id]/document-upload/[document_id]/edit.vue
similarity index 74%
rename from app/pages/(features)/outpation-action/chemotherapy/list.vue
rename to app/pages/(features)/rehab/encounter/[id]/document-upload/[document_id]/edit.vue
index a141baaa..1cf5cc7c 100644
--- a/app/pages/(features)/outpation-action/chemotherapy/list.vue
+++ b/app/pages/(features)/rehab/encounter/[id]/document-upload/[document_id]/edit.vue
@@ -6,7 +6,7 @@ import { PAGE_PERMISSIONS } from '~/lib/page-permission'
definePageMeta({
middleware: ['rbac'],
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
- title: 'Daftar Kempterapi',
+ title: 'Update Dokumen Pendukung',
contentFrame: 'cf-full-width',
})
@@ -16,24 +16,25 @@ useHead({
title: () => route.meta.title as string,
})
-const roleAccess: PagePermission = PAGE_PERMISSIONS['/doctor']
+const roleAccess: PagePermission = PAGE_PERMISSIONS['/patient']
const { checkRole, hasReadAccess } = useRBAC()
// Check if user has access to this page
const hasAccess = checkRole(roleAccess)
-if (!hasAccess) {
- navigateTo('/403')
-}
+// if (!hasAccess) {
+// navigateTo('/403')
+// }
// Define permission-based computed properties
-const canRead = true // hasReadAccess(roleAccess)
+// const canRead = hasReadAccess(roleAccess)
+const canRead = true
diff --git a/app/pages/(features)/outpation-action/chemotherapy/[mode]/[id]/verification.vue b/app/pages/(features)/rehab/encounter/[id]/document-upload/add.vue
similarity index 53%
rename from app/pages/(features)/outpation-action/chemotherapy/[mode]/[id]/verification.vue
rename to app/pages/(features)/rehab/encounter/[id]/document-upload/add.vue
index ef936ff2..e04220f3 100644
--- a/app/pages/(features)/outpation-action/chemotherapy/[mode]/[id]/verification.vue
+++ b/app/pages/(features)/rehab/encounter/[id]/document-upload/add.vue
@@ -2,46 +2,41 @@
import type { PagePermission } from '~/models/role'
import Error from '~/components/pub/my-ui/error/error.vue'
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
-import ContentChemotherapyAdminList from '~/components/content/chemotherapy/admin-list.vue'
-import ContentChemotherapyVerification from '~/components/content/chemotherapy/verification.vue'
definePageMeta({
middleware: ['rbac'],
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
- title: 'Kemoterapi Admin',
+ title: 'Tambah Dokumen Pendukung',
contentFrame: 'cf-full-width',
})
const route = useRoute()
useHead({
- title: () => 'Verifikasi Jadwal Pasien',
+ title: () => route.meta.title as string,
})
-const roleAccess: PagePermission = PAGE_PERMISSIONS['/doctor'] || {}
+const roleAccess: PagePermission = PAGE_PERMISSIONS['/patient']
const { checkRole, hasReadAccess } = useRBAC()
// Check if user has access to this page
const hasAccess = checkRole(roleAccess)
-if (!hasAccess) {
- navigateTo('/403')
-}
+// if (!hasAccess) {
+// navigateTo('/403')
+// }
// Define permission-based computed properties
-const canRead = true // hasReadAccess(roleAccess)
-
-const mode = computed(() => route.params.mode as string)
+// const canRead = hasReadAccess(roleAccess)
+const canRead = true
+const callbackUrl = route.query['return-path'] as string | undefined
diff --git a/app/pages/(features)/rehab/encounter/[id]/process.vue b/app/pages/(features)/rehab/encounter/[id]/process.vue
index abd0efa7..e25b0e77 100644
--- a/app/pages/(features)/rehab/encounter/[id]/process.vue
+++ b/app/pages/(features)/rehab/encounter/[id]/process.vue
@@ -18,7 +18,7 @@ useHead({
const roleAccess: PagePermission = PAGE_PERMISSIONS['/rehab/encounter']
-const { checkRole, hasCreateAccess } = useRBAC()
+const { checkRole, hasCreateAccess, getPagePermissions } = useRBAC()
// Check if user has access to this page
const hasAccess = checkRole(roleAccess)
@@ -30,11 +30,11 @@ const hasAccess = checkRole(roleAccess)
// }
// Define permission-based computed properties
-const canCreate = true // hasCreateAccess(roleAccess)
+const pagePermission = getPagePermissions(roleAccess)
-
+
diff --git a/app/schemas/document-upload.schema.ts b/app/schemas/document-upload.schema.ts
new file mode 100644
index 00000000..1cfaeee2
--- /dev/null
+++ b/app/schemas/document-upload.schema.ts
@@ -0,0 +1,24 @@
+import { z } from 'zod'
+
+const ACCEPTED_UPLOAD_TYPES = ['image/jpeg', 'image/png', 'application/pdf']
+const MAX_SIZE_BYTES = 1 * 1024 * 1024 // 1MB
+
+const DocumentUploadSchema = z.object({
+ entityType_code: z.string().default('encounter'),
+ ref_id: z.number(),
+ upload_employee_id: z.number().optional(),
+ name: z.string({ required_error: 'Mohon isi', }),
+ type_code: z.string({ required_error: 'Mohon isi', }),
+ content: z.custom
()
+ .refine((f) => f, { message: 'File tidak boleh kosong' })
+ .refine((f) => !f || f instanceof File, { message: 'Harus berupa file yang valid' })
+ .refine((f) => !f || ACCEPTED_UPLOAD_TYPES.includes(f.type), {
+ message: 'Format file harus JPG, PNG, atau PDF',
+ })
+ .refine((f) => !f || f.size <= MAX_SIZE_BYTES, { message: 'Maksimal 1MB' }),
+})
+
+type DocumentUploadFormData = z.infer
+
+export { DocumentUploadSchema }
+export type { DocumentUploadFormData }
diff --git a/app/services/supporting-document.service.ts b/app/services/supporting-document.service.ts
new file mode 100644
index 00000000..46eaffa9
--- /dev/null
+++ b/app/services/supporting-document.service.ts
@@ -0,0 +1,56 @@
+// Base
+import * as base from './_crud-base'
+
+// Constants
+import { encounterClassCodes, uploadCode, type UploadCodeKey } from '~/lib/constants'
+
+const path = '/api/v1/encounter-document'
+const create_path = '/api/v1/upload'
+const name = 'encounter-document'
+
+export function create(data: any) {
+ return base.create(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)
+}
+
+export async function uploadAttachment(file: File, userId: number, key: UploadCodeKey) {
+ try {
+ const resolvedKey = uploadCode[key]
+ if (!resolvedKey) {
+ throw new Error(`Invalid upload code key: ${key}`)
+ }
+
+ // siapkan form-data body
+ const formData = new FormData()
+ formData.append('code', resolvedKey)
+ formData.append('content', file)
+
+ // kirim via xfetch
+ const resp = await xfetch(`${path}/${userId}/upload`, 'POST', formData)
+
+ // struktur hasil sama seperti patchPatient
+ const result: any = {}
+ result.success = resp.success
+ result.body = (resp.body as Record) || {}
+
+ return result
+ } catch (error) {
+ console.error('Error uploading attachment:', error)
+ throw new Error('Failed to upload attachment')
+ }
+}
\ No newline at end of file
diff --git a/public/side-menu-items/sys.json b/public/side-menu-items/sys.json
new file mode 100644
index 00000000..c26d85aa
--- /dev/null
+++ b/public/side-menu-items/sys.json
@@ -0,0 +1,368 @@
+[
+ {
+ "heading": "Menu Utama",
+ "items": [
+ {
+ "title": "Dashboard",
+ "icon": "i-lucide-home",
+ "link": "/"
+ },
+ {
+ "title": "Rawat Jalan",
+ "icon": "i-lucide-stethoscope",
+ "children": [
+ {
+ "title": "Antrian Pendaftaran",
+ "link": "/outpatient/registration-queue"
+ },
+ {
+ "title": "Antrian Poliklinik",
+ "link": "/outpatient/polyclinic-queue"
+ },
+ {
+ "title": "Kunjungan",
+ "link": "/outpatient/encounter"
+ },
+ {
+ "title": "Konsultasi",
+ "link": "/outpatient/consultation"
+ }
+ ]
+ },
+ {
+ "title": "IGD",
+ "icon": "i-lucide-zap",
+ "children": [
+ {
+ "title": "Triase",
+ "link": "/emergency/triage"
+ },
+ {
+ "title": "Kunjungan",
+ "link": "/emergency/encounter"
+ },
+ {
+ "title": "Konsultasi",
+ "link": "/emergency/consultation"
+ }
+ ]
+ },
+ {
+ "title": "Rehab Medik",
+ "icon": "i-lucide-bike",
+ "children": [
+ {
+ "title": "Antrean Pendaftaran",
+ "link": "/rehab/registration-queue"
+ },
+ {
+ "title": "Antrean Poliklinik",
+ "link": "/rehab/polyclinic-queue"
+ },
+ {
+ "title": "Kunjungan",
+ "link": "/rehab/encounter"
+ },
+ {
+ "title": "Konsultasi",
+ "link": "/rehab/consultation"
+ }
+ ]
+ },
+ {
+ "title": "Rawat Inap",
+ "icon": "i-lucide-building-2",
+ "children": [
+ {
+ "title": "Permintaan",
+ "link": "/inpatient/request"
+ },
+ {
+ "title": "Kunjungan",
+ "link": "/inpatient/encounter"
+ },
+ {
+ "title": "Konsultasi",
+ "link": "/inpatient/consultation"
+ }
+ ]
+ },
+ {
+ "title": "Obat - Order",
+ "icon": "i-lucide-briefcase-medical",
+ "children": [
+ {
+ "title": "Permintaan",
+ "link": "/medication/order"
+ },
+ {
+ "title": "Standing Order",
+ "link": "/medication/standing-order"
+ }
+ ]
+ },
+ {
+ "title": "Lab - Order",
+ "icon": "i-lucide-microscope",
+ "link": "/pc-lab-order"
+ },
+ {
+ "title": "Lab Mikro - Order",
+ "icon": "i-lucide-microscope",
+ "link": "/micro-lab-order"
+ },
+ {
+ "title": "Lab PA - Order",
+ "icon": "i-lucide-microscope",
+ "link": "/pa-lab-order"
+ },
+ {
+ "title": "Radiologi - Order",
+ "icon": "i-lucide-radio",
+ "link": "/radiology-order"
+ },
+ {
+ "title": "Gizi",
+ "icon": "i-lucide-egg-fried",
+ "link": "/nutrition-order"
+ },
+ {
+ "title": "Pembayaran",
+ "icon": "i-lucide-banknote-arrow-up",
+ "link": "/payment"
+ }
+ ]
+ },
+ {
+ "heading": "Ruang Tindakan Rajal",
+ "items": [
+ {
+ "title": "Kemoterapi",
+ "icon": "i-lucide-droplets",
+ "link": "/outpation-action/cemotherapy"
+ },
+ {
+ "title": "Hemofilia",
+ "icon": "i-lucide-droplet-off",
+ "link": "/outpation-action/hemophilia"
+ }
+ ]
+ },
+ {
+ "heading": "Ruang Tindakan Anak",
+ "items": [
+ {
+ "title": "Thalasemi",
+ "icon": "i-lucide-baby",
+ "link": "/children-action/thalasemia"
+ },
+ {
+ "title": "Echocardiography",
+ "icon": "i-lucide-baby",
+ "link": "/children-action/echocardiography"
+ },
+ {
+ "title": "Spirometri",
+ "icon": "i-lucide-baby",
+ "link": "/children-action/spirometry"
+ }
+ ]
+ },
+ {
+ "heading": "Client",
+ "items": [
+ {
+ "title": "Pasien",
+ "icon": "i-lucide-users",
+ "link": "/client/patient"
+ },
+ {
+ "title": "Rekam Medis",
+ "icon": "i-lucide-file-text",
+ "link": "/client/medical-record"
+ }
+ ]
+ },
+ {
+ "heading": "Integrasi",
+ "items": [
+ {
+ "title": "BPJS",
+ "icon": "i-lucide-circuit-board",
+ "children": [
+ {
+ "title": "SEP",
+ "icon": "i-lucide-circuit-board",
+ "link": "/integration/bpjs/sep"
+ },
+ {
+ "title": "Peserta",
+ "icon": "i-lucide-circuit-board",
+ "link": "/integration/bpjs/member"
+ },
+ {
+ "title": "Surat Kontrol",
+ "icon": "i-lucide-circuit-board",
+ "link": "/integration/bpjs/control-letter"
+ }
+ ]
+ },
+ {
+ "title": "SATUSEHAT",
+ "icon": "i-lucide-database",
+ "link": "/integration/satusehat"
+ }
+ ]
+ },
+ {
+ "heading": "Source",
+ "items": [
+ {
+ "title": "Peralatan dan Perlengkapan",
+ "icon": "i-lucide-layout-dashboard",
+ "children": [
+ {
+ "title": "Obat",
+ "link": "/tools-equipment-src/medicine"
+ },
+ {
+ "title": "Peralatan",
+ "link": "/tools-equipment-src/tools"
+ },
+ {
+ "title": "Perlengkapan (BMHP)",
+ "link": "/tools-equipment-src/equipment"
+ },
+ {
+ "title": "Metode Obat",
+ "link": "/tools-equipment-src/medicine-method"
+ },
+ {
+ "title": "Jenis Obat",
+ "link": "/tools-equipment-src/medicine-type"
+ }
+ ]
+ },
+ {
+ "title": "Pengguna",
+ "icon": "i-lucide-user",
+ "children": [
+ {
+ "title": "Pegawai",
+ "link": "/human-src/employee"
+ },
+ {
+ "title": "PPDS",
+ "link": "/human-src/specialist-intern"
+ }
+ ]
+ },
+ {
+ "title": "Pemeriksaan Penunjang",
+ "icon": "i-lucide-layout-list",
+ "children": [
+ {
+ "title": "Checkup",
+ "link": "/mcu-src/mcu"
+ },
+ {
+ "title": "Prosedur",
+ "link": "/mcu-src/procedure"
+ },
+ {
+ "title": "Diagnosis",
+ "link": "/mcu-src/diagnose"
+ },
+ {
+ "title": "Medical Action",
+ "link": "/mcu-src/medical-action"
+ }
+ ]
+ },
+ {
+ "title": "Layanan",
+ "icon": "i-lucide-layout-list",
+ "children": [
+ {
+ "title": "Counter",
+ "link": "/service-src/counter"
+ },
+ {
+ "title": "Public Screen (Big Screen)",
+ "link": "/service-src/public-screen"
+ },
+ {
+ "title": "Kasur",
+ "link": "/service-src/bed"
+ },
+ {
+ "title": "Kamar",
+ "link": "/service-src/chamber"
+ },
+ {
+ "title": "Ruang",
+ "link": "/service-src/room"
+ },
+ {
+ "title": "Depo",
+ "link": "/service-src/warehouse"
+ },
+ {
+ "title": "Lantai",
+ "link": "/service-src/floor"
+ },
+ {
+ "title": "Gedung",
+ "link": "/service-src/building"
+ }
+ ]
+ },
+ {
+ "title": "Organisasi",
+ "icon": "i-lucide-network",
+ "children": [
+ {
+ "title": "Divisi",
+ "link": "/org-src/division"
+ },
+ {
+ "title": "Instalasi",
+ "link": "/org-src/installation"
+ },
+ {
+ "title": "Unit",
+ "link": "/org-src/unit"
+ },
+ {
+ "title": "Spesialis",
+ "link": "/org-src/specialist"
+ },
+ {
+ "title": "Sub Spesialis",
+ "link": "/org-src/subspecialist"
+ }
+ ]
+ },
+ {
+ "title": "Umum",
+ "icon": "i-lucide-airplay",
+ "children": [
+ {
+ "title": "Uom",
+ "link": "/common/uom"
+ }
+ ]
+ },
+ {
+ "title": "Keuangan",
+ "icon": "i-lucide-airplay",
+ "children": [
+ {
+ "title": "Item & Pricing",
+ "link": "/common/item"
+ }
+ ]
+ }
+ ]
+ }
+]
From bfbe72be94a6a20301ad88c50fc9fa6078bb5087 Mon Sep 17 00:00:00 2001
From: Andrian Roshandy
Date: Wed, 19 Nov 2025 03:36:24 +0700
Subject: [PATCH 27/35] feat/device-order: final
---
.../app/device-order-item/entry-form.vue | 73 ++++++
.../device-order-item/list-entry.config.ts | 35 ++-
.../app/device-order-item/list-entry.vue | 16 +-
.../app/device-order/confirmation-info.vue | 26 ++
.../app/device-order/entry-form.vue | 21 +-
.../app/device-order/list.config.ts | 50 ++--
app/components/content/device-order/entry.vue | 239 +++++++++++++++++-
app/components/content/device-order/list.vue | 201 ++++++---------
app/components/content/device-order/main.vue | 10 +-
app/components/content/encounter/process.vue | 4 +-
app/models/device-order-item.ts | 11 +-
app/models/device-order.ts | 7 +-
app/services/device-order.service.ts | 17 +-
13 files changed, 527 insertions(+), 183 deletions(-)
create mode 100644 app/components/app/device-order-item/entry-form.vue
create mode 100644 app/components/app/device-order/confirmation-info.vue
diff --git a/app/components/app/device-order-item/entry-form.vue b/app/components/app/device-order-item/entry-form.vue
new file mode 100644
index 00000000..3ae2d200
--- /dev/null
+++ b/app/components/app/device-order-item/entry-form.vue
@@ -0,0 +1,73 @@
+
+
+
+
+
+ Nama
+
+
+
+
+
+ Jumlah
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/components/app/device-order-item/list-entry.config.ts b/app/components/app/device-order-item/list-entry.config.ts
index f2f3ef86..d47c4368 100644
--- a/app/components/app/device-order-item/list-entry.config.ts
+++ b/app/components/app/device-order-item/list-entry.config.ts
@@ -1,36 +1,35 @@
import { defineAsyncComponent } from 'vue'
-import type { Config } from '~/components/pub/my-ui/data-table'
-
+import type { Config, RecComponent } from '~/components/pub/my-ui/data-table'
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-ud.vue'))
export const config: Config = {
- cols: [{}, {}, { width: 50 }],
+ cols: [{}, { width: 200 }, { width: 100 }],
headers: [[{ label: 'Nama' }, { label: 'Jumlah' }, { label: '' }]],
- keys: ['name', 'count', 'action'],
+ keys: ['device.name', 'quantity', 'action'],
delKeyNames: [
{ key: 'name', label: 'Nama' },
{ key: 'count', label: 'Jumlah' },
],
- skeletonSize: 10
+ skeletonSize: 10,
// funcParsed: {
// parent: (rec: unknown): unknown => {
// const recX = rec as SmallDetailDto
// return recX.parent?.name || '-'
// },
// },
- // funcComponent: {
- // action(rec: object, idx: any) {
- // const res: RecComponent = {
- // idx,
- // rec: rec as object,
- // component: action,
- // props: {
- // size: 'sm',
- // },
- // }
- // return res
- // },
- // }
+ components: {
+ action(rec, idx) {
+ const res: RecComponent = {
+ idx,
+ rec: rec as object,
+ component: action,
+ props: {
+ size: 'sm',
+ },
+ }
+ return res
+ },
+ }
}
diff --git a/app/components/app/device-order-item/list-entry.vue b/app/components/app/device-order-item/list-entry.vue
index 26f6691d..b6031228 100644
--- a/app/components/app/device-order-item/list-entry.vue
+++ b/app/components/app/device-order-item/list-entry.vue
@@ -1,13 +1,23 @@
-
+
-
- Tambah
+
+
+ Tambah Item
diff --git a/app/components/app/device-order/confirmation-info.vue b/app/components/app/device-order/confirmation-info.vue
new file mode 100644
index 00000000..6711091f
--- /dev/null
+++ b/app/components/app/device-order/confirmation-info.vue
@@ -0,0 +1,26 @@
+
+
+
+
+ Tgl. Order
+
+
+ {{ data?.createdAt?.substring(0, 10) }}
+
+
+
+ DPJP
+
+
+ {{ data?.doctor?.employee?.person?.name }}
+
+
+
+
\ No newline at end of file
diff --git a/app/components/app/device-order/entry-form.vue b/app/components/app/device-order/entry-form.vue
index bea2b6eb..4e66c441 100644
--- a/app/components/app/device-order/entry-form.vue
+++ b/app/components/app/device-order/entry-form.vue
@@ -1,6 +1,25 @@
- Test
+
+
+ Tanggal
+
+ {{ data?.createdAt?.substring(0, 10) }}
+
+
+
+ DPJP
+
+ {{ data?.doctor?.employee?.person?.name }}
+
+
+
diff --git a/app/components/app/device-order/list.config.ts b/app/components/app/device-order/list.config.ts
index 0e0d068d..04a6c9fc 100644
--- a/app/components/app/device-order/list.config.ts
+++ b/app/components/app/device-order/list.config.ts
@@ -1,10 +1,8 @@
-import type { Config } from '~/components/pub/my-ui/data-table'
+import type { Config, RecComponent } from '~/components/pub/my-ui/data-table'
import type { DeviceOrder } from '~/models/device-order'
-// import type {} from
-// import { defineAsyncComponent } from 'vue'
-
-// const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-ud.vue'))
+import type { DeviceOrderItem } from '~/models/device-order-item'
+const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dsd.vue'))
export const config: Config = {
cols: [{ width: 120 }, { }, { }, { }, { width: 50 }],
@@ -23,7 +21,21 @@ export const config: Config = {
htmls: {
items: (rec: unknown): unknown => {
const recX = rec as DeviceOrder
- return recX.items?.length || 0
+ if (recX.items?.length > 0) {
+ let output = ''
+ recX.items.forEach((item: DeviceOrderItem) => {
+ output += '' +
+ ''+
+ `${item.device?.name} ` +
+ ': ' +
+ `${item.quantity} ` +
+ ' '
+ })
+ output += '
'
+ return output
+ } else {
+ return '-'
+ }
},
},
parses: {
@@ -36,18 +48,18 @@ export const config: Config = {
// return recX.parent?.name || '-'
// },
},
- // funcComponent: {
- // action(rec: object, idx: any) {
- // const res: RecComponent = {
- // idx,
- // rec: rec as object,
- // component: action,
- // props: {
- // size: 'sm',
- // },
- // }
- // return res
- // },
- // }
+ components: {
+ action(rec, idx) {
+ const res: RecComponent = {
+ idx,
+ rec: rec as object,
+ component: action,
+ props: {
+ size: 'sm',
+ },
+ }
+ return res
+ },
+ }
}
diff --git a/app/components/content/device-order/entry.vue b/app/components/content/device-order/entry.vue
index 6d76d685..5d87d960 100644
--- a/app/components/content/device-order/entry.vue
+++ b/app/components/content/device-order/entry.vue
@@ -1,24 +1,177 @@
@@ -28,10 +181,74 @@ const headerPrep: HeaderPrep = {
class="mb-4 xl:mb-5"
/>
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ handleActionRemove(recId, getDeviceOrderItems, toast)"
+ @cancel=""
+ >
+
+
+ Nama
+
+
+ {{ recItem.device.name }}
+
+
+
+ Dosis
+
+
+ {{ recItem.quantity }}
+
+
+
+
diff --git a/app/components/content/device-order/list.vue b/app/components/content/device-order/list.vue
index 6c23cfc0..1ffa324d 100644
--- a/app/components/content/device-order/list.vue
+++ b/app/components/content/device-order/list.vue
@@ -1,72 +1,38 @@
@@ -175,42 +145,39 @@ function submit(data: DeviceOrder) {
:prep="headerPrep"
:ref-search-nav="headerPrep.refSearchNav"
@search="handleSearch"
- class="mb-4 xl:mb-5"
/>
+
-
+
handleActionSubmit(recId, getMyList, toast)"
+ >
+
+
+
+
+ handleActionRemove(recId, getMyList, toast)"
- @cancel=""
>
-
-
-
- ID:
- {{ record?.id }}
-
-
- Nama:
- {{ record.name }}
-
-
- Kode:
- {{ record.code }}
-
-
-
+
diff --git a/app/components/content/device-order/main.vue b/app/components/content/device-order/main.vue
index ae5a9ca8..ff8722de 100644
--- a/app/components/content/device-order/main.vue
+++ b/app/components/content/device-order/main.vue
@@ -3,10 +3,14 @@
import List from './list.vue'
import Entry from './entry.vue'
-const { mode } = useQueryMode()
+defineProps<{
+ encounter_id: number
+}>()
+
+const { mode } = useQueryCRUDMode()
-
-
+
+
diff --git a/app/components/content/encounter/process.vue b/app/components/content/encounter/process.vue
index c72f6835..7f62f5d1 100644
--- a/app/components/content/encounter/process.vue
+++ b/app/components/content/encounter/process.vue
@@ -64,9 +64,7 @@ const tabs: TabItem[] = [
{ value: 'consent', label: 'General Consent' },
{ value: 'patient-note', label: 'CPRJ' },
{ value: 'prescription', label: 'Order Obat', component: Prescription, props: { encounter_id: data.id } },
- { value: 'device-order', label: 'Order Alkes', component: DeviceOrder, props: { encounter: data } },
- { value: 'mcu-radiology', label: 'Order Radiologi' },
- { value: 'mcu-lab-pc', label: 'Order Lab PK' },
+ { value: 'device-order', label: 'Order Alkes', component: DeviceOrder, props: { encounter_id: data.id } },
{ value: 'mcu-radiology', label: 'Order Radiologi', component: Radiology, props: { encounter_id: data.id } },
{ value: 'mcu-lab-cp', label: 'Order Lab PK', component: CpLabOrder, props: { encounter_id: data.id } },
{ value: 'mcu-lab-micro', label: 'Order Lab Mikro' },
diff --git a/app/models/device-order-item.ts b/app/models/device-order-item.ts
index fa16638a..31b3ee47 100644
--- a/app/models/device-order-item.ts
+++ b/app/models/device-order-item.ts
@@ -1,16 +1,19 @@
import { type Base, genBase } from "./_base"
+import { genDevice, type Device } from "./device"
export interface DeviceOrderItem extends Base {
deviceOrder_id: number
- device_id: number
- count: number
+ device_code: string
+ device: Device
+ quantity: number
}
export function genDeviceOrderItem(): DeviceOrderItem {
return {
...genBase(),
deviceOrder_id: 0,
- device_id: 0,
- count: 0,
+ device_code: '',
+ device: genDevice(),
+ quantity: 0,
}
}
diff --git a/app/models/device-order.ts b/app/models/device-order.ts
index f2e88b0f..cbb682ad 100644
--- a/app/models/device-order.ts
+++ b/app/models/device-order.ts
@@ -1,9 +1,11 @@
import { type Base, genBase } from "./_base"
import type { DeviceOrderItem } from "./device-order-item"
+import { genDoctor, type Doctor } from "./doctor"
export interface DeviceOrder extends Base {
encounter_id: number
- doctor_id: number
+ doctor_code: number
+ doctor: Doctor
status_code?: string
items: DeviceOrderItem[]
}
@@ -12,7 +14,8 @@ export function genDeviceOrder(): DeviceOrder {
return {
...genBase(),
encounter_id: 0,
- doctor_id: 0,
+ doctor_code: 0,
+ doctor: genDoctor(),
items: []
}
}
diff --git a/app/services/device-order.service.ts b/app/services/device-order.service.ts
index b8d5372c..cf70420d 100644
--- a/app/services/device-order.service.ts
+++ b/app/services/device-order.service.ts
@@ -13,8 +13,8 @@ export function getList(params: any = null) {
return base.getList(path, params, name)
}
-export function getDetail(id: number | string) {
- return base.getDetail(path, id, name)
+export function getDetail(id: number | string, params?: any) {
+ return base.getDetail(path, id, name, params)
}
export function update(id: number | string, data: any) {
@@ -24,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 submit(id: number) {
+ try {
+ const resp = await xfetch(`${path}/${id}/submit`, 'PATCH')
+ const result: any = {}
+ result.success = resp.success
+ result.body = (resp.body as Record) || {}
+ return result
+ } catch (error) {
+ console.error(`Error putting ${name}:`, error)
+ throw new Error(`Failed to put ${name}`)
+ }
+}
\ No newline at end of file
From c3f1f997b3b0d7aefd2c5cddda8d1f8d87816fef Mon Sep 17 00:00:00 2001
From: hasyim_kai
Date: Wed, 19 Nov 2025 10:22:12 +0700
Subject: [PATCH 28/35] Fix: refactor upload API url
---
app/components/content/document-upload/add.vue | 3 +--
app/services/supporting-document.service.ts | 4 ++--
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/app/components/content/document-upload/add.vue b/app/components/content/document-upload/add.vue
index 7d42f4f6..23fd30e0 100644
--- a/app/components/content/document-upload/add.vue
+++ b/app/components/content/document-upload/add.vue
@@ -6,8 +6,7 @@ import { handleActionSave,} from '~/handlers/supporting-document.handler'
import { toast } from '~/components/pub/ui/toast'
import Confirmation from '~/components/pub/my-ui/confirmation/confirmation.vue'
import { DocumentUploadSchema } from '~/schemas/document-upload.schema'
-import { uploadAttachment } from '~/services/supporting-document.service'
-import { printFormData, toFormData } from '~/lib/utils'
+import { toFormData } from '~/lib/utils'
// #region Props & Emits
const props = defineProps<{
diff --git a/app/services/supporting-document.service.ts b/app/services/supporting-document.service.ts
index 46eaffa9..2d89d7f1 100644
--- a/app/services/supporting-document.service.ts
+++ b/app/services/supporting-document.service.ts
@@ -2,10 +2,10 @@
import * as base from './_crud-base'
// Constants
-import { encounterClassCodes, uploadCode, type UploadCodeKey } from '~/lib/constants'
+import { uploadCode, type UploadCodeKey } from '~/lib/constants'
const path = '/api/v1/encounter-document'
-const create_path = '/api/v1/upload'
+const create_path = '/api/v1/upload-file'
const name = 'encounter-document'
export function create(data: any) {
From f41a51d9d0e75c7ee3e13f82250c8c5df025996f Mon Sep 17 00:00:00 2001
From: Andrian Roshandy
Date: Wed, 19 Nov 2025 10:58:26 +0700
Subject: [PATCH 29/35] feat/prescription: cleaning
---
app/components/app/prescription/entry.vue | 6 ++
app/components/app/prescription/flat-list.vue | 2 -
.../app/prescription/list-with-sub.vue | 60 +++++++++----------
3 files changed, 35 insertions(+), 33 deletions(-)
diff --git a/app/components/app/prescription/entry.vue b/app/components/app/prescription/entry.vue
index af59a87d..28041eea 100644
--- a/app/components/app/prescription/entry.vue
+++ b/app/components/app/prescription/entry.vue
@@ -41,4 +41,10 @@ defineProps<{
+
diff --git a/app/components/app/prescription/flat-list.vue b/app/components/app/prescription/flat-list.vue
index cf563ef2..fe0bab9c 100644
--- a/app/components/app/prescription/flat-list.vue
+++ b/app/components/app/prescription/flat-list.vue
@@ -1,11 +1,9 @@
@@ -17,40 +15,40 @@
-
-
- Order #1
-
-
+
+
+ Order #1
+
+
2025-01-01
-
-
-
- Status
-
-
+
+
+
+ Status
+
+
Status
-
-
-
+
+
+
-
-
- DPJP
-
-
+
+
+ DPJP
+
+
Nama Dokter
-
-
-
- PPDS
-
-
+
+
+
+ PPDS
+
+
Nama PPDS
-
-
-
+
+
+
From baf6ab1fda61f59f966949a1886c2399ac9e7551 Mon Sep 17 00:00:00 2001
From: Munawwirul Jamal
Date: Wed, 19 Nov 2025 20:09:19 +0700
Subject: [PATCH 30/35] dev: hotfix, pubs + my-ui/confirmation/confirmation
noTrueSlot from record-confirmation + my-ui/confirmation/confirmation
additional message + my-ui/confirmation/record-confirmation supplies
noTrueSlot + my-ui/modal/modal text size + my-ui/doc-entry semicolon export
---
.../pub/my-ui/confirmation/confirmation.vue | 16 ++--
.../confirmation/record-confirmation.vue | 22 +++--
.../pub/my-ui/data/dropdown-action-dsd.vue | 95 +++++++++++++++++++
app/components/pub/my-ui/data/types.ts | 7 +-
app/components/pub/my-ui/doc-entry/block.vue | 2 +-
app/components/pub/my-ui/doc-entry/index.ts | 1 +
app/components/pub/my-ui/modal/dialog.vue | 6 +-
7 files changed, 124 insertions(+), 25 deletions(-)
create mode 100644 app/components/pub/my-ui/data/dropdown-action-dsd.vue
diff --git a/app/components/pub/my-ui/confirmation/confirmation.vue b/app/components/pub/my-ui/confirmation/confirmation.vue
index b5c328aa..928d7827 100644
--- a/app/components/pub/my-ui/confirmation/confirmation.vue
+++ b/app/components/pub/my-ui/confirmation/confirmation.vue
@@ -8,6 +8,8 @@ interface ConfirmationProps {
message?: string
confirmText?: string
cancelText?: string
+ noTrueSlot?: boolean
+ skipClosingMessage?: boolean
variant?: 'default' | 'destructive' | 'warning'
size?: 'sm' | 'md' | 'lg' | 'xl'
}
@@ -71,20 +73,22 @@ function handleCancel() {
-
-
+
+
-
- {{ message }}
-
+ {{ message }} {{ !noTrueSlot ? ' dengan informasi sebagai berikut:' : '.' }}
-
+
+
+ Lanjutkan Proses?
+
+
diff --git a/app/components/pub/my-ui/confirmation/record-confirmation.vue b/app/components/pub/my-ui/confirmation/record-confirmation.vue
index cff54b2b..87249635 100644
--- a/app/components/pub/my-ui/confirmation/record-confirmation.vue
+++ b/app/components/pub/my-ui/confirmation/record-confirmation.vue
@@ -46,31 +46,31 @@ const actionConfig = computed(() => {
const configs = {
delete: {
title: 'Hapus Data',
- message: 'Apakah Anda yakin ingin menghapus data ini? Tindakan ini tidak dapat dibatalkan.',
+ message: 'Akan dilakukan penghapusan data',
confirmText: 'Hapus',
variant: 'destructive' as const,
},
deactivate: {
title: 'Nonaktifkan Data',
- message: 'Apakah Anda yakin ingin menonaktifkan data ini?',
+ message: 'Akan dilakukan peng-nonaktifkan data',
confirmText: 'Nonaktifkan',
variant: 'warning' as const,
},
activate: {
title: 'Aktifkan Data',
- message: 'Apakah Anda yakin ingin mengaktifkan data ini?',
+ message: 'Akan dilakukan pengaktifkan data',
confirmText: 'Aktifkan',
variant: 'default' as const,
},
archive: {
title: 'Arsipkan Data',
- message: 'Apakah Anda yakin ingin mengarsipkan data ini?',
+ message: 'Akan dilakukan pengarsipan data',
confirmText: 'Arsipkan',
variant: 'warning' as const,
},
restore: {
title: 'Pulihkan Data',
- message: 'Apakah Anda yakin ingin memulihkan data ini?',
+ message: 'Akan dilakukan pemulihan data',
confirmText: 'Pulihkan',
variant: 'default' as const,
},
@@ -107,6 +107,8 @@ const finalCancelText = computed(() => {
function handleConfirm() {
if (props.record) {
emit('confirm', props.record, props.action)
+ } else {
+ emit('confirm', { id: 0 }, 'confirmed')
}
emit('update:open', false)
}
@@ -119,11 +121,13 @@ function handleCancel() {
-
+ >
diff --git a/app/components/pub/my-ui/data/dropdown-action-dsd.vue b/app/components/pub/my-ui/data/dropdown-action-dsd.vue
new file mode 100644
index 00000000..c2eca763
--- /dev/null
+++ b/app/components/pub/my-ui/data/dropdown-action-dsd.vue
@@ -0,0 +1,95 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/pub/my-ui/data/types.ts b/app/components/pub/my-ui/data/types.ts
index f27a5578..cf251cc8 100644
--- a/app/components/pub/my-ui/data/types.ts
+++ b/app/components/pub/my-ui/data/types.ts
@@ -42,12 +42,6 @@ export interface RefSearchNav {
onClear: () => void
}
-export interface RefExportNav {
- onExportPdf?: () => void
- onExportCsv?: () => void
- onExportExcel?: () => void
-}
-
// prepared header for relatively common usage
export interface HeaderPrep {
title?: string
@@ -79,6 +73,7 @@ export interface LinkItem {
}
export const ActionEvents = {
+ showConfirmSubmit: 'showConfirmSubmit',
showConfirmDelete: 'showConfirmDel',
showEdit: 'showEdit',
showDetail: 'showDetail',
diff --git a/app/components/pub/my-ui/doc-entry/block.vue b/app/components/pub/my-ui/doc-entry/block.vue
index bf76c327..b51ad72a 100644
--- a/app/components/pub/my-ui/doc-entry/block.vue
+++ b/app/components/pub/my-ui/doc-entry/block.vue
@@ -64,7 +64,7 @@ const settingClass = computed(() => {
}
cls += ' [&:not(.preview)_.height-default]:pt-2 [&:not(.preview)_.height-default]:2xl:!pt-1.5 [&:not(.preview)_.height-compact]:!pt-1 '
cls += '[&_textarea]:md:text-xs [&_textarea]:2xl:!text-sm '
- cls += '[&_label]:md:text-xs [&_label]:md:text-xs [&_label]:2xl:!text-sm'
+ cls += '[&_label]:md:text-xs [&_label]:2xl:!text-sm '
return cls
})
diff --git a/app/components/pub/my-ui/doc-entry/index.ts b/app/components/pub/my-ui/doc-entry/index.ts
index 8af74884..269f1b8d 100644
--- a/app/components/pub/my-ui/doc-entry/index.ts
+++ b/app/components/pub/my-ui/doc-entry/index.ts
@@ -1,4 +1,5 @@
export { default as Block } from './block.vue'
+export { default as Colon } from './colon.vue'
export { default as Cell } from './cell.vue'
export { default as Label } from './label.vue'
export { default as Field } from './field.vue'
diff --git a/app/components/pub/my-ui/modal/dialog.vue b/app/components/pub/my-ui/modal/dialog.vue
index 974013a2..d771924f 100644
--- a/app/components/pub/my-ui/modal/dialog.vue
+++ b/app/components/pub/my-ui/modal/dialog.vue
@@ -52,8 +52,8 @@ const isOpen = computed({
>
-
-
+
+
{{ props.title }}
@@ -61,7 +61,7 @@ const isOpen = computed({
{{ props.description }}
-
+
From cf4f5574d3cbe2d5af30aa55744c9c94e733b9de Mon Sep 17 00:00:00 2001
From: Abizrh
Date: Wed, 19 Nov 2025 23:46:21 +0700
Subject: [PATCH 31/35] =?UTF-8?q?=E2=9C=A8=20feat=20(generate-file):=20add?=
=?UTF-8?q?=20generate=20file=20schema?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../content/general-consent/form.vue | 32 +++++++++++++++----
app/handlers/general-consent.handler.ts | 24 ++++++++++++++
app/models/general-consent.ts | 3 +-
app/schemas/_generate-file.ts | 5 +++
app/schemas/general-consent.schema.ts | 5 +--
app/services/generate-file.service.ts | 15 +++++++++
6 files changed, 74 insertions(+), 10 deletions(-)
create mode 100644 app/handlers/general-consent.handler.ts
create mode 100644 app/schemas/_generate-file.ts
create mode 100644 app/services/generate-file.service.ts
diff --git a/app/components/content/general-consent/form.vue b/app/components/content/general-consent/form.vue
index 889e5799..d9b67fec 100644
--- a/app/components/content/general-consent/form.vue
+++ b/app/components/content/general-consent/form.vue
@@ -4,9 +4,10 @@ import Entry from '~/components/app/general-consent/entry.vue'
import Action from '~/components/pub/my-ui/nav-footer/ba-dr-su-pr.vue'
import ActionDialog from '~/components/pub/my-ui/nav-footer/ba-su.vue'
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
-import { FunctionSoapiSchema } from '~/schemas/soapi.schema'
+import { GeneralConsentSchema } from '~/schemas/general-consent.schema'
import { toast } from '~/components/pub/ui/toast'
-import { handleActionSave, handleActionEdit } from '~/handlers/soapi-early.handler'
+import { handleActionSave, handleActionEdit } from '~/handlers/general-consent.handler'
+import { create } from '~/services/generate-file.service'
const { backToList } = useQueryMode('mode')
const route = useRoute()
@@ -19,14 +20,15 @@ const fungsional = ref([])
const selectedProcedure = ref(null)
const selectedDiagnose = ref(null)
const selectedFungsional = ref(null)
-const schema = FunctionSoapiSchema
+const schema = GeneralConsentSchema
const payload = ref({
encounter_id: 0,
value: '',
})
const model = ref({
relatives: [],
- responsible: '',
+ responsibleName: '',
+ responsiblePhone: '',
informant: '',
witness1: '',
witness2: '',
@@ -81,16 +83,32 @@ async function actionHandler(type: string) {
}
const result = await entryGeneralConsent.value?.validate()
if (result?.valid) {
- console.log('data', result.data)
- handleActionSave(
+ if (result.data.relatives.length > 0) {
+ result.data.relatives = result.data.relatives.map((item: any) => {
+ return item.name
+ })
+ }
+
+ console.log('data', result)
+ const resp = await handleActionSave(
{
...payload.value,
value: JSON.stringify(result.data),
encounter_id: +route.params.id,
},
- {},
+ () => {},
+ () => {},
toast,
)
+ const data = resp.body?.data
+ if (data) {
+ const resp2 = await create({
+ entityType_code: 'encounter',
+ ref_id: +data?.id,
+ type_code: 'general-consent',
+ })
+ console.log('resp2', resp2.body?.data)
+ }
} else {
console.log('Ada error di form', result)
}
diff --git a/app/handlers/general-consent.handler.ts b/app/handlers/general-consent.handler.ts
new file mode 100644
index 00000000..2f949f3f
--- /dev/null
+++ b/app/handlers/general-consent.handler.ts
@@ -0,0 +1,24 @@
+// Handlers
+import { genCrudHandler } from '~/handlers/_handler'
+
+// Services
+import { create, update, remove } from '~/services/general-consent.service'
+
+export const {
+ recId,
+ recAction,
+ recItem,
+ isReadonly,
+ isProcessing,
+ isFormEntryDialogOpen,
+ isRecordConfirmationOpen,
+ onResetState,
+ handleActionSave,
+ handleActionEdit,
+ handleActionRemove,
+ handleCancelForm,
+} = genCrudHandler({
+ create,
+ update,
+ remove,
+})
diff --git a/app/models/general-consent.ts b/app/models/general-consent.ts
index 643230ef..fe3ac97a 100644
--- a/app/models/general-consent.ts
+++ b/app/models/general-consent.ts
@@ -6,7 +6,8 @@ export interface GeneralConsent {
export interface ValueCreateDto {
relatives: string[]
- responsible: string
+ responsibleName: string
+ responsiblePhone: string
informant: string
witness1: string
witness2: string
diff --git a/app/schemas/_generate-file.ts b/app/schemas/_generate-file.ts
new file mode 100644
index 00000000..0e0b05fc
--- /dev/null
+++ b/app/schemas/_generate-file.ts
@@ -0,0 +1,5 @@
+export interface GenerateFile {
+ entityType_code: string
+ ref_id: number
+ type_code: string
+}
diff --git a/app/schemas/general-consent.schema.ts b/app/schemas/general-consent.schema.ts
index 43014fa0..e06c7240 100644
--- a/app/schemas/general-consent.schema.ts
+++ b/app/schemas/general-consent.schema.ts
@@ -2,8 +2,9 @@ import { z } from 'zod'
import type { CreateDto } from '~/models/general-consent'
const GeneralConsentSchema = z.object({
- relatives: z.string().optional(),
- responsible_doctor: z.string().optional(),
+ relatives: z.array(z.object({ name: z.string(), phone: z.string() })),
+ responsibleName: z.string().optional(),
+ responsiblePhone: z.string().optional(),
informant: z.string().optional(),
witness1: z.string().optional(),
witness2: z.string().optional(),
diff --git a/app/services/generate-file.service.ts b/app/services/generate-file.service.ts
new file mode 100644
index 00000000..5849e3d0
--- /dev/null
+++ b/app/services/generate-file.service.ts
@@ -0,0 +1,15 @@
+import * as base from './_crud-base'
+
+const path = '/api/v1/generate-file'
+
+export function create(data: any) {
+ return base.create(path, data)
+}
+
+export function getList(params: any = null) {
+ return base.getList(path, params)
+}
+
+export function getDetail(id: number | string) {
+ return base.getDetail(path, id)
+}
From 0d821cbe3105684af7a0db5affd228defe66f75f Mon Sep 17 00:00:00 2001
From: Abizrh
Date: Thu, 20 Nov 2025 00:13:44 +0700
Subject: [PATCH 32/35] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20chore=20(general-con?=
=?UTF-8?q?sent):=20adjust=20general=20consent=20list=20and=20form=20compo?=
=?UTF-8?q?nent?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../app/general-consent/list.cfg.ts | 35 ++++++++++++++++---
.../content/general-consent/form.vue | 22 ++++++++++--
.../content/general-consent/list.vue | 33 ++++++++++-------
3 files changed, 71 insertions(+), 19 deletions(-)
diff --git a/app/components/app/general-consent/list.cfg.ts b/app/components/app/general-consent/list.cfg.ts
index 3e634d44..c2f57c54 100644
--- a/app/components/app/general-consent/list.cfg.ts
+++ b/app/components/app/general-consent/list.cfg.ts
@@ -18,12 +18,41 @@ export const config: Config = {
{ label: '' },
],
],
- keys: ['date', 'dstUnit.name', 'dstDoctor.name', 'responsible', 'problem', 'solution', 'action'],
+ keys: ['date', 'relatives', 'responsible', 'informant', 'witness1', 'witness2', 'action'],
delKeyNames: [
{ key: 'data', label: 'Tanggal' },
{ key: 'dstDoctor.name', label: 'Dokter' },
],
parses: {
+ date(rec) {
+ const recX = rec as GeneralConsent
+ return recX?.createdAt?.substring(0, 10) || '-'
+ },
+ relatives(rec) {
+ const recX = rec as GeneralConsent
+ const parsed = JSON.parse(recX?.value || '{}')
+ return parsed?.relatives?.join(', ') || '-'
+ },
+ responsible(rec) {
+ const recX = rec as GeneralConsent
+ const parsed = JSON.parse(recX?.value || '{}')
+ return parsed?.responsible || '-'
+ },
+ informant(rec) {
+ const recX = rec as GeneralConsent
+ const parsed = JSON.parse(recX?.value || '{}')
+ return parsed?.informant || '-'
+ },
+ witness1(rec) {
+ const recX = rec as GeneralConsent
+ const parsed = JSON.parse(recX?.value || '{}')
+ return parsed?.witness1 || '-'
+ },
+ witness2(rec) {
+ const recX = rec as GeneralConsent
+ const parsed = JSON.parse(recX?.value || '{}')
+ return parsed?.witness2 || '-'
+ },
action(rec, idx) {
const res: RecComponent = {
idx,
@@ -35,10 +64,6 @@ export const config: Config = {
}
return res
},
- date(rec) {
- const recX = rec as GeneralConsent
- return recX.date?.substring(0, 10) || '-'
- },
},
components: {
action(rec, idx) {
diff --git a/app/components/content/general-consent/form.vue b/app/components/content/general-consent/form.vue
index d9b67fec..8c15ceb0 100644
--- a/app/components/content/general-consent/form.vue
+++ b/app/components/content/general-consent/form.vue
@@ -8,6 +8,8 @@ import { GeneralConsentSchema } from '~/schemas/general-consent.schema'
import { toast } from '~/components/pub/ui/toast'
import { handleActionSave, handleActionEdit } from '~/handlers/general-consent.handler'
import { create } from '~/services/generate-file.service'
+// Services
+import { getDetail } from '~/services/general-consent.service'
const { backToList } = useQueryMode('mode')
const route = useRoute()
@@ -57,10 +59,26 @@ async function getProcedures() {
}
onMounted(() => {
- getProcedures()
- getDiagnoses()
+ const mode = route.query.mode
+ const recordId = route.query['record-id']
+
+ if (mode === 'entry' && recordId) {
+ loadEntryForEdit(+recordId)
+ }
})
+// TODO: mapping data detail when edit
+const loadEntryForEdit = async (id: number) => {
+ const result = await getDetail(id)
+
+ if (result?.success) {
+ const data = result.body?.data || {}
+
+ console.log('Mapping data:', data)
+ // Set state utk form
+ }
+}
+
function handleClick(type: string) {
if (type === 'prosedur') {
isOpenProcedure.value = true
diff --git a/app/components/content/general-consent/list.vue b/app/components/content/general-consent/list.vue
index 588ff849..caba7f7c 100644
--- a/app/components/content/general-consent/list.vue
+++ b/app/components/content/general-consent/list.vue
@@ -28,7 +28,7 @@ import {
handleActionEdit,
handleActionRemove,
handleCancelForm,
-} from '~/handlers/consultation.handler'
+} from '~/handlers/general-consent.handler'
// Services
import { getList, getDetail } from '~/services/general-consent.service'
@@ -42,8 +42,9 @@ interface Props {
}
const props = defineProps()
const emits = defineEmits(['add', 'edit'])
+const router = useRouter()
+const route = useRoute()
-const { recordId } = useQueryCRUDRecordId()
const { goToEntry, backToList } = useQueryCRUDMode('mode')
let units = ref<{ value: string; label: string }[]>([])
@@ -93,6 +94,17 @@ const headerPrep: HeaderPrep = {
},
}
+const goEdit = (id: string) => {
+ router.replace({
+ path: route.path,
+ query: {
+ ...route.query,
+ mode: 'entry',
+ 'record-id': id,
+ },
+ })
+}
+
const today = new Date()
provide('rec_id', recId)
@@ -110,16 +122,13 @@ const getMyDetail = async (id: number | string) => {
}
// Watch for row actions when recId or recAction changes
-watch([recId, recAction], () => {
- switch (recAction.value) {
- case ActionEvents.showDetail:
- getMyDetail(recId.value)
- title.value = 'Detail Konsultasi'
- isReadonly.value = true
- break
- case ActionEvents.showConfirmDelete:
- isRecordConfirmationOpen.value = true
- break
+watch(recId, () => {
+ console.log('recId', recId.value)
+ if (recAction.value === ActionEvents.showEdit) {
+ goEdit(recId.value)
+ return
+ } else {
+ isRecordConfirmationOpen.value = true
}
})
From f1307980ff5f83fab99418fcedf8937b11bdaa42 Mon Sep 17 00:00:00 2001
From: Abizrh
Date: Thu, 20 Nov 2025 00:35:25 +0700
Subject: [PATCH 33/35] =?UTF-8?q?=F0=9F=90=9B=20fix=20(general-consent):?=
=?UTF-8?q?=20fix=20mapping=20data=20from=20api?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/components/content/general-consent/form.vue | 15 +++++++++++----
app/components/content/general-consent/list.vue | 1 -
app/composables/useQueryCRUD.ts | 12 +++++++++++-
3 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/app/components/content/general-consent/form.vue b/app/components/content/general-consent/form.vue
index 8c15ceb0..e26dbac1 100644
--- a/app/components/content/general-consent/form.vue
+++ b/app/components/content/general-consent/form.vue
@@ -10,7 +10,8 @@ import { handleActionSave, handleActionEdit } from '~/handlers/general-consent.h
import { create } from '~/services/generate-file.service'
// Services
import { getDetail } from '~/services/general-consent.service'
-const { backToList } = useQueryMode('mode')
+const { backToList } = useQueryCRUDMode('mode')
+const { recordId } = useQueryCRUDRecordId('record-id')
const route = useRoute()
const isOpenProcedure = ref(false)
@@ -74,8 +75,15 @@ const loadEntryForEdit = async (id: number) => {
if (result?.success) {
const data = result.body?.data || {}
- console.log('Mapping data:', data)
- // Set state utk form
+ const value = JSON.parse(data.value || '{}')
+ console.log('Mapping data:', value)
+ model.value.witness1 = value?.witness1 || ''
+ model.value.witness2 = value?.witness2 || ''
+ model.value.informant = value?.informant || ''
+ model.value.responsibleName = value?.responsible || ''
+ model.value.responsiblePhone = value?.responsiblePhone || ''
+ model.value.relatives = value?.relatives || []
+ console.log('model', model.value)
}
}
@@ -95,7 +103,6 @@ async function actionHandler(type: string) {
return
}
if (type === 'print') {
- console.log('print')
isOpenDiagnose.value = true
return
}
diff --git a/app/components/content/general-consent/list.vue b/app/components/content/general-consent/list.vue
index caba7f7c..4cf269ee 100644
--- a/app/components/content/general-consent/list.vue
+++ b/app/components/content/general-consent/list.vue
@@ -89,7 +89,6 @@ const headerPrep: HeaderPrep = {
icon: 'i-lucide-plus',
onClick: () => {
goToEntry()
- emits('add')
},
},
}
diff --git a/app/composables/useQueryCRUD.ts b/app/composables/useQueryCRUD.ts
index a48e9a2b..f81649bd 100644
--- a/app/composables/useQueryCRUD.ts
+++ b/app/composables/useQueryCRUD.ts
@@ -19,7 +19,17 @@ export function useQueryCRUDMode(key: string = 'mode') {
})
const goToEntry = () => (mode.value = 'entry')
- const backToList = () =>(mode.value = 'list')
+ const backToList = () => {
+ router.push({
+ path: route.path,
+ query: {
+ ...route.query,
+ mode: 'list',
+ // HAPUS record-id
+ 'record-id': undefined,
+ },
+ })
+ }
return { mode, goToEntry, backToList }
}
From b379a9bc947cc9960c74fb745e38edc6701fe8ab Mon Sep 17 00:00:00 2001
From: Abizrh
Date: Thu, 20 Nov 2025 13:04:27 +0700
Subject: [PATCH 34/35] =?UTF-8?q?=E2=9C=A8=20feat=20(general-consent):=20d?=
=?UTF-8?q?isplay=20file=20url=20in=20diagnose=20dialog?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/components/content/general-consent/form.vue | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/app/components/content/general-consent/form.vue b/app/components/content/general-consent/form.vue
index e26dbac1..bfc21472 100644
--- a/app/components/content/general-consent/form.vue
+++ b/app/components/content/general-consent/form.vue
@@ -37,6 +37,7 @@ const model = ref({
witness2: '',
})
+const fileUrl = ref('')
const isLoading = reactive({
isTableLoading: false,
})
@@ -76,7 +77,6 @@ const loadEntryForEdit = async (id: number) => {
const data = result.body?.data || {}
const value = JSON.parse(data.value || '{}')
- console.log('Mapping data:', value)
model.value.witness1 = value?.witness1 || ''
model.value.witness2 = value?.witness2 || ''
model.value.informant = value?.informant || ''
@@ -103,6 +103,9 @@ async function actionHandler(type: string) {
return
}
if (type === 'print') {
+ const data = await getDetail(recordId.value)
+ const detail = data.body?.data
+ fileUrl.value = detail?.fileUrl
isOpenDiagnose.value = true
return
}
@@ -173,8 +176,9 @@ provide('icdPreview', icdPreview)
size="xl"
prevent-outside
>
-
+
From 1f3ca6f19bc8befa098120292fe241986ce81cef Mon Sep 17 00:00:00 2001
From: Abizrh
Date: Thu, 20 Nov 2025 13:43:19 +0700
Subject: [PATCH 35/35] =?UTF-8?q?=F0=9F=90=9B=20fix=20(general-consent):?=
=?UTF-8?q?=20fix=20type=20error=20when=20create=20encounter?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/components/content/general-consent/form.vue | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/components/content/general-consent/form.vue b/app/components/content/general-consent/form.vue
index bfc21472..738adca1 100644
--- a/app/components/content/general-consent/form.vue
+++ b/app/components/content/general-consent/form.vue
@@ -132,10 +132,11 @@ async function actionHandler(type: string) {
if (data) {
const resp2 = await create({
entityType_code: 'encounter',
- ref_id: +data?.id,
+ ref_id: data?.id,
type_code: 'general-consent',
})
console.log('resp2', resp2.body?.data)
+ backToList()
}
} else {
console.log('Ada error di form', result)