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 @@
-
+
-
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 7580c576..04a6c9fc 100644
--- a/app/components/app/device-order/list.config.ts
+++ b/app/components/app/device-order/list.config.ts
@@ -1,13 +1,18 @@
-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 { defineAsyncComponent } from 'vue'
+import type { DeviceOrderItem } from '~/models/device-order-item'
-const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-ud.vue'))
+const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dsd.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' },
@@ -16,27 +21,45 @@ 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: {
+ 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 || '-'
+ // },
+ },
+ components: {
+ action(rec, idx) {
+ const res: RecComponent = {
+ idx,
+ rec: rec as object,
+ component: action,
+ props: {
+ size: 'sm',
+ },
+ }
+ return res
},
}
- // 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
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/app/division-position/entry-form.vue b/app/components/app/division-position/entry-form.vue
index 2525b49b..b25c9d0c 100644
--- a/app/components/app/division-position/entry-form.vue
+++ b/app/components/app/division-position/entry-form.vue
@@ -40,7 +40,7 @@ const { defineField, errors, meta } = useForm({
const [code, codeAttrs] = defineField('code')
const [name, nameAttrs] = defineField('name')
-const [division, divisionAttrs] = defineField('division_id')
+const [division, divisionAttrs] = defineField('division_code')
const [employee, employeeAttrs] = defineField('employee_id')
const [headStatus, headStatusAttrs] = defineField('headStatus')
@@ -62,8 +62,8 @@ const headStatusStr = computed({
if (props.values) {
if (props.values.code !== undefined) code.value = props.values.code
if (props.values.name !== undefined) name.value = props.values.name
- if (props.values.division_id !== undefined)
- division.value = props.values.division_id ? Number(props.values.division_id) : null
+ if (props.values.division_code !== undefined)
+ division.value = props.values.division_code ? String(props.values.division_code) : null
if (props.values.employee_id !== undefined)
employee.value = props.values.employee_id ? Number(props.values.employee_id) : null
if (props.values.headStatus !== undefined) headStatus.value = !!props.values.headStatus
@@ -72,7 +72,7 @@ if (props.values) {
const resetForm = () => {
code.value = ''
name.value = ''
- division.value = null
+ division.value = ''
employee.value = null
headStatus.value = false
}
@@ -83,7 +83,7 @@ function onSubmitForm() {
...genBase(),
name: name.value || '',
code: code.value || '',
- division_id: division.value || null,
+ division_code: division.value || '',
employee_id: employee.value || null,
headStatus: headStatus.value !== undefined ? headStatus.value : undefined,
}
@@ -130,7 +130,7 @@ function onCancelForm() {
-
+
- divisionId: number
+ divisionId: string
employees: any[]
values: any
isLoading?: boolean
diff --git a/app/components/app/division/entry-form.vue b/app/components/app/division/entry-form.vue
index 7702fdc6..19ca8196 100644
--- a/app/components/app/division/entry-form.vue
+++ b/app/components/app/division/entry-form.vue
@@ -36,25 +36,25 @@ const { defineField, errors, meta } = useForm({
initialValues: {
code: '',
name: '',
- parent_id: null,
+ parent_code: null,
} as Partial,
})
const [code, codeAttrs] = defineField('code')
const [name, nameAttrs] = defineField('name')
-const [parent, parentAttrs] = defineField('parent_id')
+const [parent, parentAttrs] = defineField('parent_code')
// Fill fields from props.values if provided
if (props.values) {
if (props.values.code !== undefined) code.value = props.values.code
if (props.values.name !== undefined) name.value = props.values.name
- if (props.values.parent_id !== undefined) parent.value = String(props.values.parent_id)
+ if (props.values.parent_code !== undefined) parent.value = String(props.values.parent_code)
}
const resetForm = () => {
code.value = ''
name.value = ''
- parent.value = null
+ parent.value = ''
}
// Form submission handler
@@ -63,7 +63,7 @@ function onSubmitForm() {
...genBase(),
name: name.value || '',
code: code.value || '',
- parent_id: parent.value || null,
+ parent_code: parent.value || '',
}
emit('submit', formData, resetForm)
}
@@ -108,7 +108,7 @@ function onCancelForm() {
|
-
+
+import type { FormErrors } from '~/types/error'
+import Combobox from '~/components/pub/my-ui/combobox/combobox.vue'
+import { cn, mapToComboboxOptList } from '~/lib/utils'
+import { docTypeCode, supportingDocOpt, type docTypeCodeKey } from '~/lib/constants'
+import { getValueLabelList as getDoctorLabelList } from '~/services/doctor.service'
+import { getValueLabelList as getUnitLabelList } from '~/services/unit.service'
+
+import * as DE from '~/components/pub/my-ui/doc-entry'
+import type { Item } from '~/components/pub/my-ui/combobox'
+
+const props = defineProps<{
+ fieldName?: string
+ label?: string
+ placeholder?: string
+ errors?: FormErrors
+ class?: string
+ selectClass?: string
+ fieldGroupClass?: string
+ labelClass?: string
+ isRequired?: boolean
+}>()
+
+const {
+ fieldName = 'job',
+ label = 'Pekerjaan',
+ placeholder = 'Pilih pekerjaan',
+ errors,
+ class: containerClass,
+ fieldGroupClass,
+ labelClass,
+} = props
+
+
+
+
+
+
+ {{ 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/app/general-consent/entry.vue b/app/components/app/general-consent/entry.vue
new file mode 100644
index 00000000..75e30cec
--- /dev/null
+++ b/app/components/app/general-consent/entry.vue
@@ -0,0 +1,214 @@
+
+
+
+
+
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..c2f57c54
--- /dev/null
+++ b/app/components/app/general-consent/list.cfg.ts
@@ -0,0 +1,82 @@
+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', '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,
+ 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
+ },
+ } 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/app/installation-position/entry-form.vue b/app/components/app/installation-position/entry-form.vue
index 4f7885a1..1bf65323 100644
--- a/app/components/app/installation-position/entry-form.vue
+++ b/app/components/app/installation-position/entry-form.vue
@@ -40,7 +40,7 @@ const { defineField, errors, meta } = useForm({
const [code, codeAttrs] = defineField('code')
const [name, nameAttrs] = defineField('name')
-const [installation, installationAttrs] = defineField('installation_id')
+const [installation, installationAttrs] = defineField('installation_code')
const [employee, employeeAttrs] = defineField('employee_id')
const [headStatus, headStatusAttrs] = defineField('headStatus')
@@ -62,8 +62,8 @@ const headStatusStr = computed({
if (props.values) {
if (props.values.code !== undefined) code.value = props.values.code
if (props.values.name !== undefined) name.value = props.values.name
- if (props.values.installation_id !== undefined)
- installation.value = props.values.installation_id ? Number(props.values.installation_id) : null
+ if (props.values.installation_code !== undefined)
+ installation.value = props.values.installation_code ? String(props.values.installation_code) : null
if (props.values.employee_id !== undefined)
employee.value = props.values.employee_id ? Number(props.values.employee_id) : null
if (props.values.headStatus !== undefined) headStatus.value = !!props.values.headStatus
@@ -83,7 +83,7 @@ function onSubmitForm() {
...genBase(),
name: name.value || '',
code: code.value || '',
- installation_id: installation.value || null,
+ installation_code: String(installation.value) || '',
employee_id: employee.value || null,
headStatus: headStatus.value !== undefined ? headStatus.value : undefined,
}
@@ -130,7 +130,7 @@ function onCancelForm() {
|
-
+
+// Components
+import Block from '~/components/pub/my-ui/doc-entry/block.vue'
+import Cell from '~/components/pub/my-ui/doc-entry/cell.vue'
+import Field from '~/components/pub/my-ui/doc-entry/field.vue'
+import Label from '~/components/pub/my-ui/doc-entry/label.vue'
+import Button from '~/components/pub/ui/button/Button.vue'
+
+// Types
+import type { BaseFormData } from '~/schemas/base.schema'
+
+// Helpers
+import type z from 'zod'
+import { useForm } from 'vee-validate'
+import { toTypedSchema } from '@vee-validate/zod'
+
+interface Props {
+ schema?: z.ZodSchema
+ values?: any
+ isLoading?: boolean
+ isReadonly?: boolean
+}
+
+const props = defineProps()
+const isLoading = props.isLoading !== undefined ? props.isLoading : false
+const isReadonly = props.isReadonly !== undefined ? props.isReadonly : false
+const emit = defineEmits<{
+ submit: [values: BaseFormData, resetForm: () => void]
+ cancel: [resetForm: () => void]
+}>()
+
+const { defineField, errors, meta } = useForm({
+ validationSchema: props.schema ? toTypedSchema(props.schema) : undefined,
+ initialValues: {
+ code: '',
+ name: '',
+ },
+})
+
+const [code, codeAttrs] = defineField('code')
+const [name, nameAttrs] = defineField('name')
+
+if (props.values) {
+ if (props.values.code !== undefined) code.value = props.values.code
+ if (props.values.name !== undefined) name.value = props.values.name
+}
+
+const resetForm = () => {
+ code.value = ''
+ name.value = ''
+}
+
+function onSubmitForm() {
+ const formData = {
+ name: name.value || '',
+ code: code.value || '',
+ }
+ emit('submit', formData, resetForm)
+}
+
+function onCancelForm() {
+ emit('cancel', resetForm)
+}
+
+
+
+
+
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() {
/>
|
+
+
+
+
+
+ |
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/app/prescription-item/list-entry.cfg.ts b/app/components/app/prescription-item/list-entry.cfg.ts
index 070dd65f..cfc6bdbd 100644
--- a/app/components/app/prescription-item/list-entry.cfg.ts
+++ b/app/components/app/prescription-item/list-entry.cfg.ts
@@ -11,16 +11,17 @@ export const config: Config = {
headers: [
[
{ label: 'Nama' },
+ { label: 'Cara Buat' },
{ label: 'Bentuk' },
{ label: 'Freq' },
{ label: 'Dosis' },
- { label: 'Interval' },
+ // { label: 'Interval' },
{ label: 'Total' },
{ label: '' },
],
],
- keys: ['name', 'uom_code', 'frequency', 'multiplier', 'interval', 'total', 'action'],
+ keys: ['medicine.name', 'isMix', 'medicine.medicineForm.name', 'frequency', 'dose', 'quantity', 'action'], //
delKeyNames: [
{ key: 'code', label: 'Kode' },
@@ -28,17 +29,8 @@ export const config: Config = {
],
parses: {
- cateogry: (rec: unknown): unknown => {
- return (rec as SmallDetailDto).medicineCategory?.name || '-'
- },
- group: (rec: unknown): unknown => {
- return (rec as SmallDetailDto).medicineGroup?.name || '-'
- },
- method: (rec: unknown): unknown => {
- return (rec as SmallDetailDto).medicineMethod?.name || '-'
- },
- unit: (rec: unknown): unknown => {
- return (rec as SmallDetailDto).medicineUnit?.name || '-'
+ isMix: (rec: unknown): unknown => {
+ return (rec as SmallDetailDto).isMix ? 'Racikan' : 'Non Racikan'
},
},
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-item/mix-entry.vue b/app/components/app/prescription-item/mix-entry.vue
index d9b4881e..05960307 100644
--- a/app/components/app/prescription-item/mix-entry.vue
+++ b/app/components/app/prescription-item/mix-entry.vue
@@ -1,29 +1,36 @@
-
-
- Nama
-
+
+
+ Nama
+
+
+
- Frequensi
-
+ Frequensi
+
- Dosis
-
+ Dosis
+
- Sediaan
-
+ Sediaan
+
- Total
-
+ Total
+
-
- Cara Pakai
-
+
+ Cara Pakai
+
Daftar Obat
@@ -77,20 +94,29 @@ function addItem() {
Nama
Dosis
- Satuan
- ..
+
+
-
+
-
+
-
+
+
+
+
+
@@ -102,7 +128,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..78ee9ada 100644
--- a/app/components/app/prescription-item/non-mix-entry.vue
+++ b/app/components/app/prescription-item/non-mix-entry.vue
@@ -2,40 +2,45 @@
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 } 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--'
+})
+
type ClickType = 'close' | 'save'
type Item = {
value: string
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],
+ 'update:searchText': [value: string]
}>()
+watch(medicines, (data) => {
+ medicineItems.value = CB.objectsToItems(data, 'code', 'name')
+})
+
function navClick(type: ClickType) {
if (type === 'close') {
emit('close')
@@ -43,13 +48,23 @@ function navClick(type: ClickType) {
emit('save', props.data)
}
}
+
+function searchMedicineText(value: string) {
+ emit('update:searchText', value)
+}
-
-
- Nama
-
+
+
+ Nama
+
+
+
Frequensi
@@ -59,11 +74,7 @@ function navClick(type: ClickType) {
Dosis
-
- Sediaan
-
-
-
+
Total
-
+
-
+
+ Sediaan
+
+
+
Cara Pakai
-
+
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/entry.vue b/app/components/app/prescription/entry.vue
index ef8756e8..28041eea 100644
--- a/app/components/app/prescription/entry.vue
+++ b/app/components/app/prescription/entry.vue
@@ -1,17 +1,25 @@
+
+
-
+
+
diff --git a/app/components/app/prescription/flat-list.vue b/app/components/app/prescription/flat-list.vue
new file mode 100644
index 00000000..fe0bab9c
--- /dev/null
+++ b/app/components/app/prescription/flat-list.vue
@@ -0,0 +1,86 @@
+
+
+
+
+ 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 }}
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/prescription/list.vue b/app/components/app/prescription/grouped-list.vue
similarity index 95%
rename from app/components/app/prescription/list.vue
rename to app/components/app/prescription/grouped-list.vue
index ae5126ca..07d6fcaa 100644
--- a/app/components/app/prescription/list.vue
+++ b/app/components/app/prescription/grouped-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[]
@@ -66,7 +65,7 @@ function navClick(type: 'cancel' | 'edit' | 'submit', data: Prescription): void
/>
-
+
diff --git a/app/components/app/prescription/list-with-sub.vue b/app/components/app/prescription/list-with-sub.vue
index 14bc1785..4d1a2cdf 100644
--- a/app/components/app/prescription/list-with-sub.vue
+++ b/app/components/app/prescription/list-with-sub.vue
@@ -1,7 +1,5 @@
@@ -17,40 +15,40 @@
-
-
- Order #1
-
-
+
+
+ Order #1
+
+
2025-01-01
-
-
-
- Status
-
-
+
+
+
+ Status
+
+
Status
-
-
-
+
+
+
-
-
- DPJP
-
-
+
+
+ DPJP
+
+
Nama Dokter
-
-
-
- PPDS
-
-
+
+
+
+ PPDS
+
+
Nama PPDS
-
-
-
+
+
+
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-arrangement.vue b/app/components/app/resume/_common/select-arrangement.vue
new file mode 100644
index 00000000..7e236ff0
--- /dev/null
+++ b/app/components/app/resume/_common/select-arrangement.vue
@@ -0,0 +1,70 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
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-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-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/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/_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
new file mode 100644
index 00000000..d5fa3370
--- /dev/null
+++ b/app/components/app/resume/add.vue
@@ -0,0 +1,482 @@
+
+
+
+
+
diff --git a/app/components/app/resume/history-list/action-history-dialog.vue b/app/components/app/resume/history-list/action-history-dialog.vue
new file mode 100644
index 00000000..5602016e
--- /dev/null
+++ b/app/components/app/resume/history-list/action-history-dialog.vue
@@ -0,0 +1,66 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/components/app/resume/history-list/action-list.cfg.ts b/app/components/app/resume/history-list/action-list.cfg.ts
new file mode 100644
index 00000000..2dad3e6a
--- /dev/null
+++ b/app/components/app/resume/history-list/action-list.cfg.ts
@@ -0,0 +1,94 @@
+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-dvvp.vue'))
+
+export const config: Config = {
+ cols: [{width: 140}, {}, {}, {width: 140}, {width: 10},],
+
+ headers: [
+ [
+ { label: 'Tanggal/Jam' },
+ { label: 'Dokter' },
+ { label: 'Tempat Layanan' },
+ { label: 'Jenis' },
+ { label: 'Jenis Pemeriksaan' },
+ { label: 'Tanggal/Jam' },
+ ],
+ ],
+
+ keys: ['birth_date', 'person.name', 'person.name', 'person.name', 'person.name', 'birth_date',],
+
+ 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/history-list/consultation-history-dialog.vue b/app/components/app/resume/history-list/consultation-history-dialog.vue
new file mode 100644
index 00000000..ad1e777e
--- /dev/null
+++ b/app/components/app/resume/history-list/consultation-history-dialog.vue
@@ -0,0 +1,66 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/components/app/resume/history-list/consultation-list.cfg.ts b/app/components/app/resume/history-list/consultation-list.cfg.ts
new file mode 100644
index 00000000..196c208c
--- /dev/null
+++ b/app/components/app/resume/history-list/consultation-list.cfg.ts
@@ -0,0 +1,51 @@
+import type { Config } from '~/components/pub/my-ui/data-table'
+import type { Patient } from '~/models/patient'
+import { defineAsyncComponent } from 'vue'
+
+const lampiranBtn = defineAsyncComponent(() => import('../_common/print-btn.vue'))
+
+export const config: Config = {
+ cols: [{}, {}, {}, {}, {},],
+
+ headers: [
+ [
+ { label: 'Tanggal/Jam' },
+ { label: 'Dokter' },
+ { label: 'Tempat Layanan' },
+ { label: 'KSM' },
+ { label: 'Tanggal/Jam' },
+ { label: 'Tujuan' },
+ { label: 'Dokter' },
+ { label: 'Berkas' },
+ ],
+ ],
+
+ keys: ['birth_date', 'person.name', 'person.name', 'person.name', 'person.name', 'birth_date','person.name', 'action', ],
+
+ parses: {
+ 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
+ },
+ },
+
+ components: {
+ action(rec, idx) {
+ return {
+ idx,
+ rec: rec as object,
+ component: lampiranBtn,
+ }
+ },
+ },
+
+ htmls: {
+
+ },
+}
diff --git a/app/components/app/resume/history-list/farmacy-history-dialog.vue b/app/components/app/resume/history-list/farmacy-history-dialog.vue
new file mode 100644
index 00000000..53bf3875
--- /dev/null
+++ b/app/components/app/resume/history-list/farmacy-history-dialog.vue
@@ -0,0 +1,66 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/components/app/resume/history-list/farmacy-list.cfg.ts b/app/components/app/resume/history-list/farmacy-list.cfg.ts
new file mode 100644
index 00000000..75ea1e80
--- /dev/null
+++ b/app/components/app/resume/history-list/farmacy-list.cfg.ts
@@ -0,0 +1,39 @@
+import type { Config } from '~/components/pub/my-ui/data-table'
+import type { Patient } from '~/models/patient'
+
+export const config: Config = {
+ cols: [{}, {}, {}, {}, {},],
+
+ headers: [
+ [
+ { label: 'Tanggal Order' },
+ { label: 'No Resep' },
+ { label: 'Tempat Layanan' },
+ { label: 'Nama Obat' },
+ { label: 'Tanggal Disetujui' },
+ ],
+ ],
+
+ keys: ['birth_date', 'person.name', 'person.name', 'person.name', 'birth_date',],
+
+ parses: {
+ 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
+ },
+ },
+
+ components: {
+
+ },
+
+ htmls: {
+
+ },
+}
diff --git a/app/components/app/resume/history-list/national-program-history-dialog.vue b/app/components/app/resume/history-list/national-program-history-dialog.vue
new file mode 100644
index 00000000..cc702227
--- /dev/null
+++ b/app/components/app/resume/history-list/national-program-history-dialog.vue
@@ -0,0 +1,65 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/components/app/resume/history-list/national-program-list.cfg.ts b/app/components/app/resume/history-list/national-program-list.cfg.ts
new file mode 100644
index 00000000..fe6d3ea0
--- /dev/null
+++ b/app/components/app/resume/history-list/national-program-list.cfg.ts
@@ -0,0 +1,30 @@
+import type { Config } from '~/components/pub/my-ui/data-table'
+import type { Patient } from '~/models/patient'
+
+export const config: Config = {
+ cols: [{}, {}, {}, {}, {},],
+
+ headers: [
+ [
+ { label: 'Nomor' },
+ { label: 'Layanan Program Nasional' },
+ { label: 'Status' },
+ ],
+ ],
+
+ keys: ['person.name', 'person.name', 'person.name',],
+
+ parses: {
+ // birth_date: (rec: unknown): unknown => {
+
+ // },
+ },
+
+ components: {
+
+ },
+
+ htmls: {
+
+ },
+}
diff --git a/app/components/app/resume/history-list/supporting-history-dialog.vue b/app/components/app/resume/history-list/supporting-history-dialog.vue
new file mode 100644
index 00000000..32fb4508
--- /dev/null
+++ b/app/components/app/resume/history-list/supporting-history-dialog.vue
@@ -0,0 +1,66 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/components/app/resume/history-list/supporting-list.cfg.ts b/app/components/app/resume/history-list/supporting-list.cfg.ts
new file mode 100644
index 00000000..f005042d
--- /dev/null
+++ b/app/components/app/resume/history-list/supporting-list.cfg.ts
@@ -0,0 +1,39 @@
+import type { Config } from '~/components/pub/my-ui/data-table'
+import type { Patient } from '~/models/patient'
+
+export const config: Config = {
+ cols: [{}, {}, {}, {}, {},],
+
+ headers: [
+ [
+ { label: 'Tanggal Order' },
+ { label: 'No Lab' },
+ { label: 'Nama Pemeriksaan' },
+ { label: 'Tanggal Pemeriksaan' },
+ ],
+ ],
+
+ keys: ['birth_date', 'person.name', 'person.name', 'birth_date',],
+
+ parses: {
+ 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
+ },
+ },
+
+ components: {
+ },
+
+ htmls: {
+ // patient_address(_rec) {
+ // return '-'
+ // },
+ },
+}
diff --git a/app/components/app/resume/list.cfg.ts b/app/components/app/resume/list.cfg.ts
new file mode 100644
index 00000000..b756b1ee
--- /dev/null
+++ b/app/components/app/resume/list.cfg.ts
@@ -0,0 +1,101 @@
+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-dvvp.vue'))
+const statusBadge = defineAsyncComponent(() => import('./_common/verify-badge.vue'))
+
+export const config: Config = {
+ cols: [{width: 140}, {}, {}, {width: 140}, {width: 10},],
+
+ headers: [
+ [
+ { label: 'Tgl Simpan' },
+ { label: 'DPJP' },
+ { label: 'KSM' },
+ { label: 'Status' },
+ { label: 'Action' },
+ ],
+ ],
+
+ keys: ['birth_date', 'number', 'person.name', '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/resume/list.vue b/app/components/app/resume/list.vue
new file mode 100644
index 00000000..0d62cc6c
--- /dev/null
+++ b/app/components/app/resume/list.vue
@@ -0,0 +1,31 @@
+
+
+
+
+
\ 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..ca4fb554
--- /dev/null
+++ b/app/components/app/resume/verify-dialog.vue
@@ -0,0 +1,98 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/components/app/specialist-position/entry-detail.vue b/app/components/app/specialist-position/entry-detail.vue
index f21ff65f..099927f6 100644
--- a/app/components/app/specialist-position/entry-detail.vue
+++ b/app/components/app/specialist-position/entry-detail.vue
@@ -18,7 +18,7 @@ import { genSpecialistPosition } from '~/models/specialist-position'
interface Props {
schema: z.ZodSchema
- specialistId: number
+ specialistId: string
employees: any[]
values: any
isLoading?: boolean
diff --git a/app/components/app/specialist-position/entry-form.vue b/app/components/app/specialist-position/entry-form.vue
index be031219..e1ef6009 100644
--- a/app/components/app/specialist-position/entry-form.vue
+++ b/app/components/app/specialist-position/entry-form.vue
@@ -40,7 +40,7 @@ const { defineField, errors, meta } = useForm({
const [code, codeAttrs] = defineField('code')
const [name, nameAttrs] = defineField('name')
-const [specialist, specialistAttrs] = defineField('specialist_id')
+const [specialist, specialistAttrs] = defineField('specialist_code')
const [employee, employeeAttrs] = defineField('employee_id')
const [headStatus, headStatusAttrs] = defineField('headStatus')
@@ -62,8 +62,8 @@ const headStatusStr = computed({
if (props.values) {
if (props.values.code !== undefined) code.value = props.values.code
if (props.values.name !== undefined) name.value = props.values.name
- if (props.values.specialist_id !== undefined)
- specialist.value = props.values.specialist_id ? Number(props.values.specialist_id) : null
+ if (props.values.specialist_code !== undefined)
+ specialist.value = props.values.specialist_code ? String(props.values.specialist_code) : null
if (props.values.employee_id !== undefined)
employee.value = props.values.employee_id ? Number(props.values.employee_id) : null
if (props.values.headStatus !== undefined) headStatus.value = !!props.values.headStatus
@@ -72,7 +72,7 @@ if (props.values) {
const resetForm = () => {
code.value = ''
name.value = ''
- specialist.value = null
+ specialist.value = ''
employee.value = null
headStatus.value = false
}
@@ -83,7 +83,7 @@ function onSubmitForm() {
...genBase(),
name: name.value || '',
code: code.value || '',
- specialist_id: specialist.value || null,
+ specialist_code: specialist.value || '',
employee_id: employee.value || null,
headStatus: headStatus.value !== undefined ? headStatus.value : undefined,
}
@@ -130,7 +130,7 @@ function onCancelForm() {
-
+
,
})
const [code, codeAttrs] = defineField('code')
const [name, nameAttrs] = defineField('name')
-const [unit, unitAttrs] = defineField('unit_id')
+const [unit, unitAttrs] = defineField('unit_code')
// Fill fields from props.values if provided
if (props.values) {
if (props.values.code !== undefined) code.value = props.values.code
if (props.values.name !== undefined) name.value = props.values.name
- if (props.values.unit_id !== undefined) unit.value = props.values.unit_id ? String(props.values.unit_id) : null
+ if (props.values.unit_code !== undefined) unit.value = props.values.unit_code ? String(props.values.unit_code) : null
}
const resetForm = () => {
@@ -63,7 +63,7 @@ function onSubmitForm(values: any) {
...genBase(),
name: name.value || '',
code: code.value || '',
- unit_id: unit.value ? Number(unit.value) : null,
+ unit_code: unit.value ? String(unit.value) : null,
}
emit('submit', formData, resetForm)
}
diff --git a/app/components/app/subspecialist-position/entry-detail.vue b/app/components/app/subspecialist-position/entry-detail.vue
index fd3f91b7..2a3e5e1c 100644
--- a/app/components/app/subspecialist-position/entry-detail.vue
+++ b/app/components/app/subspecialist-position/entry-detail.vue
@@ -18,7 +18,7 @@ import { genSubSpecialistPosition } from '~/models/subspecialist-position'
interface Props {
schema: z.ZodSchema
- subspecialistId: number
+ subspecialistId: string
employees: any[]
values: any
isLoading?: boolean
diff --git a/app/components/app/subspecialist-position/entry-form.vue b/app/components/app/subspecialist-position/entry-form.vue
index c897b2f5..4522d82c 100644
--- a/app/components/app/subspecialist-position/entry-form.vue
+++ b/app/components/app/subspecialist-position/entry-form.vue
@@ -40,7 +40,7 @@ const { defineField, errors, meta } = useForm({
const [code, codeAttrs] = defineField('code')
const [name, nameAttrs] = defineField('name')
-const [subSpecialist, subSpecialistAttrs] = defineField('subspecialist_id')
+const [subSpecialist, subSpecialistAttrs] = defineField('subspecialist_code')
const [employee, employeeAttrs] = defineField('employee_id')
const [headStatus, headStatusAttrs] = defineField('headStatus')
@@ -62,8 +62,8 @@ const headStatusStr = computed({
if (props.values) {
if (props.values.code !== undefined) code.value = props.values.code
if (props.values.name !== undefined) name.value = props.values.name
- if (props.values.subspecialist_id !== undefined)
- subSpecialist.value = props.values.subspecialist_id ? Number(props.values.subspecialist_id) : null
+ if (props.values.subspecialist_code !== undefined)
+ subSpecialist.value = props.values.subspecialist_code ? String(props.values.subspecialist_code) : null
if (props.values.employee_id !== undefined)
employee.value = props.values.employee_id ? Number(props.values.employee_id) : null
if (props.values.headStatus !== undefined) headStatus.value = !!props.values.headStatus
@@ -83,7 +83,7 @@ function onSubmitForm() {
...genBase(),
name: name.value || '',
code: code.value || '',
- subspecialist_id: subSpecialist.value || null,
+ subspecialist_code: subSpecialist.value || null,
employee_id: employee.value || null,
headStatus: headStatus.value !== undefined ? headStatus.value : undefined,
}
@@ -130,7 +130,7 @@ function onCancelForm() {
|
-
+
,
})
const [code, codeAttrs] = defineField('code')
const [name, nameAttrs] = defineField('name')
-const [specialist, specialistAttrs] = defineField('specialist_id')
+const [specialist, specialistAttrs] = defineField('specialist_code')
// Fill fields from props.values if provided
if (props.values) {
if (props.values.code !== undefined) code.value = props.values.code
if (props.values.name !== undefined) name.value = props.values.name
- if (props.values.specialist_id !== undefined)
- specialist.value = props.values.specialist_id ? String(props.values.specialist_id) : null
+ if (props.values.specialist_code !== undefined)
+ specialist.value = props.values.specialist_code ? String(props.values.specialist_code) : null
}
const resetForm = () => {
@@ -64,7 +64,7 @@ function onSubmitForm(values: any) {
...genBase(),
name: name.value || '',
code: code.value || '',
- specialist_id: specialist.value ? Number(specialist.value) : null,
+ specialist_code: specialist.value ? String(specialist.value) : "",
}
emit('submit', formData, resetForm)
}
diff --git a/app/components/app/unit-position/entry-detail.vue b/app/components/app/unit-position/entry-detail.vue
deleted file mode 100644
index fb84e41a..00000000
--- a/app/components/app/unit-position/entry-detail.vue
+++ /dev/null
@@ -1,192 +0,0 @@
-
-
-
-
-
diff --git a/app/components/app/unit-position/entry-form.vue b/app/components/app/unit-position/entry-form.vue
index b6ab8609..ea2efc09 100644
--- a/app/components/app/unit-position/entry-form.vue
+++ b/app/components/app/unit-position/entry-form.vue
@@ -40,7 +40,7 @@ const { defineField, errors, meta } = useForm({
const [code, codeAttrs] = defineField('code')
const [name, nameAttrs] = defineField('name')
-const [unit, unitAttrs] = defineField('unit_id')
+const [unit, unitAttrs] = defineField('unit_code')
const [employee, employeeAttrs] = defineField('employee_id')
const [headStatus, headStatusAttrs] = defineField('headStatus')
@@ -62,7 +62,7 @@ const headStatusStr = computed({
if (props.values) {
if (props.values.code !== undefined) code.value = props.values.code
if (props.values.name !== undefined) name.value = props.values.name
- if (props.values.unit_id !== undefined) unit.value = props.values.unit_id ? Number(props.values.unit_id) : null
+ if (props.values.unit_code !== undefined) unit.value = props.values.unit_code ? String(props.values.unit_code) : null
if (props.values.employee_id !== undefined)
employee.value = props.values.employee_id ? Number(props.values.employee_id) : null
if (props.values.headStatus !== undefined) headStatus.value = !!props.values.headStatus
@@ -82,7 +82,7 @@ function onSubmitForm() {
...genBase(),
name: name.value || '',
code: code.value || '',
- unit_id: unit.value || null,
+ unit_code: unit.value || '',
employee_id: employee.value || null,
headStatus: headStatus.value !== undefined ? headStatus.value : undefined,
}
@@ -129,7 +129,7 @@ function onCancelForm() {
|
-
+
,
})
const [code, codeAttrs] = defineField('code')
const [name, nameAttrs] = defineField('name')
-const [installation, installationAttrs] = defineField('installation_id')
+const [installation, installationAttrs] = defineField('installation_code')
// Fill fields from props.values if provided
if (props.values) {
if (props.values.code !== undefined) code.value = props.values.code
if (props.values.name !== undefined) name.value = props.values.name
- if (props.values.installation_id !== undefined)
- installation.value = props.values.installation_id ? Number(props.values.installation_id) : null
+ if (props.values.installation_code !== undefined)
+ installation.value = props.values.installation_code ? String(props.values.installation_code) : null
}
const resetForm = () => {
@@ -62,7 +62,7 @@ function onSubmitForm() {
const formData: UnitFormData = {
name: name.value || '',
code: code.value || '',
- installation_id: installation.value ? Number(installation.value) : null,
+ installation_code: installation.value ? String(installation.value) : "",
}
emit('submit', formData, resetForm)
}
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 e62a2fbd..1ffa324d 100644
--- a/app/components/content/device-order/list.vue
+++ b/app/components/content/device-order/list.vue
@@ -1,69 +1,39 @@
@@ -108,38 +145,39 @@ onMounted(async () => {
: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/division-position/list.vue b/app/components/content/division-position/list.vue
index 4fa8605d..10bbc4e2 100644
--- a/app/components/content/division-position/list.vue
+++ b/app/components/content/division-position/list.vue
@@ -105,12 +105,12 @@ const getCurrentDivisionDetail = async (id: number | string) => {
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showDetail:
- getCurrentDivisionDetail(recId.value)
+ getCurrentDivisionDetail(recItem.value.code)
title.value = 'Detail Divisi Position'
isReadonly.value = true
break
case ActionEvents.showEdit:
- getCurrentDivisionDetail(recId.value)
+ getCurrentDivisionDetail(recItem.value.code)
title.value = 'Edit Divisi Position'
isReadonly.value = false
break
@@ -122,7 +122,7 @@ watch([recId, recAction], () => {
onMounted(async () => {
try {
- divisions.value = await getDivisionLabelList({ sort: 'createdAt:asc', 'page-size': 100 })
+ divisions.value = await getDivisionLabelList({ sort: 'createdAt:asc', 'page-size': 100 }, true)
employees.value = await getEmployeeLabelList({ sort: 'createdAt:asc', 'page-size': 100, includes: 'person' })
await getDivisionList()
} catch (err) {
@@ -172,9 +172,8 @@ onMounted(async () => {
:is-readonly="isReadonly"
@submit="
(values: DivisionPositionFormData | Record, resetForm: () => void) => {
- console.log(values)
- if (recId > 0) {
- handleActionEdit(recId, values, getDivisionList, resetForm, toast)
+ if (recItem?.code.length > 0) {
+ handleActionEdit(recItem.code, values, getDivisionList, resetForm, toast)
return
}
handleActionSave(values, getDivisionList, resetForm, toast)
@@ -189,7 +188,7 @@ onMounted(async () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
- @confirm="() => handleActionRemove(recId, getDivisionList, toast)"
+ @confirm="() => handleActionRemove(recItem.code, getDivisionList, toast)"
@cancel=""
>
diff --git a/app/components/content/division/detail.vue b/app/components/content/division/detail.vue
index 8b7d2e92..e059702b 100644
--- a/app/components/content/division/detail.vue
+++ b/app/components/content/division/detail.vue
@@ -47,7 +47,7 @@ const title = ref('')
// #region Props & Emits
const props = defineProps<{
- divisionId: number
+ divisionId: string
}>()
const division = ref({} as Division)
// #endregion
@@ -152,7 +152,7 @@ watch([recId, recAction], () => {
console.log(recId, recAction)
switch (recAction.value) {
case ActionEvents.showEdit:
- getDetailDivisionPosition(recId.value)
+ getDetailDivisionPosition(recItem.value.code)
title.value = 'Edit Jabatan'
isReadonly.value = false
isFormEntryDialogOpen.value = true
@@ -201,8 +201,8 @@ watch([recId, recAction], () => {
@submit="
(values: DivisionPositionFormData | Record, resetForm: () => void) => {
console.log(values)
- if (recId > 0) {
- handleActionEdit(recId, values, getDivisionPositionList, onResetState, toast)
+ if (recItem?.code.length > 0) {
+ handleActionEdit(recItem.code, values, getDivisionPositionList, onResetState, toast)
return
}
handleActionSave(values, getDivisionPositionList, onResetState, toast)
@@ -215,7 +215,7 @@ watch([recId, recAction], () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
- @confirm="() => handleActionRemove(recId, getDivisionPositionList, toast)"
+ @confirm="() => handleActionRemove(recItem.code, getDivisionPositionList, toast)"
@cancel=""
>
diff --git a/app/components/content/division/list.vue b/app/components/content/division/list.vue
index 0456891b..ecfd0cb1 100644
--- a/app/components/content/division/list.vue
+++ b/app/components/content/division/list.vue
@@ -105,26 +105,23 @@ const getCurrentDivisionDetail = async (id: number | string) => {
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showDetail:
- if (Number(recId.value) > 0) {
- const id = Number(recId.value)
+ if (recItem.value.code.length > 0) {
+ navigateTo({
+ name: 'org-src-division-id',
+ params: {
+ id: recItem.value.code,
+ },
+ })
recAction.value = ''
recItem.value = null
recId.value = 0
isFormEntryDialogOpen.value = false
isReadonly.value = false
-
- navigateTo({
- name: 'org-src-division-id',
- params: {
- id,
- },
- })
}
-
break
case ActionEvents.showEdit:
- getCurrentDivisionDetail(recId.value)
+ getCurrentDivisionDetail(recItem.value.code)
title.value = 'Edit Divisi'
isReadonly.value = false
break
@@ -146,7 +143,7 @@ watch(
if (result.success) {
const currentData = result.body.data || []
const normalizedData = currentData.filter((division: Division) => !division.parent_id)
- divisionsTrees.value = getValueTreeItems(normalizedData)
+ divisionsTrees.value = getValueTreeItems(normalizedData, true)
}
},
)
@@ -190,9 +187,9 @@ onMounted(async () => {
:is-readonly="isReadonly"
@submit="
(values: DivisionFormData | Record, resetForm: () => void) => {
- console.log(values)
- if (recId > 0) {
- handleActionEdit(recId, values, getDivisionList, resetForm, toast)
+ // console.log(values)
+ if (recItem?.code.length > 0) {
+ handleActionEdit(recItem.code, values, getDivisionList, resetForm, toast)
return
}
handleActionSave(values, getDivisionList, resetForm, toast)
@@ -207,7 +204,7 @@ onMounted(async () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
- @confirm="() => handleActionRemove(recId, getDivisionList, toast)"
+ @confirm="() => handleActionRemove(recItem.code, getDivisionList, toast)"
@cancel=""
>
diff --git a/app/components/content/document-upload/add.vue b/app/components/content/document-upload/add.vue
new file mode 100644
index 00000000..9d099189
--- /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..d1f6fbad
--- /dev/null
+++ b/app/components/content/document-upload/list.vue
@@ -0,0 +1,183 @@
+
+
+
+
+
+
+
+
+
+
+ ID:
+ {{ record?.id }}
+
+
+ Nama:
+ {{ record?.name }}
+
+
+
+
+
+
+
diff --git a/app/components/content/encounter/process.vue b/app/components/content/encounter/process.vue
index 7605897e..da28e7f5 100644
--- a/app/components/content/encounter/process.vue
+++ b/app/components/content/encounter/process.vue
@@ -9,6 +9,8 @@ import { getDetail } from '~/services/encounter.service'
import type { TabItem } from '~/components/pub/my-ui/comp-tab/type'
import CompTab from '~/components/pub/my-ui/comp-tab/comp-tab.vue'
+import { genEncounter } from '~/models/encounter'
+
// PLASE ORDER BY TAB POSITION
import Status from '~/components/content/encounter/status.vue'
import AssesmentFunctionList from '~/components/content/soapi/entry.vue'
@@ -16,10 +18,14 @@ import EarlyMedicalAssesmentList from '~/components/content/soapi/entry.vue'
import EarlyMedicalRehabList from '~/components/content/soapi/entry.vue'
import KfrList from '~/components/content/kfr/list.vue'
import TherapyProtocolList from '~/components/content/therapy-protocol/list.vue'
+import DeviceOrder from '~/components/content/device-order/main.vue'
import Prescription from '~/components/content/prescription/main.vue'
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 DocUploadList from '~/components/content/document-upload/list.vue'
+import GeneralConsentList from '~/components/content/general-consent/entry.vue'
+import ResumeList from '~/components/content/resume/list.vue'
import ControlLetterList from '~/components/content/control-letter/list.vue'
const route = useRoute()
@@ -34,12 +40,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 } },
@@ -69,21 +81,21 @@ const tabs: TabItem[] = [
},
{ value: 'therapy-protocol', label: 'Protokol Terapi', component: TherapyProtocolList, props: { encounter: data } },
{ 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: Prescription, props: { encounter_id: data.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: 'prescription', label: 'Order Obat', component: Prescription, props: { encounter_id: data.value.id } },
+ { value: 'device-order', label: 'Order Alkes', component: DeviceOrder, props: { encounter_id: data.value.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' },
{ 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', 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 }, },
]
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/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..738adca1
--- /dev/null
+++ b/app/components/content/general-consent/form.vue
@@ -0,0 +1,185 @@
+
+
+
+
+
+
diff --git a/app/components/content/general-consent/list.vue b/app/components/content/general-consent/list.vue
new file mode 100644
index 00000000..4cf269ee
--- /dev/null
+++ b/app/components/content/general-consent/list.vue
@@ -0,0 +1,179 @@
+
+
+
+
+
+
+
+
+ handleActionRemove(recId, getMyList, toast)"
+ @cancel=""
+ >
+
+
+
+ ID:
+ {{ record?.id }}
+
+
+ Nama:
+ {{ record.name }}
+
+
+ Kode:
+ {{ record.code }}
+
+
+
+
+
diff --git a/app/components/content/installation-position/list.vue b/app/components/content/installation-position/list.vue
index ea60ee04..734406e8 100644
--- a/app/components/content/installation-position/list.vue
+++ b/app/components/content/installation-position/list.vue
@@ -108,7 +108,7 @@ watch([recId, recAction], () => {
isReadonly.value = true
break
case ActionEvents.showEdit:
- getCurrentInstallationDetail(recId.value)
+ getCurrentInstallationDetail(recItem.value.code)
title.value = 'Edit Instalasi - Posisi'
isReadonly.value = false
break
@@ -120,7 +120,7 @@ watch([recId, recAction], () => {
onMounted(async () => {
try {
- installations.value = await getInstallationLabelList({ sort: 'createdAt:asc', 'page-size': 100 })
+ installations.value = await getInstallationLabelList({ sort: 'createdAt:asc', 'page-size': 100 }, true)
employees.value = await getEmployeeLabelList({ sort: 'createdAt:asc', 'page-size': 100, includes: 'person' })
} catch (err) {
console.log(err)
@@ -169,8 +169,8 @@ onMounted(async () => {
:is-readonly="isReadonly"
@submit="
(values: InstallationPositionFormData | Record, resetForm: () => void) => {
- if (recId > 0) {
- handleActionEdit(recId, values, getInstallationPositionList, resetForm, toast)
+ if (recItem?.code.length > 0) {
+ handleActionEdit(recItem.code, values, getInstallationPositionList, resetForm, toast)
return
}
handleActionSave(values, getInstallationPositionList, resetForm, toast)
@@ -185,7 +185,7 @@ onMounted(async () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
- @confirm="() => handleActionRemove(recId, getInstallationPositionList, toast)"
+ @confirm="() => handleActionRemove(recItem.code, getInstallationPositionList, toast)"
@cancel=""
>
diff --git a/app/components/content/installation/detail.vue b/app/components/content/installation/detail.vue
index 0f12ad8c..bd0d2988 100644
--- a/app/components/content/installation/detail.vue
+++ b/app/components/content/installation/detail.vue
@@ -47,7 +47,7 @@ const title = ref('')
// #region Props & Emits
const props = defineProps<{
- installationId: number
+ installationId: string
}>()
const installation = ref({} as Installation)
// #endregion
@@ -153,7 +153,7 @@ watch([recId, recAction], () => {
console.log(recId, recAction)
switch (recAction.value) {
case ActionEvents.showEdit:
- getDetailInstallationPosition(recId.value)
+ getDetailInstallationPosition(recItem.value.code)
title.value = 'Edit Jabatan'
isReadonly.value = false
isFormEntryDialogOpen.value = true
@@ -202,8 +202,8 @@ watch([recId, recAction], () => {
@submit="
(values: InstallationPositionFormData | Record, resetForm: () => void) => {
console.log(values)
- if (recId > 0) {
- handleActionEdit(recId, values, getInstallationPositionList, onResetState, toast)
+ if (recItem?.code.length > 0) {
+ handleActionEdit(recItem.code, values, getInstallationPositionList, onResetState, toast)
return
}
handleActionSave(values, getInstallationPositionList, onResetState, toast)
@@ -216,7 +216,7 @@ watch([recId, recAction], () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
- @confirm="() => handleActionRemove(recId, getInstallationPositionList, toast)"
+ @confirm="() => handleActionRemove(recItem.code, getInstallationPositionList, toast)"
@cancel=""
>
diff --git a/app/components/content/installation/list.vue b/app/components/content/installation/list.vue
index 553d7ebb..6f12c90b 100644
--- a/app/components/content/installation/list.vue
+++ b/app/components/content/installation/list.vue
@@ -102,26 +102,23 @@ const getCurrentInstallationDetail = async (id: number | string) => {
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showDetail:
- if (Number(recId.value) > 0) {
- const id = Number(recId.value)
+ if (recItem.value.code.length > 0) {
+ navigateTo({
+ name: 'org-src-installation-id',
+ params: {
+ id: recItem.value.code,
+ },
+ })
recAction.value = ''
recItem.value = null
recId.value = 0
isFormEntryDialogOpen.value = false
isReadonly.value = false
-
- navigateTo({
- name: 'org-src-installation-id',
- params: {
- id,
- },
- })
}
-
break
case ActionEvents.showEdit:
- getCurrentInstallationDetail(recId.value)
+ getCurrentInstallationDetail(recItem.value.code)
title.value = 'Edit Instalasi'
isReadonly.value = false
break
@@ -171,8 +168,8 @@ onMounted(async () => {
:is-readonly="isReadonly"
@submit="
(values: InstallationFormData | Record, resetForm: () => void) => {
- if (recId > 0) {
- handleActionEdit(recId, values, getInstallationList, resetForm, toast)
+ if (recItem?.code.length > 0) {
+ handleActionEdit(recItem.code, values, getInstallationList, resetForm, toast)
return
}
handleActionSave(values, getInstallationList, resetForm, toast)
@@ -187,7 +184,7 @@ onMounted(async () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
- @confirm="() => handleActionRemove(recId, getInstallationList, toast)"
+ @confirm="() => handleActionRemove(recItem.code, getInstallationList, toast)"
@cancel=""
>
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 @@
+
+
+
+
+
+
+
+
+
+
+ handleActionRemove(recItem.code, getMedicineFormList, toast)"
+ @cancel=""
+ >
+
+
+
+ ID:
+ {{ record?.id }}
+
+
+ Nama:
+ {{ record.name }}
+
+
+ Kode:
+ {{ record.code }}
+
+
+
+
+
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 27470776..bfbf8750 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 || {} }
},
@@ -116,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:
@@ -127,6 +130,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,13 +167,14 @@ onMounted(async () => {
:values="recItem"
:medicineGroups="medicineGroups"
:medicineMethods="medicineMethods"
+ :medicineForms="medicineForms"
:uoms="uoms"
:is-loading="isProcessing"
:is-readonly="isReadonly"
@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)
@@ -184,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/prescription/entry.vue b/app/components/content/prescription/entry.vue
index 4b3fa663..46768432 100644
--- a/app/components/content/prescription/entry.vue
+++ b/app/components/content/prescription/entry.vue
@@ -1,86 +1,215 @@
@@ -91,42 +220,147 @@ function saveNonMix(data: PrescriptionItem) {
class="mb-4 xl:mb-5"
/>
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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 844cb04f..afd012f6 100644
--- a/app/components/content/prescription/list.vue
+++ b/app/components/content/prescription/list.vue
@@ -1,8 +1,10 @@
-
+
+
+
+
+
+
handleActionRemove(recId, getMyList, toast)"
@cancel=""
>
+
+ Tanggal
+ :
+ {{ recItem.createdAt.substring(0, 10) }}
+
+
+ DPJP
+ :
+ {{ recItem.doctor?.employee?.person?.name }}
+
+
+
+ handleActionSubmit(recId, getMyList, toast)"
+ @cancel=""
+ >
+
+ Tanggal
+ :
+ {{ recItem.createdAt.substring(0, 10) }}
+
+
+ DPJP
+ :
+ {{ recItem.doctor?.employee?.person?.name }}
+
diff --git a/app/components/content/resume/add.vue b/app/components/content/resume/add.vue
new file mode 100644
index 00000000..6fda4bf8
--- /dev/null
+++ b/app/components/content/resume/add.vue
@@ -0,0 +1,200 @@
+
+
+
+ Tambah Resume
+
+
+
+
+
+
+
+
+ aaaaaaaaaaaaaaa
+
+
+
+
+
+
+
+
diff --git a/app/components/content/resume/list.vue b/app/components/content/resume/list.vue
new file mode 100644
index 00000000..4b5b5001
--- /dev/null
+++ b/app/components/content/resume/list.vue
@@ -0,0 +1,215 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/components/content/specialist-position/list.vue b/app/components/content/specialist-position/list.vue
index 1ebf697e..cc176400 100644
--- a/app/components/content/specialist-position/list.vue
+++ b/app/components/content/specialist-position/list.vue
@@ -105,12 +105,12 @@ const getCurrentSpecialistDetail = async (id: number | string) => {
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showDetail:
- getCurrentSpecialistDetail(recId.value)
+ getCurrentSpecialistDetail(recItem.value.code)
title.value = 'Detail Spesialis Posisi'
isReadonly.value = true
break
case ActionEvents.showEdit:
- getCurrentSpecialistDetail(recId.value)
+ getCurrentSpecialistDetail(recItem.value.code)
title.value = 'Edit Spesialis Posisi'
isReadonly.value = false
break
@@ -122,7 +122,7 @@ watch([recId, recAction], () => {
onMounted(async () => {
try {
- specialists.value = await getValueLabelSpecialistList({ sort: 'createdAt:asc', 'page-size': 100 })
+ specialists.value = await getValueLabelSpecialistList({ sort: 'createdAt:asc', 'page-size': 100 }, true)
employees.value = await getEmployeeLabelList({ sort: 'createdAt:asc', 'page-size': 100, includes: 'person' })
} catch (err) {
console.log(err)
@@ -169,8 +169,8 @@ onMounted(async () => {
:is-readonly="isReadonly"
@submit="
(values: SpecialistPositionFormData | Record, resetForm: () => void) => {
- if (recId > 0) {
- handleActionEdit(recId, values, getSpecialistList, resetForm, toast)
+ if (recItem?.code.length > 0) {
+ handleActionEdit(recItem.code, values, getSpecialistList, resetForm, toast)
return
}
handleActionSave(values, getSpecialistList, resetForm, toast)
@@ -184,7 +184,7 @@ onMounted(async () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
- @confirm="() => handleActionRemove(recId, getSpecialistList, toast)"
+ @confirm="() => handleActionRemove(recItem.code, getSpecialistList, toast)"
@cancel=""
>
diff --git a/app/components/content/specialist/detail.vue b/app/components/content/specialist/detail.vue
index df4e79b6..8ff00c7d 100644
--- a/app/components/content/specialist/detail.vue
+++ b/app/components/content/specialist/detail.vue
@@ -48,7 +48,7 @@ const title = ref('')
// #region Props & Emits
const props = defineProps<{
- specialistId: number
+ specialistId: string
}>()
const specialist = ref({} as Specialist)
// #endregion
@@ -154,7 +154,7 @@ provide('table_data_loader', isLoading)
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showEdit:
- getDetailSpecialistPosition(recId.value)
+ getDetailSpecialistPosition(recItem.value.code)
title.value = 'Edit Posisi'
isReadonly.value = false
isFormEntryDialogOpen.value = true
@@ -203,8 +203,8 @@ watch([recId, recAction], () => {
@submit="
(values: SpecialistPositionFormData | Record, resetForm: () => void) => {
console.log(values)
- if (recId > 0) {
- handleActionEdit(recId, values, getPositionList, onResetState, toast)
+ if (recItem?.code.length > 0) {
+ handleActionEdit(recItem.code, values, getPositionList, onResetState, toast)
return
}
handleActionSave(values, getPositionList, onResetState, toast)
@@ -217,7 +217,7 @@ watch([recId, recAction], () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
- @confirm="() => handleActionRemove(recId, getPositionList, toast)"
+ @confirm="() => handleActionRemove(recItem.code, getPositionList, toast)"
@cancel=""
>
diff --git a/app/components/content/specialist/list.vue b/app/components/content/specialist/list.vue
index ca293026..ea96710b 100644
--- a/app/components/content/specialist/list.vue
+++ b/app/components/content/specialist/list.vue
@@ -103,26 +103,23 @@ const getCurrentSpecialistDetail = async (id: number | string) => {
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showDetail:
- if (Number(recId.value) > 0) {
- const id = Number(recId.value)
+ if (recItem.value.code.length > 0) {
+ navigateTo({
+ name: 'org-src-specialist-id',
+ params: {
+ id: recItem.value.code,
+ },
+ })
recAction.value = ''
recItem.value = null
recId.value = 0
isFormEntryDialogOpen.value = false
isReadonly.value = false
-
- navigateTo({
- name: 'org-src-specialist-id',
- params: {
- id,
- },
- })
}
-
break
case ActionEvents.showEdit:
- getCurrentSpecialistDetail(recId.value)
+ getCurrentSpecialistDetail(recItem.value.code)
title.value = 'Edit Spesialis'
isReadonly.value = false
break
@@ -133,7 +130,7 @@ watch([recId, recAction], () => {
})
onMounted(async () => {
- units.value = await getUnitList()
+ units.value = await getUnitList({}, true)
await getSpecialistList()
})
@@ -172,8 +169,8 @@ onMounted(async () => {
:is-readonly="isReadonly"
@submit="
(values: SpecialistFormData | Record, resetForm: () => void) => {
- if (recId > 0) {
- handleActionEdit(recId, values, getSpecialistList, resetForm, toast)
+ if (recItem?.code.length > 0) {
+ handleActionEdit(recItem.code, values, getSpecialistList, resetForm, toast)
return
}
handleActionSave(values, getSpecialistList, resetForm, toast)
@@ -188,7 +185,7 @@ onMounted(async () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
- @confirm="() => handleActionRemove(recId, getSpecialistList, toast)"
+ @confirm="() => handleActionRemove(recItem.code, getSpecialistList, toast)"
@cancel=""
>
diff --git a/app/components/content/subspecialist-position/list.vue b/app/components/content/subspecialist-position/list.vue
index 4c833ce2..02b0a676 100644
--- a/app/components/content/subspecialist-position/list.vue
+++ b/app/components/content/subspecialist-position/list.vue
@@ -110,12 +110,12 @@ const getCurrentSubSpecialistDetail = async (id: number | string) => {
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showDetail:
- getCurrentSubSpecialistDetail(recId.value)
+ getCurrentSubSpecialistDetail(recItem.value.code)
title.value = 'Detail Sub Spesialis Posisi'
isReadonly.value = true
break
case ActionEvents.showEdit:
- getCurrentSubSpecialistDetail(recId.value)
+ getCurrentSubSpecialistDetail(recItem.value.code)
title.value = 'Edit Sub Spesialis Posisi'
isReadonly.value = false
break
@@ -127,7 +127,7 @@ watch([recId, recAction], () => {
onMounted(async () => {
try {
- subSpecialists.value = await getValueLabelSubSpecialistList({ sort: 'createdAt:asc', 'page-size': 100 })
+ subSpecialists.value = await getValueLabelSubSpecialistList({ sort: 'createdAt:asc', 'page-size': 100 }, true)
employees.value = await getEmployeeLabelList({ sort: 'createdAt:asc', 'page-size': 100, includes: 'person' })
} catch (err) {
console.log(err)
@@ -176,8 +176,8 @@ onMounted(async () => {
:is-readonly="isReadonly"
@submit="
(values: SubSpecialistPositionFormData | Record, resetForm: () => void) => {
- if (recId > 0) {
- handleActionEdit(recId, values, getSubSpecialistList, onResetState, toast)
+ if (recItem?.code.length > 0) {
+ handleActionEdit(recItem.code, values, getSubSpecialistList, onResetState, toast)
return
}
handleActionSave(values, getSubSpecialistList, onResetState, toast)
@@ -192,7 +192,7 @@ onMounted(async () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
- @confirm="() => handleActionRemove(recId, getSubSpecialistList, toast)"
+ @confirm="() => handleActionRemove(recItem.code, getSubSpecialistList, toast)"
@cancel=""
>
diff --git a/app/components/content/subspecialist/detail.vue b/app/components/content/subspecialist/detail.vue
index d432eb22..165484a4 100644
--- a/app/components/content/subspecialist/detail.vue
+++ b/app/components/content/subspecialist/detail.vue
@@ -51,7 +51,7 @@ const title = ref('')
// #region Props & Emits
const props = defineProps<{
- subspecialistId: number
+ subspecialistId: string
}>()
const subSpecialist = ref({} as Subspecialist)
// #endregion
@@ -157,7 +157,7 @@ provide('table_data_loader', isLoading)
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showEdit:
- getDetailSubSpecialistPosition(recId.value)
+ getDetailSubSpecialistPosition(recItem.value.code)
title.value = 'Edit Posisi'
isReadonly.value = false
isFormEntryDialogOpen.value = true
@@ -206,8 +206,8 @@ watch([recId, recAction], () => {
@submit="
(values: SubSpecialistPositionFormData | Record, resetForm: () => void) => {
console.log(values)
- if (recId > 0) {
- handleActionEdit(recId, values, getPositionList, onResetState, toast)
+ if (recItem?.code.length > 0) {
+ handleActionEdit(recItem.code, values, getPositionList, onResetState, toast)
return
}
handleActionSave(values, getPositionList, onResetState, toast)
@@ -220,7 +220,7 @@ watch([recId, recAction], () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
- @confirm="() => handleActionRemove(recId, getPositionList, toast)"
+ @confirm="() => handleActionRemove(recItem.code, getPositionList, toast)"
@cancel=""
>
diff --git a/app/components/content/subspecialist/list.vue b/app/components/content/subspecialist/list.vue
index bb1b63f5..a9925ad2 100644
--- a/app/components/content/subspecialist/list.vue
+++ b/app/components/content/subspecialist/list.vue
@@ -103,26 +103,23 @@ const getCurrentSubSpecialistDetail = async (id: number | string) => {
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showDetail:
- if (Number(recId.value) > 0) {
- const id = Number(recId.value)
+ if (recItem.value.code.length > 0) {
+ navigateTo({
+ name: 'org-src-subspecialist-id',
+ params: {
+ id: recItem.value.code,
+ },
+ })
recAction.value = ''
recItem.value = null
recId.value = 0
isFormEntryDialogOpen.value = false
isReadonly.value = false
-
- navigateTo({
- name: 'org-src-subspecialist-id',
- params: {
- id,
- },
- })
}
-
break
case ActionEvents.showEdit:
- getCurrentSubSpecialistDetail(recId.value)
+ getCurrentSubSpecialistDetail(recItem.value.code)
title.value = 'Edit Sub Spesialis'
isReadonly.value = false
break
@@ -133,7 +130,7 @@ watch([recId, recAction], () => {
})
onMounted(async () => {
- specialists.value = await getSpecialistsList()
+ specialists.value = await getSpecialistsList({}, true)
await getSubSpecialistList()
})
@@ -172,8 +169,8 @@ onMounted(async () => {
:is-readonly="isReadonly"
@submit="
(values: SubspecialistFormData | Record, resetForm: () => void) => {
- if (recId > 0) {
- handleActionEdit(recId, values, getSubSpecialistList, resetForm, toast)
+ if (recItem?.code.length > 0) {
+ handleActionEdit(recItem.code, values, getSubSpecialistList, resetForm, toast)
return
}
handleActionSave(values, getSubSpecialistList, resetForm, toast)
@@ -188,7 +185,7 @@ onMounted(async () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
- @confirm="() => handleActionRemove(recId, getSubSpecialistList, toast)"
+ @confirm="() => handleActionRemove(recItem.code, getSubSpecialistList, 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=""
>
diff --git a/app/components/content/unit-position/list.vue b/app/components/content/unit-position/list.vue
index 55ab3f29..e0ffc5f2 100644
--- a/app/components/content/unit-position/list.vue
+++ b/app/components/content/unit-position/list.vue
@@ -106,12 +106,12 @@ const getCurrentUnitDetail = async (id: number | string) => {
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showDetail:
- getCurrentUnitDetail(recId.value)
+ getCurrentUnitDetail(recItem.value.code)
title.value = 'Detail Unit Posisi'
isReadonly.value = true
break
case ActionEvents.showEdit:
- getCurrentUnitDetail(recId.value)
+ getCurrentUnitDetail(recItem.value.code)
title.value = 'Edit Unit Posisi'
isReadonly.value = false
break
@@ -123,7 +123,7 @@ watch([recId, recAction], () => {
onMounted(async () => {
try {
- units.value = await getValueLabelUnitList({ sort: 'createdAt:asc', 'page-size': 100 })
+ units.value = await getValueLabelUnitList({ sort: 'createdAt:asc', 'page-size': 100 }, true)
employees.value = await getEmployeeLabelList({ sort: 'createdAt:asc', 'page-size': 100, includes: 'person' })
} catch (err) {
console.log(err)
@@ -172,8 +172,8 @@ onMounted(async () => {
:is-readonly="isReadonly"
@submit="
(values: UnitPositionFormData | Record, resetForm: () => void) => {
- if (recId > 0) {
- handleActionEdit(recId, values, getListUnit, resetForm, toast)
+ if (recItem?.code.length > 0) {
+ handleActionEdit(recItem.code, values, getListUnit, resetForm, toast)
return
}
handleActionSave(values, getListUnit, resetForm, toast)
@@ -187,7 +187,7 @@ onMounted(async () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
- @confirm="() => handleActionRemove(recId, getListUnit, toast)"
+ @confirm="() => handleActionRemove(recItem.code, getListUnit, toast)"
@cancel=""
>
diff --git a/app/components/content/unit/detail.vue b/app/components/content/unit/detail.vue
index 6c51624f..17070c35 100644
--- a/app/components/content/unit/detail.vue
+++ b/app/components/content/unit/detail.vue
@@ -47,7 +47,7 @@ const title = ref('')
// #region Props & Emits
const props = defineProps<{
- unitId: number
+ unitId: string
}>()
const unit = ref({} as Unit)
// #endregion
@@ -152,7 +152,7 @@ watch([recId, recAction], () => {
console.log(recId, recAction)
switch (recAction.value) {
case ActionEvents.showEdit:
- getDetailUnitPosition(recId.value)
+ getDetailUnitPosition(recItem.value.code)
title.value = 'Edit Posisi'
isReadonly.value = false
isFormEntryDialogOpen.value = true
@@ -201,8 +201,8 @@ watch([recId, recAction], () => {
@submit="
(values: UnitPositionFormData | Record, resetForm: () => void) => {
console.log(values)
- if (recId > 0) {
- handleActionEdit(recId, values, getPositionList, onResetState, toast)
+ if (recItem?.code.length > 0) {
+ handleActionEdit(recItem.code, values, getPositionList, onResetState, toast)
return
}
handleActionSave(values, getPositionList, onResetState, toast)
@@ -215,7 +215,7 @@ watch([recId, recAction], () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
- @confirm="() => handleActionRemove(recId, getPositionList, toast)"
+ @confirm="() => handleActionRemove(recItem.code, getPositionList, toast)"
@cancel=""
>
diff --git a/app/components/content/unit/list.vue b/app/components/content/unit/list.vue
index 34b647ef..2e281ddb 100644
--- a/app/components/content/unit/list.vue
+++ b/app/components/content/unit/list.vue
@@ -103,26 +103,22 @@ const getCurrentUnitDetail = async (id: number | string) => {
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showDetail:
- if (Number(recId.value) > 0) {
- const id = Number(recId.value)
-
+ if (recItem.value.code.length > 0) {
+ navigateTo({
+ name: 'org-src-unit-id',
+ params: {
+ id: recItem.value.code,
+ },
+ })
recAction.value = ''
recItem.value = null
recId.value = 0
isFormEntryDialogOpen.value = false
isReadonly.value = false
-
- navigateTo({
- name: 'org-src-unit-id',
- params: {
- id,
- },
- })
}
-
break
case ActionEvents.showEdit:
- getCurrentUnitDetail(recId.value)
+ getCurrentUnitDetail(recItem.value.code)
title.value = 'Edit Unit'
isReadonly.value = false
break
@@ -133,7 +129,7 @@ watch([recId, recAction], () => {
})
onMounted(async () => {
- installations.value = await getInstallationList()
+ installations.value = await getInstallationList({}, true)
await getUnitList()
})
@@ -172,8 +168,8 @@ onMounted(async () => {
:is-readonly="isReadonly"
@submit="
(values: UnitFormData | Record, resetForm: () => void) => {
- if (recId > 0) {
- handleActionEdit(recId, values, getUnitList, resetForm, toast)
+ if (recItem?.code.length > 0) {
+ handleActionEdit(recItem.code, values, getUnitList, resetForm, toast)
return
}
handleActionSave(values, getUnitList, resetForm, toast)
@@ -188,7 +184,7 @@ onMounted(async () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
- @confirm="() => handleActionRemove(recId, getUnitList, toast)"
+ @confirm="() => handleActionRemove(recItem.code, getUnitList, toast)"
@cancel=""
>
diff --git a/app/components/pub/my-ui/data-table/data-table.vue b/app/components/pub/my-ui/data-table/data-table.vue
index 431df276..408b6d9d 100644
--- a/app/components/pub/my-ui/data-table/data-table.vue
+++ b/app/components/pub/my-ui/data-table/data-table.vue
@@ -85,7 +85,7 @@ function handleActionCellClick(event: Event, _cellRef: string) {
v-for="(th, idx) in headers[hrIdx]"
:key="`head-${idx}`"
:class="`border ${th.classVal || ''}`"
- :style="{ width: cols[idx]?.width ? `${cols[idx].width}px` : undefined }"
+ :style="{ width: cols[idx]?.width ? `${cols[idx].width}${cols[idx].widthUnit ?? 'px'}` : '' }"
>
{{ th.label }}
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/components/pub/my-ui/data/types.ts b/app/components/pub/my-ui/data/types.ts
index 48fc84b5..38493ddb 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/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/components/pub/my-ui/form/input-base.vue b/app/components/pub/my-ui/form/input-base.vue
index a3743734..c31b2073 100644
--- a/app/components/pub/my-ui/form/input-base.vue
+++ b/app/components/pub/my-ui/form/input-base.vue
@@ -63,14 +63,14 @@ function handleInput(event: Event) {
v-slot="{ componentField }"
:name="fieldName"
>
-
+
- {{ bottomLabel }}
+ {{ 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 c8bdde02..43002c80 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) {
-
+
\ No newline at end of file
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 }
}
diff --git a/app/composables/useRBAC.ts b/app/composables/useRBAC.ts
index ced57e3e..076cae68 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,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 +59,7 @@ export function useRBAC() {
hasReadAccess,
hasUpdateAccess,
hasDeleteAccess,
+ getPagePermissions,
+
}
}
diff --git a/app/handlers/device-order.handler.ts b/app/handlers/device-order.handler.ts
index b1df996b..ab6f8fb5 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 } 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/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/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/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/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/clinical-const.ts b/app/lib/clinical-const.ts
new file mode 100644
index 00000000..d6a37b43
--- /dev/null
+++ b/app/lib/clinical-const.ts
@@ -0,0 +1,226 @@
+export type SubjectCode = 'detail' | 'pri-complain' | 'sec-complain' | 'cur-disea-hist' | 'pas-disea-hist' | 'fam-disea-hist' | 'alg-hist' | 'alg-react' | 'med-hist' | 'blood-type'
+export type ObjectCode = 'detail' | 'consc-level' | 'consc-level-det' | 'syst-bp' | 'diast-bp' | 'pulse' | 'resp-rate' | 'hear-rt' | 'neuro-cranialis' | 'sensoris' | 'reflect-fisio' | 'reflect-pato' | 'autonom-neuron' | 'neck-rom' | 'body-rom' | 'aga-rom' | 'agb-rom' | 'neck-mmt' | 'body-mmt' | 'aga-mmt' | 'agb-mmt' | 'localis' | 'medical-trouble' | 'rehab-medic-trouble' | 'temp' | 'spo2' | 'weight' | 'height' | 'head-to-toe'
+export type AssessmentCode = 'detail' | 'early-med-diag' | 'late-med-diag' | 'sec-med-diag' | 'early-func-diag' | 'late-func-diag' | 'sec-func-diag' | 'patient-dev'
+export type PlanCode = 'detail' | 'plan'
+export type InstructionCode = 'detail' | 'medical-act' | 'supporting-exam' | 'therapy' | 'medication' | 'material' | 'rehab-program' | 'physic-modal' | 'exercise' | 'ortes-protesa' | 'education' | 'other'
+export type HeadToToeCode = 'head' | 'eye' | 'ear' | 'nose' | 'mouth-throat' | 'head-others' | 'thorax' | 'heart' | 'lung' | 'abdomen' | 'liver' | 'back' | 'ekstremitas' | 'gender' | 'rectum' | 'neuron' | 'body-others'
+export type McuUrgencyLevelCode = 'cito' | 'cito-igd' | 'ponek' | 'blood-gas' | 'priority-form' | 'routine'
+export type McuScopeCode = 'cp-lab' | 'mic-lab' | 'ap-lab' | 'rad'
+export type SoapiTypeCode = 'early-medic' | 'early-rehab' | 'function' | 'progress' | 'dev-record' | 'kfr-adm' | 'kfr-series'
+export type MedicalActionTypeCode = 'chemo' | 'hemo' | 'thalasemia' | 'echocardio' | 'spirometry'
+export type VehicleTypeCode = 'ambulance' | 'transport' | 'hearse'
+export type GeneralEduCode = 'right-obg' | 'general-consent' | 'service' | 'alt-care-src' | 'home-plan' | 'home-care' | 'orientation' | 'fall-risk-prevention' | 'alt-care' | 'act-delay' | 'others'
+export type SpecialEduCode = 'disease-diag-dev' | 'safe-med-usage' | 'side-effect' | 'diet' | 'pain-mgmt' | 'medical-eq-usage' | 'rehab-technique' | 'prevention-act'
+export type EduAssessmentCode = 'learn-ability' | 'learn-will' | 'obstacle' | 'learn-method' | 'lang' | 'lang-obstacle' | 'belief'
+export type AbilityCode = 'able' | 'not-able'
+export type WillCode = 'ready' | 'interested' | 'not-interested'
+export type MedObstacleCode = 'hearing' | 'sight' | 'physical' | 'emotional' | 'cognitif'
+export type LearnMethodCode = 'demo' | 'discuss-leaflet'
+export type LangClassCode = 'ind' | 'region' | 'foreign'
+export type TranslatorSrcCode = 'team' | 'family'
+
+export const subjectCodes: Record = {
+ detail: 'Detail',
+ 'pri-complain': 'Keluhan Utama',
+ 'sec-complain': 'Secondary Complaint',
+ 'cur-disea-hist': 'Current Disease History',
+ 'pas-disea-hist': 'Past Disease History',
+ 'fam-disea-hist': 'Family Disease History',
+ 'alg-hist': 'Allergic Hist',
+ 'alg-react': 'Allergic Reaction',
+ 'med-hist': 'Medication Hist',
+ 'blood-type': 'Golongan Darah',
+}
+
+export const objectCodes: Record = {
+ detail: 'Detail',
+ 'consc-level': 'Tingkat Kesadaran',
+ 'consc-level-det': 'Detail Tingkat Kesadaran',
+ 'syst-bp': 'Tekanan Darah Systolic',
+ 'diast-bp': 'Tekanan Darah Diastolic',
+ 'pulse': 'Nadi',
+ 'resp-rate': 'Pernafasan',
+ 'hear-rt': 'Detak Jantung',
+ 'neuro-cranialis': 'Neurologist Cranialist',
+ 'sensoris': 'Sensoris',
+ 'reflect-fisio': 'Refleks Fisiologi',
+ 'reflect-pato': 'Refleks Patologi',
+ 'autonom-neuron': 'Saraf Otonom',
+ 'neck-rom': 'ROM - Leher',
+ 'body-rom': 'ROM - Batang Tubuh',
+ 'aga-rom': 'ROM - AGA',
+ 'agb-rom': 'ROM - AGB',
+ 'neck-mmt': 'MMT - Leher',
+ 'body-mmt': 'MMT - Batang Tubuh',
+ 'aga-mmt': 'MMT - AGA',
+ 'agb-mmt': 'MMT - AGB',
+ 'localis': 'Status Lokalis',
+ 'medical-trouble': 'Masalah Medis',
+ 'rehab-medic-trouble': 'Masalah Rehab Medik',
+ 'temp': 'Suhu',
+ 'spo2': 'SpO2',
+ 'weight': 'Berat Badan',
+ 'height': 'Tinggi Badan',
+ 'head-to-toe': 'Kepala Sampai Kaki',
+}
+
+export const assessmentCodes: Record = {
+ detail: 'Detail',
+ 'early-med-diag': 'Diagnosis Medis Awal',
+ 'late-med-diag': 'Diagnosis Medis Akhir',
+ 'sec-med-diag': 'Diagnosis Medis Sekunder',
+ 'early-func-diag': 'Diagnosis Fungsi Awal',
+ 'late-func-diag': 'Diagnosis Fungsi Akhir',
+ 'sec-func-diag': 'Diagnosis Fungsi Sekunder',
+ 'patient-dev': 'Catatan Perkembangan Patient',
+}
+
+export const planCodes: Record = {
+ detail: 'Detail',
+ 'plan': 'Rencana',
+}
+
+export const instructionCodes: Record = {
+ detail: 'Detail Instruksi',
+ 'medical-act': 'Tindakan medis',
+ 'supporting-exam': 'Pemeriksaan Penunjang',
+ 'therapy': 'Terapi',
+ 'medication': 'Obat',
+ 'material': 'BMHP',
+ 'rehab-program': 'Program Rehab',
+ 'physic-modal': 'Modalitas Fisik',
+ 'exercise': 'Latihan',
+ 'ortes-protesa': 'Ortesa Protesa',
+ 'education': 'Edukasi',
+ 'other': 'Lain-lain',
+}
+
+export const headToToeCodes: Record = {
+ head: 'Kepala',
+ eye: 'Mata',
+ ear: 'Telinga',
+ nose: 'Hidung',
+ 'mouth-throat': 'Mulut - Tenggorokan',
+ 'head-others': 'Kepala - Lainnya',
+ thorax: 'Toraks',
+ heart: 'Jantung',
+ lung: 'Paru',
+ abdomen: 'Perut',
+ liver: 'Hati',
+ back: 'Punggung',
+ ekstremitas: 'Ekstermitas',
+ gender: 'Kelamin',
+ rectum: 'Dubur',
+ neuron: 'Syaraf',
+ 'body-others': 'Badan - Lainnya',
+}
+
+export const mcuUrgencyLevelCodes: Record = {
+ cito: 'CITO',
+ 'cito-igd': 'CITO IGD',
+ ponek: 'PONEK',
+ 'blood-gas': 'Analisa Gas Darah',
+ 'priority-form': 'Form Prioritas',
+ routine: 'Pemeriksaan Rutin',
+}
+
+export const mcuScopeCodes: Record = {
+ 'cp-lab': 'Laboratorium',
+ 'mic-lab': 'Microbacterial Laboratorium',
+ 'ap-lab': 'Patology Anatomy Laboratorium',
+ rad: 'Radiology',
+}
+
+export const soapiTypeCodes: Record = {
+ 'early-medic': 'Kajian Awal Medis',
+ 'early-rehab': 'Kajian Awal Rehab Medik',
+ 'function': 'Assessmen Fungsi',
+ 'progress': 'CPPT',
+ 'dev-record': 'Catatan Perkembangan',
+ 'kfr-adm': 'Soapi Untuk KFR',
+ 'kfr-series': 'Soapi Untuk KFR',
+}
+
+export const medicalActionTypeCodes: Record = {
+ chemo: 'Kemoterapi',
+ hemo: 'Hemofilia',
+ thalasemia: 'Talasemi',
+ echocardio: 'Echokardio',
+ spirometry: 'Spirometri',
+}
+
+export const vehicleTypeCodes: Record = {
+ ambulance: 'Ambulans',
+ transport: 'Transport',
+ hearse: 'Jenazah',
+}
+
+export const generalEduCodes: Record = {
+ 'right-obg': 'Hak dan kewajiban pasien dan keluarga',
+ 'general-consent': 'General Consent',
+ 'service': 'Pelayanan yang disediakan (jam pelayanan, akses pelayanan dan proses pelayanan)',
+ 'alt-care-src': 'Sumber alternatif asuhan di tempat lain/faskes lain',
+ 'home-plan': 'Rencana tindakan di rumah',
+ 'home-care': 'Kebutuhan perawatan di rumah',
+ 'orientation': 'Orientasi ruangan',
+ 'fall-risk-prevention': 'Pencegahan risiko jatuh',
+ 'alt-care': 'Alternatif pelayanan',
+ 'act-delay': 'Penundaan Tindakan',
+ 'others': 'Lain - lain',
+}
+
+export const specialEduCodes: Record = {
+ 'disease-diag-dev': 'Diagnosa penyakit dan perkembangannya',
+ 'safe-med-usage': 'Penggunaan obat yang aman,',
+ 'side-effect': 'efek samping dan reaksi obat',
+ 'diet': 'Diet/Nutrisi',
+ 'pain-mgmt': 'Managemen nyeri',
+ 'medical-eq-usage': 'Penggunaan Peralatan Medis',
+ 'rehab-technique': 'Tehnik Rehabilitasi',
+ 'prevention-act': 'Tindakan pencegahan (cuci tangan, pemasangan gelang)',
+}
+
+export const eduAssessmentCodes: Record = {
+ 'learn-ability': 'Kemampuan Belajar',
+ 'learn-will': 'Kemauan Belajar',
+ 'obstacle': 'Hambatan',
+ 'learn-method': 'Metode Pembelajaran',
+ 'lang': 'Bahasa',
+ 'lang-obstacle': 'Hambatan Bahasa',
+ 'belief': 'Keyakinan',
+}
+
+export const abilityCodes: Record = {
+ able: 'Mampu',
+ 'not-able': 'Tidak Mampu',
+}
+
+export const willCodes: Record = {
+ ready: 'Siap',
+ interested: 'Tertarik',
+ 'not-interested': 'Tidak Tertarik',
+}
+
+export const medObstacleCodes: Record = {
+ hearing: 'Pendengaran',
+ sight: 'Penglihatan',
+ physical: 'Fisik',
+ emotional: 'Emosional',
+ cognitif: 'Kognitif',
+}
+
+export const learnMethodCodes: Record = {
+ demo: 'Demonstrasi',
+ 'discuss-leaflet': 'Diskusi Leaflet',
+}
+
+export const langClassCodes: Record = {
+ ind: 'Indonesia',
+ region: 'Daerah',
+ foreign: 'Asing',
+}
+
+export const translatorSrcCodes: Record = {
+ team: 'Tim Penerjemah',
+ family: 'Keluarga',
+}
diff --git a/app/lib/common-const.ts b/app/lib/common-const.ts
new file mode 100644
index 00000000..81e0f1ae
--- /dev/null
+++ b/app/lib/common-const.ts
@@ -0,0 +1,84 @@
+export type ActiveStatusCode = 'active' | 'inactive'
+export type DataStatusCode = 'new' | 'review' | 'process' | 'done' | 'canceled' | 'rejected' | 'skipped'
+export type DataApprovalCode = 'new' | 'approved' | 'rejected'
+export type DataAvailabilityCode = 'review' | 'available' | 'unavailble'
+export type DataVerifiedCode = 'new' | 'verified' | 'rejected'
+export type UserStatusCode = 'new' | 'active' | 'inactive' | 'blocked' | 'suspended'
+export type ProcessStatusCode = 'success' | 'failed'
+export type TimeUnitCode = 'sec' | 'min' | 'hour' | 'day' | 'week' | 'month' | 'year'
+export type DayCode = '0' | '1' | '2' | '3' | '4' | '5' | '6'
+export type PaymentMethodCode = 'cash' | 'debit' | 'credit' | 'insurance' | 'membership'
+
+export const activeStatusCodes: Record = {
+ active: 'Aktif',
+ inactive: 'Tidak Aktif',
+}
+
+export const dataStatusCodes: Record = {
+ new: 'Baru',
+ review: 'Review',
+ process: 'Proses',
+ done: 'Selesai',
+ canceled: 'Dibatalkan',
+ rejected: 'Ditolak',
+ skipped: 'Dilewati',
+}
+
+export const dataApprovalCodes: Record = {
+ new: 'Baru',
+ approved: 'Diterima',
+ rejected: 'Ditolak',
+}
+
+export const dataAvailabilityCodes: Record = {
+ review: 'Konfirmasi',
+ available: 'Tersedia',
+ unavailble: 'Tidak Tersedia',
+}
+
+export const dataVerifiedCodes: Record = {
+ new: 'Baru',
+ verified: 'Terverifikasi',
+ rejected: 'Ditolak',
+}
+
+export const userStatusCodes: Record = {
+ new: 'Baru',
+ active: 'Aktif',
+ inactive: 'Tidak Aktif',
+ blocked: 'Diblokir',
+ suspended: 'Dibekukan',
+}
+
+export const processStatusCodes: Record = {
+ success: 'Sukses',
+ failed: 'Gagal',
+}
+
+export const timeUnitCodes: Record = {
+ sec: 'Detik',
+ min: 'Menit',
+ hour: 'Jam',
+ day: 'Hari',
+ week: 'Minggu',
+ month: 'Bulan',
+ year: 'Tahun',
+}
+
+export const dayCodes: Record = {
+ '0': 'Minggu',
+ '1': '',
+ '2': '',
+ '3': '',
+ '4': '',
+ '5': '',
+ '6': 'Sabtu',
+}
+
+export const paymentMethodCodes: Record = {
+ cash: 'Cash',
+ debit: 'Debit',
+ credit: 'Kredit',
+ insurance: 'Asuransi',
+ membership: 'Membership',
+}
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/encounter-const.ts b/app/lib/encounter-const.ts
new file mode 100644
index 00000000..edd8ea29
--- /dev/null
+++ b/app/lib/encounter-const.ts
@@ -0,0 +1,141 @@
+export type QueueStatusCode = 'wait' | 'proc' | 'done' | 'cancel' | 'skip'
+export type EncounterClassCode = 'ambulatory' | 'emergency' | 'inpatient'
+export type DischargeMethodCode = 'home' | 'home-request' | 'consul-back' | 'consul-poly' | 'consul-executive' | 'consul-ch-day' | 'emergency' | 'emergency-covid' | 'inpatient' | 'external' | 'death' | 'death-on-arrival' | 'run-away'
+export type PolySwitchCode = 'consul-poly' | 'consul-executive'
+export type RefTypeCode = 'none' | 'gov' | 'private' | 'bpjs'
+export type TransportationCode = 'ambulance' | 'car' | 'motor-cycle' | 'other'
+export type PersonConditionCode = 'res' | 'emg' | 'urg' | 'lurg' | 'nurg' | 'doa'
+export type AmbulatoryClassCode = 'reg' | 'rehab' | 'chemo'
+export type EmergencyClassCode = 'emg' | 'eon'
+export type InpatientClassCode = 'op' | 'icu' | 'hcu' | 'vk'
+export type ChemoClassCode = 'adm' | 'act'
+export type AmbulanceFacilityCode = 'std' | 'icu'
+export type AmbulanceNeedsCode = 'assist' | 'non-assist'
+export type DocTypeCode = 'person-resident-number' | 'person-driving-license' | 'person-passport' | 'person-family-card' | 'encounter-patient' | 'encounter-suport' | 'encounter-other' | 'mcu-item-result' | 'vclaim-sep' | 'vclaim-sipp' | 'general-consent'
+export type AltPaymentMethodCode = 'jkn' | 'jkmm' | 'spm' | 'pks' | 'umum'
+export type SEPRefTypCode = 'internal' | 'external'
+export type VisitModeCode = 'adm' | 'readm' | 'series'
+
+export const queueStatusCodes: Record = {
+ wait: 'Tunggu',
+ proc: 'Proses',
+ done: 'Selesai',
+ cancel: 'Batal',
+ skip: 'Dilewati',
+}
+
+export const encounterClassCodes: Record = {
+ ambulatory: 'Rawat Jalan',
+ emergency: 'Gawat Darurat',
+ inpatient: 'Rawat Inap',
+}
+
+export const dischageMethodCodes: Record = {
+ home: 'Pulang',
+ 'home-request': 'Pulang Atas Permintaan Sendiri',
+ 'consul-back': 'Konsultasi Balik / Lanjutan',
+ 'consul-poly': 'Konsultasi Poliklinik Lain',
+ 'consul-executive': 'Konsultasi Antar Dokter Eksekutif',
+ 'consul-ch-day': 'Konsultasi Hari Lain',
+ emergency: 'Rujuk IGD',
+ 'emergency-covid': 'Rujuk IGD Covid',
+ inpatient: 'Rujuk Rawat Inap',
+ external: 'Rujuk Faskes Lain',
+ death: 'Meninggal',
+ 'death-on-arrival': 'Meninggal Saat Tiba',
+ 'run-away': 'Kabur / Lari',
+}
+
+export const polySwitchCode: Record = {
+ 'consul-poly': 'Konsultasi Poliklinik Lain',
+ 'consul-executive': 'Konsultasi Antar Dokter Eksekutif',
+}
+
+export const refTypeCode: Record = {
+ none: 'Tidak Ada',
+ gov: 'Pemerintah',
+ private: 'Swasta',
+ bpjs: 'BPJS',
+}
+
+export const transportationCode: Record = {
+ ambulance: 'Ambulans',
+ car: 'Mobil',
+ 'motor-cycle': 'Motor',
+ other: 'Lainnya',
+}
+
+export const personConditionCode: Record = {
+ res: 'Resutiasi',
+ emg: 'Darurat',
+ urg: 'Mendesak',
+ lurg: 'Kurang Mendesak',
+ nurg: 'Mendesak',
+ doa: 'Meninggal Saat Tiba',
+}
+
+export const ambulatoryClassCode: Record = {
+ reg: 'Reguler',
+ rehab: 'Rehab Medik',
+ chemo: 'Kemoterapi',
+}
+
+export const emergencyClassCode: Record = {
+ emg: 'Darurat',
+ eon: 'Ponek',
+}
+
+export const inpatientClassCode: Record = {
+ op: 'Rawat Inap',
+ icu: 'ICU',
+ hcu: 'HCU',
+ vk: 'Kamar Bersalin',
+}
+
+export const chemoClassCode: Record = {
+ adm: 'Administrasi',
+ act: 'Tindakan',
+}
+
+export const ambulanceFacilityCode: Record = {
+ std: 'Standar',
+ icu: 'ICU',
+}
+
+export const ambulanceNeedsCode: Record = {
+ assist: 'Dengan Pendampingan',
+ 'non-assist': 'Tanpa Pendampingan',
+}
+
+export const docTypeCode: Record = {
+ 'person-resident-number': '',
+ 'person-driving-license': '',
+ 'person-passport': '',
+ 'person-family-card': '',
+ 'encounter-patient': '',
+ 'encounter-suport': '',
+ 'encounter-other': '',
+ 'mcu-item-result': '',
+ 'vclaim-sep': '',
+ 'vclaim-sipp': '',
+ 'general-consent': '',
+}
+
+export const altPaymentMethodCode: Record = {
+ jkn: 'JKN',
+ jkmm: 'JKMM',
+ spm: 'SPM',
+ pks: 'PKS',
+ umum: 'Umum',
+}
+
+export const sepRefTypCode: Record = {
+ internal: 'Rujukan Internal',
+ external: 'Faskes Lain',
+}
+
+export const visitModeCode: Record = {
+ adm: 'Administrasi',
+ readm: 'Administrasi',
+ series: 'Tindakan',
+}
diff --git a/app/lib/org-const.ts b/app/lib/org-const.ts
new file mode 100644
index 00000000..49f16e68
--- /dev/null
+++ b/app/lib/org-const.ts
@@ -0,0 +1,69 @@
+export type InfragroupCode = 'building' | 'floor' | 'warehouse' | 'room' | 'chamber' | 'bed' | 'counter' | 'public-screen'
+export type ItemGroupCode = 'infra' | 'medicine' | 'device' | 'material' | 'employee-fee' | 'doctor-fee'
+export type UnitTypeCode = 'reg' | 'exa' | 'pay' | 'pha' | 'lab' | 'rad'
+export type ContractStatusCode = 'system' | 'employee' | 'intern' | 'other'
+export type EmployeePositionCode = 'reg' | 'nur' | 'doc' | 'miw' | 'thr' | 'nut' | 'lab' | 'pha' | 'nom'
+export type InternPositionCode = 'specialist' | 'nurse' | 'non-medic'
+export type DoctorFeeTypeCodes = 'outpatient' | 'emergency' | 'inpatient' | 'medic-rehab'
+
+export const infragroupCodes: Record = {
+ building: 'Bangunan',
+ floor: 'Lantai',
+ warehouse: 'Gudang / Depo',
+ room: 'Ruang',
+ chamber: 'Kamar',
+ bed: 'Ranjang',
+ counter: 'Counter',
+ 'public-screen': 'Public Screen',
+}
+
+export const itemGroupCodes: Record = {
+ infra: 'Infrastruktur',
+ medicine: 'Obat',
+ device: 'Peralatan',
+ material: 'Perlengkapan',
+ 'employee-fee': 'Gaji Karyawan',
+ 'doctor-fee': 'Gaji Dokter',
+}
+
+export const unitTypeCodes: Record = {
+ reg: 'Registrasi',
+ exa: 'Pemeriksaan',
+ pay: 'Pembayaran',
+ pha: 'Farmasai',
+ lab: 'Laboratorium',
+ rad: 'Radiologi',
+}
+
+export const contractStatusCodes: Record = {
+ system: 'Sistem',
+ employee: 'Pegawai',
+ intern: 'Magang',
+ other: 'Lainnya',
+}
+
+export const employeePositionCodes: Record = {
+ reg: 'Admisi / Pendaftaran',
+ nur: 'Perawat',
+ doc: 'Dokter',
+ miw: 'Bidan',
+ thr: 'Terapis',
+ nut: 'Ahli Gisi',
+ lab: 'Laboran',
+ pha: 'Farmasi',
+ nom: 'Non Medis',
+}
+
+export const internPositionCodes: Record = {
+ specialist: 'PPDS',
+ nurse: 'Perawat',
+ 'non-medic': 'Non Medis',
+}
+
+export const doctorFeeTypeCodes: Record = {
+ outpatient: 'Rawat Jalan',
+ emergency: 'Darurat',
+ inpatient: 'Rawat Inap',
+ 'medic-rehab': 'Rehab Medik',
+}
+
diff --git a/app/lib/person-const.ts b/app/lib/person-const.ts
new file mode 100644
index 00000000..f4f18fdb
--- /dev/null
+++ b/app/lib/person-const.ts
@@ -0,0 +1,80 @@
+export type GenderCode = 'male' | 'female' | 'not-stated' | 'unknown'
+export type ReligionCode = 'islam' | 'protestan' | 'katolik' | 'hindu' | 'buda' | 'konghucu'
+export type EducationCode = 'TS' | 'TK' | 'SD' | 'SMP' | 'SMA' | 'D1' | 'D2' | 'D3' | 'S1' | 'S2' | 'S3'
+export type OccupationCode = 'tidak-bekerja' | 'pns' | 'polisi' | 'tni' | 'guru' | 'wiraswasta' | 'kary-swasta' | 'lainnya'
+export type AddressLocationTypeCode = 'identity' | 'domicile'
+export type PersonContactType = 'phone' | 'm-phone' | 'email' | 'fax'
+export type RelationshipCode = 'mother' | 'father' | 'uncle' | 'aunt' | 'sibling' | 'gd-mother' | 'gd-father' | 'child' | 'nephew' | 'gd-child' | 'friend' | 'spouse' | 'self' | 'other'
+export type MaritalStatus_Code = 'S' | 'M' | 'D' | 'W'
+
+export const genderCodes: Record = {
+ male: 'Laki',
+ female: 'Perempuan',
+ 'not-stated': 'Tidak Disebutkan',
+ unknown: 'Tidak Diketahui',
+}
+
+export const religionCodes: Record = {
+ islam: 'Islam',
+ protestan: 'Protestan',
+ katolik: 'Katolik',
+ hindu: 'Hindu',
+ buda: 'Buda',
+ konghucu: 'Konghucu',
+}
+
+export const educationCodes: Record = {
+ TS: 'TS',
+ TK: 'TK',
+ SD: 'SD',
+ SMP: 'SMP',
+ SMA: 'SMA',
+ D1: 'D1',
+ D2: 'D2',
+ D3: 'D3',
+ S1: 'S1',
+ S2: 'S2',
+ S3: 'S3',
+}
+
+export const occupationCodes: Record = {
+ 'tidak-bekerja': 'Tidak Bekerja',
+ pns: 'Pegawai Negeri Sipil',
+ polisi: 'Polisi',
+ tni: 'TNI',
+ guru: 'Guru',
+ wiraswasta: 'Wiraswasta',
+ 'kary-swasta': 'Karyawan Swasta',
+ lainnya: 'Lainnya',
+}
+
+export const personContactTypes: Record = {
+ phone: 'Telepon',
+ 'm-phone': 'HP / Ponsel',
+ email: 'Email',
+ fax: 'Fax',
+}
+
+export const relationshipCodes: Record = {
+ mother: 'Ibu',
+ father: 'Ayah',
+ uncle: 'Paman',
+ aunt: 'Bibi',
+ sibling: 'Saudara',
+ 'gd-mother': 'Nenek',
+ 'gd-father': 'Kakek',
+ child: 'Anak',
+ nephew: 'Keponakan',
+ 'gd-child': 'Cucu',
+ friend: 'Teman',
+ spouse: 'Pasangan (Suami / Istri)',
+ self: 'Diri sendiri',
+ other: 'Lainnya',
+}
+
+export const maritalStatusCodes: Record = {
+ S: 'Single (Belum Kawin)',
+ M: 'Married (Kawin)',
+ D: 'Divorced (Cerai Hidup)',
+ W: 'Widowed (Cerai Mati)',
+}
diff --git a/app/lib/utils.ts b/app/lib/utils.ts
index 357d8700..67f3d04b 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',
+ })
+}
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 884340c5..cbb682ad 100644
--- a/app/models/device-order.ts
+++ b/app/models/device-order.ts
@@ -1,15 +1,21 @@
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[]
}
export function genDeviceOrder(): DeviceOrder {
return {
...genBase(),
encounter_id: 0,
- doctor_id: 0,
+ doctor_code: 0,
+ doctor: genDoctor(),
+ items: []
}
}
diff --git a/app/models/division-position.ts b/app/models/division-position.ts
index dc263ada..ebd7bfa9 100644
--- a/app/models/division-position.ts
+++ b/app/models/division-position.ts
@@ -4,7 +4,7 @@ export interface DivisionPosition extends Base {
code: string
name: string
headStatus?: boolean
- division_id: number
+ division_id: string
employee_id?: number
employee?: Employee | null
@@ -16,7 +16,7 @@ export function genDivisionPosition(): DivisionPosition {
code: '',
name: '',
headStatus: false,
- division_id: 0,
+ division_id: '',
employee_id: 0,
}
}
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/models/general-consent.ts b/app/models/general-consent.ts
new file mode 100644
index 00000000..fe3ac97a
--- /dev/null
+++ b/app/models/general-consent.ts
@@ -0,0 +1,49 @@
+export interface GeneralConsent {
+ id: number
+ encounter_id: number
+ value: string
+}
+
+export interface ValueCreateDto {
+ relatives: string[]
+ responsibleName: string
+ responsiblePhone: string
+ informant: string
+ witness1: string
+ witness2: string
+}
+
+export interface CreateDto {
+ encounter_id: number
+ value: string
+}
+
+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/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/models/medicine.ts b/app/models/medicine.ts
index d3a04752..5aa01da4 100644
--- a/app/models/medicine.ts
+++ b/app/models/medicine.ts
@@ -1,10 +1,17 @@
+import type { MedicineFormData } from "~/schemas/medicine.schema"
import { type Base, genBase } from "./_base"
+import type { MedicineGroup } from "./medicine-group"
+import type { MedicineMethod } from "./medicine-method"
export interface Medicine extends Base {
code: string
name: string
- medicineGroup_code: string
- medicineMethod_code: string
+ medicineGroup_code?: string
+ medicineGroup?: MedicineGroup
+ medicineMethod_code?: string
+ medicineMethod?: MedicineMethod
+ medicineForm_code?: string
+ medicineForm?: MedicineFormData
uom_code: string
infra_id?: string | null
stock: number
diff --git a/app/models/medicinemix-item.ts b/app/models/medicinemix-item.ts
index d2e1f973..9c055294 100644
--- a/app/models/medicinemix-item.ts
+++ b/app/models/medicinemix-item.ts
@@ -1,7 +1,7 @@
import { type Base, genBase } from "./_base"
import { type Medicine, genMedicine } from "./medicine";
-interface MedicinemixItem extends Base {
+export interface MedicinemixItem extends Base {
id: number
medicineMix_id: number
medicine_id: number
@@ -35,7 +35,7 @@ export interface DeleteDto {
id: number
}
-export function MedicinemixItem(): MedicinemixItem {
+export function genMedicinemixItem(): MedicinemixItem {
return {
...genBase(),
medicineMix_id: 0,
diff --git a/app/models/prescription-item.ts b/app/models/prescription-item.ts
index 6f0d3716..3349fcbf 100644
--- a/app/models/prescription-item.ts
+++ b/app/models/prescription-item.ts
@@ -5,10 +5,10 @@ export interface PrescriptionItem {
id: number;
prescription_id: number;
isMix: boolean;
- medicine_id: number;
- medicine: Medicine;
- medicineMix_id: number;
- medicineMix: Medicinemix
+ medicine_code?: string;
+ medicine?: Medicine;
+ medicineMix_id?: number;
+ medicineMix?: Medicinemix
frequency: number;
dose: number;
interval: number;
@@ -29,35 +29,35 @@ export interface CreateDto {
quantity: number;
usage: 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 genPresciptionItem(): PrescriptionItem {
+
+export function genPrescriptionItem(): PrescriptionItem {
return {
id: 0,
prescription_id: 0,
isMix: false,
- medicine_id: 0,
- medicine: genMedicine(),
- medicineMix_id: 0,
- medicineMix: genMedicinemix(),
+ // medicine_code: '',
+ // medicine: genMedicine(),
+ // medicineMix_id: 0,
+ // medicineMix: genMedicinemix(),
frequency: 0,
dose: 0,
interval: 0,
@@ -66,4 +66,3 @@ export function genPresciptionItem(): PrescriptionItem {
usage: ''
}
}
-
\ No newline at end of file
diff --git a/app/models/specialist-position.ts b/app/models/specialist-position.ts
index 727e8374..040e1dd5 100644
--- a/app/models/specialist-position.ts
+++ b/app/models/specialist-position.ts
@@ -2,7 +2,7 @@ import { type Base, genBase } from './_base'
import type { Employee } from './employee'
export interface SpecialistPosition extends Base {
- specialist_id: number
+ specialist_id: string
code: string
name: string
headStatus?: boolean
@@ -13,7 +13,7 @@ export interface SpecialistPosition extends Base {
export function genSpecialistPosition(): SpecialistPosition {
return {
...genBase(),
- specialist_id: 0,
+ specialist_id: '',
code: '',
name: '',
headStatus: false,
diff --git a/app/models/specialist.ts b/app/models/specialist.ts
index d3180a73..2ce742d3 100644
--- a/app/models/specialist.ts
+++ b/app/models/specialist.ts
@@ -14,6 +14,6 @@ export function genSpecialist(): Specialist {
...genBase(),
code: '',
name: '',
- unit_id: 0,
+ unit_id: '',
}
}
diff --git a/app/models/subspecialist-position.ts b/app/models/subspecialist-position.ts
index 28ea2287..945780d2 100644
--- a/app/models/subspecialist-position.ts
+++ b/app/models/subspecialist-position.ts
@@ -3,7 +3,7 @@ import type { Employee } from './employee'
import type { Subspecialist } from './subspecialist'
export interface SubSpecialistPosition extends Base {
- subspecialist_id: number
+ subspecialist_id: string
code: string
name: string
headStatus?: boolean
@@ -16,7 +16,7 @@ export interface SubSpecialistPosition extends Base {
export function genSubSpecialistPosition(): SubSpecialistPosition {
return {
...genBase(),
- subspecialist_id: 0,
+ subspecialist_id: '',
code: '',
name: '',
headStatus: false,
diff --git a/app/models/unit-position.ts b/app/models/unit-position.ts
index 11e97806..3e1dc426 100644
--- a/app/models/unit-position.ts
+++ b/app/models/unit-position.ts
@@ -2,7 +2,7 @@ import { type Base, genBase } from './_base'
import type { Employee } from './employee'
export interface UnitPosition extends Base {
- unit_id: number
+ unit_id: string
code: string
name: string
headStatus?: boolean
@@ -14,7 +14,7 @@ export interface UnitPosition extends Base {
export function genUnitPosition(): UnitPosition {
return {
...genBase(),
- unit_id: 0,
+ unit_id: '',
code: '',
name: '',
headStatus: false,
diff --git a/app/pages/(features)/org-src/division/[id]/index.vue b/app/pages/(features)/org-src/division/[id]/index.vue
index 658652d9..238d90e0 100644
--- a/app/pages/(features)/org-src/division/[id]/index.vue
+++ b/app/pages/(features)/org-src/division/[id]/index.vue
@@ -33,7 +33,7 @@ const canRead = true
-
+
-
+
-
+
-
+
-
+
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)/rehab/encounter/[id]/document-upload/[document_id]/edit.vue b/app/pages/(features)/rehab/encounter/[id]/document-upload/[document_id]/edit.vue
new file mode 100644
index 00000000..1cf5cc7c
--- /dev/null
+++ b/app/pages/(features)/rehab/encounter/[id]/document-upload/[document_id]/edit.vue
@@ -0,0 +1,41 @@
+
+
+
+
+
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..e04220f3
--- /dev/null
+++ b/app/pages/(features)/rehab/encounter/[id]/document-upload/add.vue
@@ -0,0 +1,42 @@
+
+
+
+
+
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/pages/(features)/rehab/encounter/index.vue b/app/pages/(features)/rehab/encounter/index.vue
index f50ad954..1dd93aa0 100644
--- a/app/pages/(features)/rehab/encounter/index.vue
+++ b/app/pages/(features)/rehab/encounter/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)/resume/add.vue b/app/pages/(features)/resume/add.vue
new file mode 100644
index 00000000..7cc707f9
--- /dev/null
+++ b/app/pages/(features)/resume/add.vue
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
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/_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/division-position.schema.ts b/app/schemas/division-position.schema.ts
index 65906f61..dca75129 100644
--- a/app/schemas/division-position.schema.ts
+++ b/app/schemas/division-position.schema.ts
@@ -5,7 +5,7 @@ const DivisionPositionSchema = z.object({
code: z.string({ required_error: 'Kode harus diisi' }).min(1, 'Kode minimum 1 karakter'),
name: z.string({ required_error: 'Nama harus diisi' }).min(1, 'Nama minimum 1 karakter'),
headStatus: z.boolean().optional().nullable(),
- division_id: z.union([
+ division_code: z.union([
z.string({ required_error: 'Divisi Induk harus diisi' }),
z.number({ required_error: 'Divisi Induk harus diisi' })
]).optional().nullable(),
diff --git a/app/schemas/division.schema.ts b/app/schemas/division.schema.ts
index fae5afca..f8fcab6e 100644
--- a/app/schemas/division.schema.ts
+++ b/app/schemas/division.schema.ts
@@ -4,7 +4,7 @@ import type { Division } from '~/models/division'
const DivisionSchema = z.object({
code: z.string({ required_error: 'Kode harus diisi' }).min(1, 'Kode minimum 1 karakter'),
name: z.string({ required_error: 'Nama harus diisi' }).min(1, 'Nama minimum 1 karakter'),
- parent_id: z.union([
+ parent_code: z.union([
z.string({ required_error: 'Divisi Induk harus diisi' }),
z.number({ required_error: 'Divisi Induk harus diisi' })
]).optional().nullable(),
diff --git a/app/schemas/document-upload.schema.ts b/app/schemas/document-upload.schema.ts
new file mode 100644
index 00000000..305ec16c
--- /dev/null
+++ b/app/schemas/document-upload.schema.ts
@@ -0,0 +1,25 @@
+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(),
+ // 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
+
+export { DocumentUploadSchema }
+export type { DocumentUploadFormData }
diff --git a/app/schemas/general-consent.schema.ts b/app/schemas/general-consent.schema.ts
new file mode 100644
index 00000000..e06c7240
--- /dev/null
+++ b/app/schemas/general-consent.schema.ts
@@ -0,0 +1,16 @@
+import { z } from 'zod'
+import type { CreateDto } from '~/models/general-consent'
+
+const GeneralConsentSchema = z.object({
+ 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(),
+})
+
+type GeneralConsentFormData = z.infer & CreateDto
+
+export { GeneralConsentSchema }
+export type { GeneralConsentFormData }
diff --git a/app/schemas/installation-position.schema.ts b/app/schemas/installation-position.schema.ts
index 5990fc6c..c869b361 100644
--- a/app/schemas/installation-position.schema.ts
+++ b/app/schemas/installation-position.schema.ts
@@ -5,7 +5,7 @@ const InstallationPositionSchema = z.object({
code: z.string({ required_error: 'Kode harus diisi' }).min(1, 'Kode minimum 1 karakter'),
name: z.string({ required_error: 'Nama harus diisi' }).min(1, 'Nama minimum 1 karakter'),
headStatus: z.boolean().optional().nullable(),
- installation_id: z.union([
+ installation_code: z.union([
z.string({ required_error: 'Instalasi Induk harus diisi' }),
z.number({ required_error: 'Instalasi Induk harus diisi' }),
]),
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/schemas/resume.schema.ts b/app/schemas/resume.schema.ts
new file mode 100644
index 00000000..3e466a33
--- /dev/null
+++ b/app/schemas/resume.schema.ts
@@ -0,0 +1,76 @@
+import { z } from 'zod'
+import type { CreateDto } from '~/models/consultation'
+
+export type ResumeArrangementType = "krs" | "mrs" | "rujukInternal" | "rujukExternal" | "meninggal" | "other"
+
+const SecondaryDiagnosisSchema = z.object({
+ diagnosis: z.string({ required_error: 'Diagnosis harus diisi' }),
+ icd10: z.string({ required_error: 'ICD 10 harus diisi' }),
+ diagnosisBasis: z.string({ required_error: 'Dasar Diagnosis harus diisi' })
+ .min(1, 'Uraian minimum 1 karakter')
+ .max(2048, 'Uraian maksimum 2048 karakter'),
+})
+
+const SecondaryActionSchema = z.object({
+ action: z.string({ required_error: 'Action harus diisi' }),
+ icd9: z.string({ required_error: 'ICD 10 harus diisi' }),
+ actionBasis: z.string({ required_error: 'Dasar Action harus diisi' })
+ .min(1, 'Uraian minimum 1 karakter')
+ .max(2048, 'Uraian maksimum 2048 karakter'),
+})
+
+const ConsultationSchema = z.object({
+ consultation: z.string({ required_error: 'Consultation harus diisi' })
+ .min(1, 'Uraian minimum 1 karakter')
+ .max(2048, 'Uraian maksimum 2048 karakter'),
+ consultationReply: z.string({ required_error: 'Jawaban Consultation harus diisi' })
+ .min(1, 'Uraian minimum 1 karakter')
+ .max(2048, 'Uraian maksimum 2048 karakter'),
+})
+
+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(SecondaryDiagnosisSchema).optional(),
+
+ primaryOperativeNonOperativeAct: z.string({ required_error: 'Diagnosis harus diisi' }),
+ secondaryOperativeNonOperativeAct: z.array(SecondaryActionSchema).optional(),
+ medikamentosa: z.string({ required_error: 'Uraian harus diisi' })
+ .min(1, 'Uraian minimum 1 karakter')
+ .max(2048, 'Uraian maksimum 2048 karakter'),
+
+ 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(),
+ 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')
+ .optional(),
+})
+
+type ResumeFormData = z.infer & (CreateDto)
+
+export { ResumeSchema }
+export type { ResumeFormData }
diff --git a/app/schemas/specialist-position.schema.ts b/app/schemas/specialist-position.schema.ts
index 7aacef37..3e8010bb 100644
--- a/app/schemas/specialist-position.schema.ts
+++ b/app/schemas/specialist-position.schema.ts
@@ -5,7 +5,7 @@ const SpecialistPositionSchema = z.object({
code: z.string({ required_error: 'Kode harus diisi' }).min(1, 'Kode minimum 1 karakter'),
name: z.string({ required_error: 'Nama harus diisi' }).min(1, 'Nama minimum 1 karakter'),
headStatus: z.boolean().optional().nullable(),
- specialist_id: z
+ specialist_code: z
.union([
z.string({ required_error: 'Spesialis harus diisi' }),
z.number({ required_error: 'Spesialis harus diisi' }),
diff --git a/app/schemas/specialist.schema.ts b/app/schemas/specialist.schema.ts
index 1c536bef..c9e39285 100644
--- a/app/schemas/specialist.schema.ts
+++ b/app/schemas/specialist.schema.ts
@@ -4,7 +4,7 @@ import type { Specialist } from '~/models/specialist'
const SpecialistSchema = z.object({
code: z.string({ required_error: 'Kode harus diisi' }).min(1, 'Kode minimum 1 karakter'),
name: z.string({ required_error: 'Nama harus diisi' }).min(1, 'Nama minimum 1 karakter'),
- unit_id: z
+ unit_code: z
.union([z.string({ required_error: 'Unit harus diisi' }), z.number({ required_error: 'Unit harus diisi' })])
.optional()
.nullable(),
diff --git a/app/schemas/subspecialist-position.schema.ts b/app/schemas/subspecialist-position.schema.ts
index 7f458e7b..d191ad9a 100644
--- a/app/schemas/subspecialist-position.schema.ts
+++ b/app/schemas/subspecialist-position.schema.ts
@@ -5,7 +5,7 @@ const SubSpecialistPositionSchema = z.object({
code: z.string({ required_error: 'Kode harus diisi' }).min(1, 'Kode minimum 1 karakter'),
name: z.string({ required_error: 'Nama harus diisi' }).min(1, 'Nama minimum 1 karakter'),
headStatus: z.boolean().optional().nullable(),
- subspecialist_id: z
+ subspecialist_code: z
.union([
z.string({ required_error: 'Spesialis harus diisi' }),
z.number({ required_error: 'Spesialis harus diisi' }),
diff --git a/app/schemas/subspecialist.schema.ts b/app/schemas/subspecialist.schema.ts
index e4b3ec77..a4a6c0b8 100644
--- a/app/schemas/subspecialist.schema.ts
+++ b/app/schemas/subspecialist.schema.ts
@@ -4,7 +4,7 @@ import type { Subspecialist } from '~/models/subspecialist'
const SubspecialistSchema = z.object({
code: z.string({ required_error: 'Kode harus diisi' }).min(1, 'Kode minimum 1 karakter'),
name: z.string({ required_error: 'Nama harus diisi' }).min(1, 'Nama minimum 1 karakter'),
- specialist_id: z
+ specialist_code: z
.union([
z.string({ required_error: 'Spesialis harus diisi' }),
z.number({ required_error: 'Spesialis harus diisi' }),
diff --git a/app/schemas/unit-position.schema.ts b/app/schemas/unit-position.schema.ts
index 2422b9a1..e170db10 100644
--- a/app/schemas/unit-position.schema.ts
+++ b/app/schemas/unit-position.schema.ts
@@ -5,7 +5,7 @@ const UnitPositionSchema = z.object({
code: z.string({ required_error: 'Kode harus diisi' }).min(1, 'Kode minimum 1 karakter'),
name: z.string({ required_error: 'Nama harus diisi' }).min(1, 'Nama minimum 1 karakter'),
headStatus: z.boolean().optional().nullable(),
- unit_id: z
+ unit_code: z
.union([
z.string({ required_error: 'Unit Induk harus diisi' }),
z.number({ required_error: 'Unit Induk harus diisi' }),
diff --git a/app/schemas/unit.schema.ts b/app/schemas/unit.schema.ts
index 83657224..75a19b39 100644
--- a/app/schemas/unit.schema.ts
+++ b/app/schemas/unit.schema.ts
@@ -4,7 +4,7 @@ import type { Unit } from '~/models/unit'
const UnitSchema = z.object({
code: z.string({ required_error: 'Kode harus diisi' }).min(1, 'Kode minimum 1 karakter'),
name: z.string({ required_error: 'Nama harus diisi' }).min(1, 'Nama minimum 1 karakter'),
- installation_id: z
+ installation_code: z
.union([
z.string({ required_error: 'Instalasi harus diisi' }),
z.number({ required_error: 'Instalasi harus diisi' }),
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)
}
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
diff --git a/app/services/division.service.ts b/app/services/division.service.ts
index e3285d34..21712599 100644
--- a/app/services/division.service.ts
+++ b/app/services/division.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: Division) => ({
- value: item.id ? Number(item.id) : item.code,
+ value: useCodeAsValue ? item.code
+ : item.id ? Number(item.id)
+ : item.code,
label: item.name,
}))
}
@@ -46,10 +48,12 @@ export async function getValueLabelList(params: any = null): Promise<{ value: st
* @param divisions Array of division objects from API
* @returns TreeItem[]
*/
-export function getValueTreeItems(divisions: any[]): TreeItem[] {
+export function getValueTreeItems(divisions: any[], byCode = true): TreeItem[] {
return divisions
.map((division: Division) => ({
- value: division.id ? String(division.id) : division.code,
+ value: byCode ? String(division.code)
+ : String(division.id) ? String(division.id)
+ : division.code,
label: division.name,
hasChildren: Array.isArray(division.childrens) && division.childrens.length > 0,
children:
diff --git a/app/services/general-consent.service.ts b/app/services/general-consent.service.ts
new file mode 100644
index 00000000..2a6611fc
--- /dev/null
+++ b/app/services/general-consent.service.ts
@@ -0,0 +1,23 @@
+import * as base from './_crud-base'
+
+const path = '/api/v1/general-consent'
+
+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)
+}
+
+export function update(id: number | string, data: any) {
+ return base.update(path, id, data)
+}
+
+export function remove(id: number | string) {
+ return base.remove(path, id)
+}
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)
+}
diff --git a/app/services/installation.service.ts b/app/services/installation.service.ts
index 1f1975f5..8cb3e266 100644
--- a/app/services/installation.service.ts
+++ b/app/services/installation.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: Installation) => ({
- value: item.id ? Number(item.id) : item.code,
+ value: useCodeAsValue ? item.code
+ : item.id ? Number(item.id)
+ : item.code,
label: item.name,
}))
}
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/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}`)
+ }
+}
diff --git a/app/services/specialist.service.ts b/app/services/specialist.service.ts
index d4c81b5c..7786fcc2 100644
--- a/app/services/specialist.service.ts
+++ b/app/services/specialist.service.ts
@@ -36,7 +36,7 @@ export async function getValueLabelList(params: any = null, useCodeAsValue = fal
data = resultData.map((item: Specialist) => ({
value: useCodeAsValue ? item.code
: item.id ? Number(item.id)
- : item.id,
+ : item.code,
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 f13c715f..9425067b 100644
--- a/app/services/subspecialist.service.ts
+++ b/app/services/subspecialist.service.ts
@@ -33,9 +33,9 @@ export async function getValueLabelList(params: any = null, useCodeAsValue = fal
if (result.success) {
const resultData = result.body?.data || []
data = resultData.map((item: Subspecialist) => ({
- value: useCodeAsValue ? item.code
+ value: useCodeAsValue ? item.code
: item.id ? Number(item.id)
- : item.id,
+ : item.code,
label: item.name,
parent: item.specialist_id ? Number(item.specialist_id) : null,
}))
diff --git a/app/services/supporting-document.service.ts b/app/services/supporting-document.service.ts
new file mode 100644
index 00000000..23f94820
--- /dev/null
+++ b/app/services/supporting-document.service.ts
@@ -0,0 +1,56 @@
+// Base
+import * as base from './_crud-base'
+
+// Constants
+import { uploadCode, type UploadCodeKey } from '~/lib/constants'
+
+const path = '/api/v1/encounter-document'
+const create_path = '/api/v1/upload-file'
+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')
+ }
+}
diff --git a/app/services/unit.service.ts b/app/services/unit.service.ts
index 402504b6..948ac6b6 100644
--- a/app/services/unit.service.ts
+++ b/app/services/unit.service.ts
@@ -35,7 +35,7 @@ export async function getValueLabelList(params: any = null, useCodeAsValue = fal
data = resultData.map((item: Unit) => ({
value: useCodeAsValue ? item.code
: item.id ? Number(item.id)
- : item.id,
+ : item.code,
label: item.name,
}))
}
diff --git a/public/side-menu-items/sys.json b/public/side-menu-items/sys.json
new file mode 100644
index 00000000..039066a4
--- /dev/null
+++ b/public/side-menu-items/sys.json
@@ -0,0 +1,372 @@
+[
+ {
+ "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": "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"
+ }
+ ]
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/public/side-menu-items/system.json b/public/side-menu-items/system.json
index 5bf62f36..e12f58ec 100644
--- a/public/side-menu-items/system.json
+++ b/public/side-menu-items/system.json
@@ -240,6 +240,10 @@
{
"title": "Jenis Obat",
"link": "/tools-equipment-src/medicine-type"
+ },
+ {
+ "title": "Sediaan Obat",
+ "link": "/tools-equipment-src/medicine-form"
}
]
},
@@ -385,4 +389,4 @@
}
]
}
-]
+]
\ No newline at end of file
|