diff --git a/app/components/app/icd/list-cfg.ts b/app/components/app/icd/list-cfg.ts
index c74ef59b..c413e737 100644
--- a/app/components/app/icd/list-cfg.ts
+++ b/app/components/app/icd/list-cfg.ts
@@ -1,11 +1,4 @@
-import type {
- Col,
- KeyLabel,
- RecComponent,
- RecStrFuncComponent,
- RecStrFuncUnknown,
- Th,
-} from '~/components/pub/my-ui/data/types'
+import type { Config, RecComponent } from '~/components/pub/my-ui/data-table'
import { defineAsyncComponent } from 'vue'
type SmallDetailDto = any
@@ -13,119 +6,122 @@ type SmallDetailDto = any
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dud.vue'))
const statusBadge = defineAsyncComponent(() => import('./status-badge.vue'))
-export const cols: Col[] = [
- {},
- {},
- {},
- { width: 100 },
- { width: 120 },
- {},
- {},
- {},
- { width: 100 },
- { width: 100 },
- {},
- { width: 50 },
-]
-
-export const header: Th[][] = [
- [
- { label: 'Nama' },
- { label: 'Rekam Medis' },
- { label: 'KTP' },
- { label: 'Tgl Lahir' },
- { label: 'Umur' },
- { label: 'JK' },
- { label: 'Pendidikan' },
- { label: 'Status' },
- { label: '' },
+export const config: Config = {
+ cols: [
+ {},
+ {},
+ {},
+ { width: 100 },
+ { width: 120 },
+ {},
+ {},
+ {},
+ { width: 100 },
+ { width: 100 },
+ {},
+ { width: 50 },
],
-]
-export const keys = [
- 'name',
- 'medicalRecord_number',
- 'identity_number',
- 'birth_date',
- 'patient_age',
- 'gender',
- 'education',
- 'status',
- 'action',
-]
+ headers: [
+ [
+ { label: 'Nama' },
+ { label: 'Rekam Medis' },
+ { label: 'KTP' },
+ { label: 'Tgl Lahir' },
+ { label: 'Umur' },
+ { label: 'JK' },
+ { label: 'Pendidikan' },
+ { label: 'Status' },
+ { label: '' },
+ ],
+ ],
-export const delKeyNames: KeyLabel[] = [
- { key: 'code', label: 'Kode' },
- { key: 'name', label: 'Nama' },
-]
+ keys: [
+ 'name',
+ 'medicalRecord_number',
+ 'identity_number',
+ 'birth_date',
+ 'patient_age',
+ 'gender',
+ 'education',
+ 'status',
+ 'action',
+ ],
-export const funcParsed: RecStrFuncUnknown = {
- name: (rec: unknown): unknown => {
- const recX = rec as SmallDetailDto
- return `${recX.firstName} ${recX.middleName || ''} ${recX.lastName || ''}`
+ delKeyNames: [
+ { key: 'code', label: 'Kode' },
+ { key: 'name', label: 'Nama' },
+ ],
+
+ parses: {
+ name: (rec: unknown): unknown => {
+ const recX = rec as SmallDetailDto
+ return `${recX.firstName} ${recX.middleName || ''} ${recX.lastName || ''}`
+ },
+ identity_number: (rec: unknown): unknown => {
+ const recX = rec as SmallDetailDto
+ if (recX.identity_number?.substring(0, 5) === 'BLANK') {
+ return '(TANPA NIK)'
+ }
+ return recX.identity_number
+ },
+ birth_date: (rec: unknown): unknown => {
+ const recX = rec as SmallDetailDto
+ if (typeof recX.birth_date == 'object' && recX.birth_date) {
+ return (recX.birth_date as Date).toLocaleDateString()
+ } else if (typeof recX.birth_date == 'string') {
+ return (recX.birth_date as string).substring(0, 10)
+ }
+ return recX.birth_date
+ },
+ patient_age: (rec: unknown): unknown => {
+ const recX = rec as SmallDetailDto
+ return recX.birth_date?.split('T')[0]
+ },
+ gender: (rec: unknown): unknown => {
+ const recX = rec as SmallDetailDto
+ if (typeof recX?.gender_code !== 'number' && recX?.gender_code !== '') {
+ return 'Tidak Diketahui'
+ }
+ return recX.gender_code
+ },
+ education: (rec: unknown): unknown => {
+ const recX = rec as SmallDetailDto
+ if (typeof recX.education_code == 'number' && recX.education_code >= 0) {
+ return recX.education_code
+ } else if (typeof recX.education_code) {
+ return recX.education_code
+ }
+ return '-'
+ },
},
- identity_number: (rec: unknown): unknown => {
- const recX = rec as SmallDetailDto
- if (recX.identity_number?.substring(0, 5) === 'BLANK') {
- return '(TANPA NIK)'
- }
- return recX.identity_number
+
+ components: {
+ action(rec, idx) {
+ const res: RecComponent = {
+ idx,
+ rec: rec as object,
+ component: action,
+ }
+ return res
+ },
+ status(rec, idx) {
+ const recX = rec as SmallDetailDto
+ if (recX.status_code === null) {
+ recX.status_code = 0
+ }
+ const res: RecComponent = {
+ idx,
+ rec: rec as object,
+ component: statusBadge,
+ }
+ return res
+ },
},
- birth_date: (rec: unknown): unknown => {
- const recX = rec as SmallDetailDto
- if (typeof recX.birth_date == 'object' && recX.birth_date) {
- return (recX.birth_date as Date).toLocaleDateString()
- } else if (typeof recX.birth_date == 'string') {
- return (recX.birth_date as string).substring(0, 10)
- }
- return recX.birth_date
- },
- patient_age: (rec: unknown): unknown => {
- const recX = rec as SmallDetailDto
- return recX.birth_date?.split('T')[0]
- },
- gender: (rec: unknown): unknown => {
- const recX = rec as SmallDetailDto
- if (typeof recX?.gender_code !== 'number' && recX?.gender_code !== '') {
- return 'Tidak Diketahui'
- }
- return recX.gender_code
- },
- education: (rec: unknown): unknown => {
- const recX = rec as SmallDetailDto
- if (typeof recX.education_code == 'number' && recX.education_code >= 0) {
- return recX.education_code
- } else if (typeof recX.education_code) {
- return recX.education_code
- }
- return '-'
- },
-}
-
-export const funcComponent: RecStrFuncComponent = {
- action(rec, idx) {
- const res: RecComponent = {
- idx,
- rec: rec as object,
- component: action,
- }
- return res
- },
- status(rec, idx) {
- if (rec.status === null) {
- rec.status_code = 0
- }
- const res: RecComponent = {
- idx,
- rec: rec as object,
- component: statusBadge,
- }
- return res
- },
-}
-
-export const funcHtml: RecStrFuncUnknown = {
- patient_address(_rec) {
- return '-'
+
+ htmls: {
+ patient_address(_rec) {
+ return '-'
+ },
},
}
diff --git a/app/components/app/icd/list.vue b/app/components/app/icd/list.vue
index b9a74929..96697bde 100644
--- a/app/components/app/icd/list.vue
+++ b/app/components/app/icd/list.vue
@@ -1,5 +1,5 @@
+
+
+
+
+
diff --git a/app/components/app/item-price/list-cfg.ts b/app/components/app/item-price/list-cfg.ts
index c26856bf..c3db4f50 100644
--- a/app/components/app/item-price/list-cfg.ts
+++ b/app/components/app/item-price/list-cfg.ts
@@ -1,11 +1,4 @@
-import type {
- Col,
- KeyLabel,
- RecComponent,
- RecStrFuncComponent,
- RecStrFuncUnknown,
- Th,
-} from '~/components/pub/my-ui/data/types'
+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-dud.vue'))
@@ -15,32 +8,40 @@ const _doctorStatus = {
1: 'Aktif',
}
-export const cols: Col[] = [{}, {}, { width: 50 }]
+export const config: Config = {
+ cols: [{}, {}, { width: 50 }],
-export const header: Th[][] = [[{ label: 'Kode' }, { label: 'Nama' }, { label: 'Aksi' }]]
+ headers: [
+ [
+ { label: 'Kode' },
+ { label: 'Nama' },
+ { label: 'Aksi' },
+ ],
+ ],
-export const keys = ['code', 'name', 'action']
+ keys: ['code', 'name', 'action'],
-export const delKeyNames: KeyLabel[] = [
- { key: 'code', label: 'Kode' },
- { key: 'name', label: 'Nama' },
-]
+ delKeyNames: [
+ { key: 'code', label: 'Kode' },
+ { key: 'name', label: 'Nama' },
+ ],
-export const funcParsed: RecStrFuncUnknown = {}
+ parses: {},
-export const funcComponent: RecStrFuncComponent = {
- action(rec, idx) {
- const res: RecComponent = {
- idx,
- rec: rec as object,
- component: action,
- }
- return res
- },
-}
-
-export const funcHtml: RecStrFuncUnknown = {
- patient_address(_rec) {
- return '-'
+ components: {
+ action(rec, idx) {
+ const res: RecComponent = {
+ idx,
+ rec: rec as object,
+ component: action,
+ }
+ return res
+ },
+ },
+
+ htmls: {
+ patient_address(_rec) {
+ return '-'
+ },
},
}
diff --git a/app/components/app/item-price/list.vue b/app/components/app/item-price/list.vue
index b9a74929..96697bde 100644
--- a/app/components/app/item-price/list.vue
+++ b/app/components/app/item-price/list.vue
@@ -1,5 +1,5 @@
+
+
+
+
diff --git a/app/components/app/medical-action-src/list-cfg.ts b/app/components/app/medical-action-src/list-cfg.ts
new file mode 100644
index 00000000..2fecde69
--- /dev/null
+++ b/app/components/app/medical-action-src/list-cfg.ts
@@ -0,0 +1,32 @@
+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-dud.vue'))
+
+export const config: Config = {
+ cols: [{}, {}, {}, { width: 50 }],
+
+ headers: [[{ label: 'Kode' }, { label: 'Nama' }, { label: '' }]],
+
+ 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/medical-action-src/list.vue b/app/components/app/medical-action-src/list.vue
new file mode 100644
index 00000000..1be60a60
--- /dev/null
+++ b/app/components/app/medical-action-src/list.vue
@@ -0,0 +1,36 @@
+
+
+
+
+
diff --git a/app/components/app/medicine-group/list-cfg.ts b/app/components/app/medicine-group/list-cfg.ts
index b9f068e9..583fd860 100644
--- a/app/components/app/medicine-group/list-cfg.ts
+++ b/app/components/app/medicine-group/list-cfg.ts
@@ -1,37 +1,38 @@
-import type {
- Col,
- KeyLabel,
- RecComponent,
- RecStrFuncComponent,
- RecStrFuncUnknown,
- Th,
-} from '~/components/pub/my-ui/data/types'
+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-dud.vue'))
-export const cols: Col[] = [{}, {}, { width: 50 }]
+export const config: Config = {
+ cols: [{}, {}, { width: 50 }],
-export const header: Th[][] = [[{ label: 'Kode' }, { label: 'Nama' }, { label: 'Aksi' }]]
+ headers: [
+ [
+ { label: 'Kode' },
+ { label: 'Nama' },
+ { label: 'Aksi' },
+ ],
+ ],
-export const keys = ['code', 'name', 'action']
+ keys: ['code', 'name', 'action'],
-export const delKeyNames: KeyLabel[] = [
- { key: 'code', label: 'Kode' },
- { key: 'name', label: 'Nama' },
-]
+ delKeyNames: [
+ { key: 'code', label: 'Kode' },
+ { key: 'name', label: 'Nama' },
+ ],
-export const funcParsed: RecStrFuncUnknown = {}
+ parses: {},
-export const funcComponent: RecStrFuncComponent = {
- action(rec, idx) {
- const res: RecComponent = {
- idx,
- rec: rec as object,
- component: action,
- }
- return res
+ components: {
+ action(rec, idx) {
+ const res: RecComponent = {
+ idx,
+ rec: rec as object,
+ component: action,
+ }
+ return res
+ },
},
-}
-export const funcHtml: RecStrFuncUnknown = {}
+ htmls: {},
+}
diff --git a/app/components/app/medicine-group/list.vue b/app/components/app/medicine-group/list.vue
index 3af2b398..e4544c2f 100644
--- a/app/components/app/medicine-group/list.vue
+++ b/app/components/app/medicine-group/list.vue
@@ -6,7 +6,7 @@ import PaginationView from '~/components/pub/my-ui/pagination/pagination-view.vu
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
// Configs
-import { cols, funcComponent, funcHtml, funcParsed, header, keys } from './list-cfg'
+import { config } from './list-cfg'
interface Props {
data: any[]
@@ -27,13 +27,8 @@ function handlePageChange(page: number) {
diff --git a/app/components/app/medicine-method/list-cfg.ts b/app/components/app/medicine-method/list-cfg.ts
index b9f068e9..583fd860 100644
--- a/app/components/app/medicine-method/list-cfg.ts
+++ b/app/components/app/medicine-method/list-cfg.ts
@@ -1,37 +1,38 @@
-import type {
- Col,
- KeyLabel,
- RecComponent,
- RecStrFuncComponent,
- RecStrFuncUnknown,
- Th,
-} from '~/components/pub/my-ui/data/types'
+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-dud.vue'))
-export const cols: Col[] = [{}, {}, { width: 50 }]
+export const config: Config = {
+ cols: [{}, {}, { width: 50 }],
-export const header: Th[][] = [[{ label: 'Kode' }, { label: 'Nama' }, { label: 'Aksi' }]]
+ headers: [
+ [
+ { label: 'Kode' },
+ { label: 'Nama' },
+ { label: 'Aksi' },
+ ],
+ ],
-export const keys = ['code', 'name', 'action']
+ keys: ['code', 'name', 'action'],
-export const delKeyNames: KeyLabel[] = [
- { key: 'code', label: 'Kode' },
- { key: 'name', label: 'Nama' },
-]
+ delKeyNames: [
+ { key: 'code', label: 'Kode' },
+ { key: 'name', label: 'Nama' },
+ ],
-export const funcParsed: RecStrFuncUnknown = {}
+ parses: {},
-export const funcComponent: RecStrFuncComponent = {
- action(rec, idx) {
- const res: RecComponent = {
- idx,
- rec: rec as object,
- component: action,
- }
- return res
+ components: {
+ action(rec, idx) {
+ const res: RecComponent = {
+ idx,
+ rec: rec as object,
+ component: action,
+ }
+ return res
+ },
},
-}
-export const funcHtml: RecStrFuncUnknown = {}
+ htmls: {},
+}
diff --git a/app/components/app/medicine-method/list.vue b/app/components/app/medicine-method/list.vue
index 3af2b398..e4544c2f 100644
--- a/app/components/app/medicine-method/list.vue
+++ b/app/components/app/medicine-method/list.vue
@@ -6,7 +6,7 @@ import PaginationView from '~/components/pub/my-ui/pagination/pagination-view.vu
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
// Configs
-import { cols, funcComponent, funcHtml, funcParsed, header, keys } from './list-cfg'
+import { config } from './list-cfg'
interface Props {
data: any[]
@@ -27,13 +27,8 @@ function handlePageChange(page: number) {
diff --git a/app/components/app/medicine/entry-form.vue b/app/components/app/medicine/entry-form.vue
index 66ef4afb..42989fcb 100644
--- a/app/components/app/medicine/entry-form.vue
+++ b/app/components/app/medicine/entry-form.vue
@@ -85,7 +85,7 @@ function onCancelForm() {
diff --git a/app/components/app/patient/list-cfg.ts b/app/components/app/patient/list-cfg.ts
index 4fbdf694..559428a7 100644
--- a/app/components/app/patient/list-cfg.ts
+++ b/app/components/app/patient/list-cfg.ts
@@ -1,100 +1,100 @@
-import type {
- Col,
- KeyLabel,
- RecComponent,
- RecStrFuncComponent,
- RecStrFuncUnknown,
- Th,
-} from '~/components/pub/my-ui/data/types'
-import type { PatientEntity } from '~/models/patient'
+import type { Config } from '~/components/pub/my-ui/data-table'
+import type { Patient } from '~/models/patient'
import { defineAsyncComponent } from 'vue'
import { educationCodes, genderCodes } from '~/lib/constants'
import { calculateAge } from '~/lib/utils'
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dud.vue'))
-export const cols: Col[] = [{}, {}, {}, {}, {}, {}, {}, { width: 5 }]
+export const config: Config = {
+ cols: [{}, {}, {}, {}, {}, {}, {}, { width: 5 }],
-export const header: Th[][] = [
- [
- { label: 'Nama' },
- { label: 'NIK' },
- { label: 'Tgl Lahir' },
- { label: 'Umur' },
- { label: 'Jenis Kelamin' },
- { label: 'Pendidikan' },
- { label: '' },
+ headers: [
+ [
+ { label: 'ID' },
+ { label: 'Nama' },
+ { label: 'NIK/No. Paspor' },
+ { label: 'Tgl Lahir' },
+ { label: 'Umur' },
+ { label: 'Jenis Kelamin' },
+ { label: 'Pendidikan' },
+ { label: '' },
+ ],
],
-]
-export const keys = ['name', 'identity_number', 'birth_date', 'patient_age', 'gender', 'education', 'action']
+ keys: ['patientId', 'name', 'identity_number', 'birth_date', 'patient_age', 'gender', 'education', 'action'],
-export const delKeyNames: KeyLabel[] = [
- { key: 'code', label: 'Kode' },
- { key: 'name', label: 'Nama' },
-]
+ delKeyNames: [
+ { key: 'code', label: 'Kode' },
+ { key: 'name', label: 'Nama' },
+ ],
-export const funcParsed: RecStrFuncUnknown = {
- name: (rec: unknown): unknown => {
- const { person } = rec as PatientEntity
- return person.name.trim()
+ parses: {
+ patientId: (rec: unknown): unknown => {
+ const patient = rec as Patient
+ return patient.number
+ },
+ name: (rec: unknown): unknown => {
+ const { person } = rec as Patient
+ return person.name.trim()
+ },
+ 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 '-'
+ },
},
- identity_number: (rec: unknown): unknown => {
- const { person } = rec as PatientEntity
- if (person?.residentIdentityNumber?.substring(0, 5) === 'BLANK') {
- return '(TANPA NIK)'
- }
- return person.residentIdentityNumber
+ components: {
+ action(rec, idx) {
+ return {
+ idx,
+ rec: rec as object,
+ component: action,
+ }
+ },
},
- birth_date: (rec: unknown): unknown => {
- const { person } = rec as PatientEntity
- if (typeof person.birthDate == 'object' && person.birthDate) {
- return (person.birthDate as Date).toLocaleDateString()
- } 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 PatientEntity
- return calculateAge(person.birthDate)
- },
- gender: (rec: unknown): unknown => {
- const { person } = rec as PatientEntity
-
- 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 PatientEntity
- 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 '-'
- },
-}
-
-export const funcComponent: RecStrFuncComponent = {
- action(rec, idx) {
- const res: RecComponent = {
- idx,
- rec: rec as object,
- component: action,
- }
- return res
- },
-}
-
-export const funcHtml: RecStrFuncUnknown = {
- patient_address(_rec) {
- return '-'
+ htmls: {
+ patient_address(_rec) {
+ return '-'
+ },
},
}
diff --git a/app/components/app/patient/list.cfg.ts b/app/components/app/patient/list.cfg.ts
new file mode 100644
index 00000000..d86c8dc1
--- /dev/null
+++ b/app/components/app/patient/list.cfg.ts
@@ -0,0 +1,96 @@
+import type { Config } from '~/components/pub/my-ui/data-table'
+import type { Patient } from '~/models/patient'
+import { defineAsyncComponent } from 'vue'
+import { educationCodes, genderCodes } from '~/lib/constants'
+import { calculateAge } from '~/lib/utils'
+
+const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dud.vue'))
+
+export const config: Config = {
+ cols: [{}, {}, {}, {}, {}, {}, {}, { width: 5 }],
+
+ headers: [
+ [
+ { label: 'No. RM' },
+ { label: 'Nama' },
+ { label: 'No. KTP/SIM/Passpor' },
+ { label: 'Tgl Lahir' },
+ { label: 'Umur' },
+ { label: 'Kelamin' },
+ { label: 'Pendidikan' },
+ { label: '' },
+ ],
+ ],
+
+ keys: ['number', 'person.name', 'identity_number', 'birth_date', 'patient_age', 'gender', 'education', 'action'],
+
+ delKeyNames: [
+ { key: 'code', label: 'Kode' },
+ { key: 'name', label: 'Nama' },
+ ],
+
+ parses: {
+ patientId: (rec: unknown): unknown => {
+ const patient = rec as Patient
+ return patient.number
+ },
+ identity_number: (rec: unknown): unknown => {
+ const { person } = rec as Patient
+
+ if (person.nationality == 'WNA') {
+ return person.passportNumber
+ }
+
+ return person.residentIdentityNumber || '-'
+ },
+ birth_date: (rec: unknown): unknown => {
+ const { person } = rec as Patient
+
+ if (typeof person.birthDate == 'object' && person.birthDate) {
+ return (person.birthDate as Date).toLocaleDateString('id-ID')
+ } else if (typeof person.birthDate == 'string') {
+ return (person.birthDate as string).substring(0, 10)
+ }
+ return person.birthDate
+ },
+ patient_age: (rec: unknown): unknown => {
+ const { person } = rec as Patient
+ return calculateAge(person.birthDate)
+ },
+ gender: (rec: unknown): unknown => {
+ const { person } = rec as Patient
+
+ if (typeof person.gender_code == 'number' && person.gender_code >= 0) {
+ return person.gender_code
+ } else if (typeof person.gender_code === 'string' && person.gender_code) {
+ return genderCodes[person.gender_code] || '-'
+ }
+ return '-'
+ },
+ education: (rec: unknown): unknown => {
+ const { person } = rec as Patient
+ if (typeof person.education_code == 'number' && person.education_code >= 0) {
+ return person.education_code
+ } else if (typeof person.education_code === 'string' && person.education_code) {
+ return educationCodes[person.education_code] || '-'
+ }
+ return '-'
+ },
+ },
+
+ components: {
+ action(rec, idx) {
+ return {
+ idx,
+ rec: rec as object,
+ component: action,
+ }
+ },
+ },
+
+ htmls: {
+ patient_address(_rec) {
+ return '-'
+ },
+ },
+}
diff --git a/app/components/app/patient/list.vue b/app/components/app/patient/list.vue
index 53558b2b..8274e752 100644
--- a/app/components/app/patient/list.vue
+++ b/app/components/app/patient/list.vue
@@ -1,7 +1,7 @@
-
-
-
+
-
-
+
+
diff --git a/app/components/app/person-address/_common/select-postal.vue b/app/components/app/person-address/_common/select-postal.vue
index 83b33786..56867c7f 100644
--- a/app/components/app/person-address/_common/select-postal.vue
+++ b/app/components/app/person-address/_common/select-postal.vue
@@ -6,8 +6,11 @@ import Field from '~/components/pub/my-ui/form/field.vue'
import Label from '~/components/pub/my-ui/form/label.vue'
import { cn } from '~/lib/utils'
+import * as DE from '~/components/pub/my-ui/doc-entry'
+
const props = defineProps<{
fieldName: string
+ villageCode?: string
isDisabled?: boolean
placeholder?: string
errors?: FormErrors
@@ -17,37 +20,32 @@ const props = defineProps<{
isRequired?: boolean
}>()
-const {
- fieldName = 'zipCode',
- placeholder = 'Kode Pos',
- errors,
- class: containerClass,
- selectClass,
- fieldGroupClass,
-} = props
+const { fieldName = 'postalRegion', placeholder = 'Kode Pos', errors, class: containerClass, fieldGroupClass } = props
-const postalCodeOptions = [
- { label: '65120', value: '65120' },
- { label: '65121', value: '65121' },
- { label: '65123', value: '65123' },
- { label: '65124', value: '65124' },
- { label: '65125', value: '65125' },
- { label: '65126', value: '65126' },
- { label: '65127', value: '65127' },
- { label: '65128', value: '65128' },
- { label: '65129', value: '65129' },
-]
+const villageCodeRef = toRef(props, 'villageCode')
+const { postalRegionOptions, isLoading, error } = usePostalRegion(villageCodeRef)
+
+const dynamicPlaceholder = computed(() => {
+ if (!props.villageCode) return 'Pilih kelurahan terlebih dahulu'
+ if (isLoading.value) return 'Memuat kode pos...'
+ if (error.value) return 'Gagal memuat data'
+ return placeholder
+})
+
+const isFieldDisabled = computed(() => {
+ return props.isDisabled || !props.villageCode || isLoading.value || !!error.value
+})
-
-
-
+
@@ -71,6 +69,6 @@ const postalCodeOptions = [
-
-
+
+
diff --git a/app/components/app/person-address/_common/select-province.vue b/app/components/app/person-address/_common/select-province.vue
index f8cc5464..ca6dd51a 100644
--- a/app/components/app/person-address/_common/select-province.vue
+++ b/app/components/app/person-address/_common/select-province.vue
@@ -6,8 +6,10 @@ import Field from '~/components/pub/my-ui/form/field.vue'
import Label from '~/components/pub/my-ui/form/label.vue'
import { cn } from '~/lib/utils'
+import * as DE from '~/components/pub/my-ui/doc-entry'
+
const props = defineProps<{
- fieldName: string
+ fieldName?: string
isDisabled?: boolean
placeholder?: string
errors?: FormErrors
@@ -18,29 +20,38 @@ const props = defineProps<{
}>()
const {
- fieldName = 'provinceId',
+ fieldName = 'provinceCode',
placeholder = 'Pilih provinsi',
errors,
class: containerClass,
fieldGroupClass,
} = props
-const provinceList = [
- { label: 'Jawa Barat', value: '18' },
- { label: 'Jawa Tengah', value: '33' },
- { label: 'Jawa Timur', value: '35' },
-]
+// Gunakan composable untuk mengelola data provinces
+const { provinceOptions, isLoading, error } = useProvinces()
+
+// Computed untuk menentukan placeholder berdasarkan state
+const dynamicPlaceholder = computed(() => {
+ if (isLoading.value) return 'Memuat data provinsi...'
+ if (error.value) return 'Gagal memuat data'
+ return placeholder
+})
+
+// Computed untuk menentukan apakah field disabled
+const isFieldDisabled = computed(() => {
+ return props.isDisabled || isLoading.value || !!error.value
+})
-
-
-
+
-
-
+
+
diff --git a/app/components/app/person-address/_common/select-regency.vue b/app/components/app/person-address/_common/select-regency.vue
index 9b415b6e..8fbf6f23 100644
--- a/app/components/app/person-address/_common/select-regency.vue
+++ b/app/components/app/person-address/_common/select-regency.vue
@@ -6,8 +6,11 @@ import Field from '~/components/pub/my-ui/form/field.vue'
import Label from '~/components/pub/my-ui/form/label.vue'
import { cn } from '~/lib/utils'
+import * as DE from '~/components/pub/my-ui/doc-entry'
+
const props = defineProps<{
- fieldName: string
+ fieldName?: string
+ provinceCode?: string
isDisabled?: boolean
placeholder?: string
errors?: FormErrors
@@ -17,26 +20,41 @@ const props = defineProps<{
isRequired?: boolean
}>()
-const { placeholder = 'Pilih kabupaten/kota', errors, class: containerClass, selectClass, fieldGroupClass } = props
+const {
+ fieldName = 'regencyId',
+ placeholder = 'Pilih kabupaten/kota',
+ errors,
+ class: containerClass,
+ fieldGroupClass,
+} = props
-const regencyOptions = [
- { label: 'Kab. Sidoarjo', value: '32' },
- { label: 'Kab. Malang', value: '35' },
- { label: 'Kab. Mojokerto', value: '31' },
- { label: 'Kab. Lamongan', value: '30' },
- { label: 'Kota Malang', value: '18' },
-]
+// Gunakan composable untuk mengelola data regencies
+const provinceCodeRef = toRef(props, 'provinceCode')
+const { regencyOptions, isLoading, error } = useRegencies({ provinceCode: provinceCodeRef, enablePagination: false })
+
+// Computed untuk menentukan placeholder berdasarkan state
+const dynamicPlaceholder = computed(() => {
+ if (!props.provinceCode) return 'Pilih provinsi dahulu'
+ if (isLoading.value) return 'Memuat data kabupaten/kota...'
+ if (error.value) return 'Gagal memuat data'
+ return placeholder
+})
+
+// Computed untuk menentukan apakah field disabled
+const isFieldDisabled = computed(() => {
+ return props.isDisabled || !props.provinceCode || isLoading.value || !!error.value
+})
-
-
-
+
-
-
+
+
diff --git a/app/components/app/person-address/_common/select-village.vue b/app/components/app/person-address/_common/select-village.vue
index a3d7725c..9684954f 100644
--- a/app/components/app/person-address/_common/select-village.vue
+++ b/app/components/app/person-address/_common/select-village.vue
@@ -6,8 +6,11 @@ import Field from '~/components/pub/my-ui/form/field.vue'
import Label from '~/components/pub/my-ui/form/label.vue'
import { cn } from '~/lib/utils'
+import * as DE from '~/components/pub/my-ui/doc-entry'
+
const props = defineProps<{
- fieldName: string
+ fieldName?: string
+ districtCode?: string
isDisabled?: boolean
placeholder?: string
errors?: FormErrors
@@ -17,25 +20,41 @@ const props = defineProps<{
isRequired?: boolean
}>()
-const { placeholder = 'Pilih Kelurahan', errors, class: containerClass, selectClass, fieldGroupClass } = props
+const {
+ fieldName = 'villageId',
+ placeholder = 'Pilih kelurahan',
+ errors,
+ class: containerClass,
+ fieldGroupClass,
+} = props
-const villageOptions = [
- { label: 'Lowokwaru', value: '18' },
- { label: 'Dinoyo', value: '33' },
- { label: 'Blimbing', value: '35' },
- { label: 'Sawojajar', value: '36' },
-]
+// Gunakan composable untuk mengelola data villages
+const districtCodeRef = toRef(props, 'districtCode')
+const { villageOptions, isLoading, error } = useVillages(districtCodeRef)
+
+// Computed untuk menentukan placeholder berdasarkan state
+const dynamicPlaceholder = computed(() => {
+ if (!props.districtCode) return 'Pilih kecamatan dahulu'
+ if (isLoading.value) return 'Memuat data kelurahan...'
+ if (error.value) return 'Gagal memuat data'
+ return placeholder
+})
+
+// Computed untuk menentukan apakah field disabled
+const isFieldDisabled = computed(() => {
+ return props.isDisabled || !props.districtCode || isLoading.value || !!error.value
+})
-
-
-
+
-
-
+
+
diff --git a/app/components/app/person-address/entry-form-relative.vue b/app/components/app/person-address/entry-form-relative.vue
index 1c8c91a7..cc294bab 100644
--- a/app/components/app/person-address/entry-form-relative.vue
+++ b/app/components/app/person-address/entry-form-relative.vue
@@ -6,7 +6,8 @@ import FieldGroup from '~/components/pub/my-ui/form/field-group.vue'
import Field from '~/components/pub/my-ui/form/field.vue'
import InputBase from '~/components/pub/my-ui/form/input-base.vue'
import Label from '~/components/pub/my-ui/form/label.vue'
-import RadioResidence from './_common/radio-residence.vue'
+import { Label as RadioLabel } from '~/components/pub/ui/label'
+import { RadioGroup, RadioGroupItem } from '~/components/pub/ui/radio-group'
import SelectDistrict from './_common/select-district.vue'
import SelectPostal from './_common/select-postal.vue'
import SelectProvince from './_common/select-province.vue'
@@ -14,6 +15,8 @@ import SelectRegency from './_common/select-regency.vue'
import SelectVillage from './_common/select-village.vue'
import { Form } from '~/components/pub/ui/form'
+import * as DE from '~/components/pub/my-ui/doc-entry'
+
const props = defineProps<{
title: string
conf?: {
@@ -39,18 +42,27 @@ let isResetting = false
// Field dependency map for placeholder
const fieldStates: Record = {
- regencyId: { dependsOn: 'provinceId', placeholder: 'Pilih provinsi dahulu' },
- districtId: { dependsOn: 'regencyId', placeholder: 'Pilih kabupaten/kota dahulu' },
- villageId: { dependsOn: 'districtId', placeholder: 'Pilih kecamatan dahulu' },
- zipCode: { dependsOn: 'villageId', placeholder: 'Pilih kelurahan dahulu' },
+ regency_code: { dependsOn: 'province_code', placeholder: 'Pilih provinsi dahulu' },
+ district_code: { dependsOn: 'regency_code', placeholder: 'Pilih kabupaten/kota dahulu' },
+ village_code: { dependsOn: 'district_code', placeholder: 'Pilih kecamatan dahulu' },
+ postalRegion_code: { dependsOn: 'village_code', placeholder: 'Pilih kelurahan dahulu' },
address: { placeholder: 'Masukkan alamat' },
rt: { placeholder: '001' },
rw: { placeholder: '002' },
}
+
+// Computed untuk konversi boolean ke string untuk radio group
+const isSameAddressString = computed(() => {
+ const value = formRef.value?.values?.isSameAddress
+ if (typeof value === 'boolean') {
+ return value ? '1' : '0'
+ }
+ return value || '1'
+})
// #region Function Helper
function getFieldState(field: string) {
const state = fieldStates[field]
- const isSame = formRef.value?.values?.isSameAddress === '1'
+ const isSame = formRef.value?.values?.isSameAddress === true || formRef.value?.values?.isSameAddress === '1'
// Jika alamat sama, semua field kecuali provinsi disabled
if (['address', 'rt', 'rw'].includes(field) && isSame) {
@@ -63,7 +75,7 @@ function getFieldState(field: string) {
const isDisabledByDependency = !dependencyValue
// Jika isSame, semua field location disabled
- if (isSame && ['regencyId', 'districtId', 'villageId', 'zipCode'].includes(field)) {
+ if (isSame && ['regency_code', 'district_code', 'village_code', 'postalRegion_code'].includes(field)) {
return { placeholder: '-', disabled: true }
}
@@ -73,7 +85,7 @@ function getFieldState(field: string) {
}
// Jika isSame dan field location, disabled
- if (isSame && ['regencyId', 'districtId', 'villageId', 'zipCode'].includes(field)) {
+ if (isSame && ['regency_code', 'district_code', 'village_code', 'postalRegion_code'].includes(field)) {
return { placeholder: '-', disabled: true }
}
@@ -84,9 +96,9 @@ function getFieldState(field: string) {
// #region watch
-// Watch provinceId changes
+// Watch province_code changes
watch(
- () => formRef.value?.values?.provinceId,
+ () => formRef.value?.values?.province_code,
(newValue, oldValue) => {
if (isResetting || !formRef.value || newValue === oldValue) return
@@ -95,10 +107,10 @@ watch(
formRef.value.setValues(
{
- regencyId: undefined,
- districtId: undefined,
- villageId: undefined,
- zipCode: undefined,
+ regency_code: undefined,
+ district_code: undefined,
+ village_code: undefined,
+ postalRegion_code: undefined,
},
false,
)
@@ -110,9 +122,9 @@ watch(
},
)
-// Watch regencyId changes
+// Watch regency_code changes
watch(
- () => formRef.value?.values?.regencyId,
+ () => formRef.value?.values?.regency_code,
(newValue, oldValue) => {
if (isResetting || !formRef.value || newValue === oldValue) return
@@ -121,9 +133,9 @@ watch(
formRef.value.setValues(
{
- districtId: undefined,
- villageId: undefined,
- zipCode: undefined,
+ district_code: undefined,
+ village_code: undefined,
+ postalRegion_code: undefined,
},
false,
)
@@ -135,9 +147,9 @@ watch(
},
)
-// Watch districtId changes
+// Watch district_code changes
watch(
- () => formRef.value?.values?.districtId,
+ () => formRef.value?.values?.district_code,
(newValue, oldValue) => {
if (isResetting || !formRef.value || newValue === oldValue) return
@@ -146,8 +158,8 @@ watch(
formRef.value.setValues(
{
- villageId: undefined,
- zipCode: undefined,
+ village_code: undefined,
+ postalRegion_code: undefined,
},
false,
)
@@ -159,9 +171,9 @@ watch(
},
)
-// Watch villageId changes
+// Watch village_code changes
watch(
- () => formRef.value?.values?.villageId,
+ () => formRef.value?.values?.village_code,
(newValue, oldValue) => {
if (isResetting || !formRef.value || newValue === oldValue) return
@@ -170,7 +182,7 @@ watch(
formRef.value.setValues(
{
- zipCode: undefined,
+ postalRegion_code: undefined,
},
false,
)
@@ -188,19 +200,23 @@ watch(
(newValue, oldValue) => {
if (!formRef.value || newValue === oldValue) return
- // Ketika berubah dari '1' ke '0', clear empty strings dan trigger validasi
- if (oldValue === '1' && newValue === '0') {
+ // Konversi ke boolean untuk perbandingan yang konsisten
+ const newBool = newValue === true || newValue === '1'
+ const oldBool = oldValue === true || oldValue === '1'
+
+ // Ketika berubah dari true ke false, clear empty strings dan trigger validasi
+ if (oldBool && !newBool) {
nextTick(() => {
// Set empty strings ke undefined untuk trigger required validation
const currentValues = formRef.value.values
const updatedValues = { ...currentValues }
// Convert empty strings to undefined untuk field yang sekarang required
- if (updatedValues.provinceId === '') updatedValues.provinceId = undefined
- if (updatedValues.regencyId === '') updatedValues.regencyId = undefined
- if (updatedValues.districtId === '') updatedValues.districtId = undefined
- if (updatedValues.villageId === '') updatedValues.villageId = undefined
- if (updatedValues.zipCode === '') updatedValues.zipCode = undefined
+ if (updatedValues.province_code === '') updatedValues.province_code = undefined
+ if (updatedValues.regency_code === '') updatedValues.regency_code = undefined
+ if (updatedValues.district_code === '') updatedValues.district_code = undefined
+ if (updatedValues.village_code === '') updatedValues.village_code = undefined
+ if (updatedValues.postalRegion_code === '') updatedValues.postalRegion_code = undefined
if (updatedValues.address === '') updatedValues.address = undefined
// Update values dan trigger validasi
@@ -213,15 +229,15 @@ watch(
})
}
- // Ketika berubah dari '0' ke '1', clear error messages
- if (oldValue === '0' && newValue === '1') {
+ // Ketika berubah dari false ke true, clear error messages
+ if (!oldBool && newBool) {
nextTick(() => {
// Clear error messages untuk field yang tidak lagi required
- formRef.value?.setFieldError('provinceId', undefined)
- formRef.value?.setFieldError('regencyId', undefined)
- formRef.value?.setFieldError('districtId', undefined)
- formRef.value?.setFieldError('villageId', undefined)
- formRef.value?.setFieldError('zipCode', undefined)
+ formRef.value?.setFieldError('province_code', undefined)
+ formRef.value?.setFieldError('regency_code', undefined)
+ formRef.value?.setFieldError('district_code', undefined)
+ formRef.value?.setFieldError('village_code', undefined)
+ formRef.value?.setFieldError('postalRegion_code', undefined)
formRef.value?.setFieldError('address', undefined)
formRef.value?.setFieldError('rt', undefined)
formRef.value?.setFieldError('rw', undefined)
@@ -241,129 +257,138 @@ watch(
:validation-schema="formSchema"
:validate-on-mount="false"
validation-mode="onSubmit"
- :initial-values="initialValues ?? { isSameAddress: '1' }"
+ :initial-values="initialValues ?? { isSameAddress: '1', locationType_code: 'identity' }"
>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+ Apakah alamat KTP sama dengan alamat sekarang?
+
+
+
+
+
+ componentField.onChange(value)"
+ class="flex flex-row flex-wrap gap-4 sm:gap-6"
+ >
+
+
+
+ {{ option.label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
diff --git a/app/components/app/person-address/entry-form.vue b/app/components/app/person-address/entry-form.vue
index a26381d8..b3ef300d 100644
--- a/app/components/app/person-address/entry-form.vue
+++ b/app/components/app/person-address/entry-form.vue
@@ -12,6 +12,8 @@ import SelectRegency from './_common/select-regency.vue'
import SelectVillage from './_common/select-village.vue'
import { Form } from '~/components/pub/ui/form'
+import * as DE from '~/components/pub/my-ui/doc-entry'
+
const props = defineProps<{
title: string
conf?: {
@@ -35,29 +37,34 @@ defineExpose({
// Watchers untuk cascading reset
let isResetting = false
-// #region Watch provinceId changes
+// #region Watch provinceCode changes
watch(
- () => formRef.value?.values?.provinceId,
+ () => formRef.value?.values?.provinceCode,
(newValue, oldValue) => {
if (isResetting || !formRef.value || newValue === oldValue) return
if (oldValue && newValue !== oldValue) {
isResetting = true
- formRef.value.setValues(
- {
- regencyId: undefined,
- districtId: undefined,
- villageId: undefined,
- zipCode: undefined,
- },
- false,
- )
+ // Delay reset untuk memberikan waktu composable menyelesaikan request
+ setTimeout(() => {
+ if (formRef.value) {
+ formRef.value.setValues(
+ {
+ regencyId: undefined,
+ districtId: undefined,
+ villageId: undefined,
+ zipCode: undefined,
+ },
+ false,
+ )
+ }
- nextTick(() => {
- isResetting = false
- })
+ nextTick(() => {
+ isResetting = false
+ })
+ }, 150) // Delay 150ms, lebih dari debounce composable (100ms)
}
},
)
@@ -71,18 +78,23 @@ watch(
if (oldValue && newValue !== oldValue) {
isResetting = true
- formRef.value.setValues(
- {
- districtId: undefined,
- villageId: undefined,
- zipCode: undefined,
- },
- false,
- )
+ // Delay reset untuk memberikan waktu composable menyelesaikan request
+ setTimeout(() => {
+ if (formRef.value) {
+ formRef.value.setValues(
+ {
+ districtId: undefined,
+ villageId: undefined,
+ zipCode: undefined,
+ },
+ false,
+ )
+ }
- nextTick(() => {
- isResetting = false
- })
+ nextTick(() => {
+ isResetting = false
+ })
+ }, 150)
}
},
)
@@ -96,17 +108,22 @@ watch(
if (oldValue && newValue !== oldValue) {
isResetting = true
- formRef.value.setValues(
- {
- villageId: undefined,
- zipCode: undefined,
- },
- false,
- )
+ // Delay reset untuk memberikan waktu composable menyelesaikan request
+ setTimeout(() => {
+ if (formRef.value) {
+ formRef.value.setValues(
+ {
+ villageId: undefined,
+ zipCode: undefined,
+ },
+ false,
+ )
+ }
- nextTick(() => {
- isResetting = false
- })
+ nextTick(() => {
+ isResetting = false
+ })
+ }, 150)
}
},
)
@@ -145,124 +162,84 @@ watch(
:validation-schema="formSchema"
:validate-on-mount="false"
validation-mode="onSubmit"
- :initial-values="initialValues ? initialValues : {}"
+ :initial-values="
+ initialValues ? { locationType_code: 'domicile', ...initialValues } : { locationType_code: 'domicile' }
+ "
>
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
+
diff --git a/app/components/app/person-contact/entry-form.vue b/app/components/app/person-contact/entry-form.vue
index 5fa451b4..431a3c79 100644
--- a/app/components/app/person-contact/entry-form.vue
+++ b/app/components/app/person-contact/entry-form.vue
@@ -39,7 +39,7 @@ defineExpose({
{{ props.title || 'Kontak Pasien' }}
@@ -94,6 +94,7 @@ defineExpose({
:disabled="fields.length >= contactLimit"
type="button"
variant="outline"
+ size="sm"
@click="push({ contactType: '', contactNumber: '' })"
>
({
+ label,
+ value,
+ ...(value === 'other' && { priority: -1 })
+}))
diff --git a/app/components/app/person/_common/select-birth-place.vue b/app/components/app/person/_common/select-birth-place.vue
new file mode 100644
index 00000000..dd61a69f
--- /dev/null
+++ b/app/components/app/person/_common/select-birth-place.vue
@@ -0,0 +1,77 @@
+
+
+
+
+
+ Tempat Lahir
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/app/person/family-parents-form.vue b/app/components/app/person/family-parents-form.vue
index e5ac4a46..fc87ce45 100644
--- a/app/components/app/person/family-parents-form.vue
+++ b/app/components/app/person/family-parents-form.vue
@@ -65,7 +65,7 @@ defineExpose({
{{ props.title }}
diff --git a/app/components/app/pharmacist/list-cfg.ts b/app/components/app/pharmacist/list-cfg.ts
index 14c9cf0d..4dd5657f 100644
--- a/app/components/app/pharmacist/list-cfg.ts
+++ b/app/components/app/pharmacist/list-cfg.ts
@@ -1,11 +1,4 @@
-import type {
- Col,
- KeyLabel,
- RecComponent,
- RecStrFuncComponent,
- RecStrFuncUnknown,
- Th,
-} from '~/components/pub/my-ui/data/types'
+import type { Config } from '~/components/pub/my-ui/data-table'
import { defineAsyncComponent } from 'vue'
type SmallDetailDto = any
@@ -18,97 +11,97 @@ const _doctorStatus = {
1: 'Aktif',
}
-export const cols: Col[] = [
- { width: 100 },
- { width: 250 },
- {},
- { width: 100 },
- { width: 100 },
- {},
- {},
- {},
- { width: 120 },
- { width: 100 },
- {},
- {},
-]
-
-export const header: Th[][] = [
- [
- { label: 'Kode JKN' },
- { label: 'Nama' },
- { label: 'No KTP' },
- { label: 'No SIP' },
- { label: 'No IHS' },
- { label: 'Telpon' },
- { label: 'Fee Ranap' },
- { label: 'Fee Rajal' },
- { label: 'Status' },
- { label: '' },
+export const config: Config = {
+ cols: [
+ { width: 100 },
+ { width: 250 },
+ {},
+ { width: 100 },
+ { width: 100 },
+ {},
+ {},
+ {},
+ { width: 120 },
+ { width: 100 },
+ {},
+ {},
],
-]
-export const keys = [
- 'bpjs_code',
- 'name',
- 'identity_number',
- 'sip_no',
- 'ihs_number',
- 'phone',
- 'inPatient_itemPrice',
- 'outPatient_itemPrice',
- 'status',
- 'action',
-]
+ headers: [
+ [
+ { label: 'Kode JKN' },
+ { label: 'Nama' },
+ { label: 'No KTP' },
+ { label: 'No SIP' },
+ { label: 'No IHS' },
+ { label: 'Telpon' },
+ { label: 'Fee Ranap' },
+ { label: 'Fee Rajal' },
+ { label: 'Status' },
+ { label: '' },
+ ],
+ ],
-export const delKeyNames: KeyLabel[] = [
- { key: 'code', label: 'Kode' },
- { key: 'name', label: 'Nama' },
-]
+ keys: [
+ 'bpjs_code',
+ 'name',
+ 'identity_number',
+ 'sip_no',
+ 'ihs_number',
+ 'phone',
+ 'inPatient_itemPrice',
+ 'outPatient_itemPrice',
+ 'status',
+ 'action',
+ ],
-export const funcParsed: RecStrFuncUnknown = {
- name: (rec: unknown): unknown => {
- const recX = rec as SmallDetailDto
- return `${recX.frontTitle} ${recX.name} ${recX.endTitle}`.trim()
+ delKeyNames: [
+ { key: 'code', label: 'Kode' },
+ { key: 'name', label: 'Nama' },
+ ],
+
+ parses: {
+ name: (rec: unknown): unknown => {
+ const recX = rec as SmallDetailDto
+ return `${recX.frontTitle} ${recX.name} ${recX.endTitle}`.trim()
+ },
+ identity_number: (rec: unknown): unknown => {
+ const recX = rec as SmallDetailDto
+ if (recX.identity_number?.substring(0, 5) === 'BLANK') {
+ return '(TANPA NIK)'
+ }
+ return recX.identity_number
+ },
+ inPatient_itemPrice: (rec: unknown): unknown => {
+ const recX = rec as SmallDetailDto
+ return Number(recX.inPatient_itemPrice.price).toLocaleString('id-ID')
+ },
+ outPatient_itemPrice: (rec: unknown): unknown => {
+ const recX = rec as SmallDetailDto
+ return Number(recX.outPatient_itemPrice.price).toLocaleString('id-ID')
+ },
},
- identity_number: (rec: unknown): unknown => {
- const recX = rec as SmallDetailDto
- if (recX.identity_number?.substring(0, 5) === 'BLANK') {
- return '(TANPA NIK)'
- }
- return recX.identity_number
+
+ components: {
+ action(rec, idx) {
+ return {
+ idx,
+ rec: rec as object,
+ component: action,
+ }
+ },
+ status(rec, idx) {
+ return {
+ idx,
+ rec: rec as object,
+ component: statusBadge,
+ }
+ },
},
- inPatient_itemPrice: (rec: unknown): unknown => {
- const recX = rec as SmallDetailDto
- return Number(recX.inPatient_itemPrice.price).toLocaleString('id-ID')
- },
- outPatient_itemPrice: (rec: unknown): unknown => {
- const recX = rec as SmallDetailDto
- return Number(recX.outPatient_itemPrice.price).toLocaleString('id-ID')
- },
-}
-
-export const funcComponent: RecStrFuncComponent = {
- action(rec, idx) {
- const res: RecComponent = {
- idx,
- rec: rec as object,
- component: action,
- }
- return res
- },
- status(rec, idx) {
- const res: RecComponent = {
- idx,
- rec: rec as object,
- component: statusBadge,
- }
- return res
- },
-}
-
-export const funcHtml: RecStrFuncUnknown = {
- patient_address(_rec) {
- return '-'
+
+ htmls: {
+ patient_address(_rec) {
+ return '-'
+ },
},
}
diff --git a/app/components/app/pharmacist/list.vue b/app/components/app/pharmacist/list.vue
index b9a74929..96697bde 100644
--- a/app/components/app/pharmacist/list.vue
+++ b/app/components/app/pharmacist/list.vue
@@ -1,5 +1,5 @@
+
+
+
+
diff --git a/app/components/app/procedure-src/list-cfg.ts b/app/components/app/procedure-src/list-cfg.ts
new file mode 100644
index 00000000..0a576270
--- /dev/null
+++ b/app/components/app/procedure-src/list-cfg.ts
@@ -0,0 +1,33 @@
+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-dud.vue'))
+
+export const config: Config = {
+ cols: [{}, {}, {}, { width: 50 }],
+
+ headers: [[{ label: 'Kode' }, { label: 'Nama (FHIR)' }, { label: 'Nama (ID)' }, { label: '' }]],
+
+ keys: ['code', 'name', 'indName', 'action'],
+
+ delKeyNames: [
+ { key: 'code', label: 'Kode' },
+ { key: 'name', label: 'Nama (FHIR)' },
+ { key: 'indName', label: 'Nama (ID)' },
+ ],
+
+ parses: {},
+
+ components: {
+ action(rec, idx) {
+ const res: RecComponent = {
+ idx,
+ rec: rec as object,
+ component: action,
+ }
+ return res
+ },
+ },
+
+ htmls: {},
+}
diff --git a/app/components/app/procedure-src/list.vue b/app/components/app/procedure-src/list.vue
new file mode 100644
index 00000000..1be60a60
--- /dev/null
+++ b/app/components/app/procedure-src/list.vue
@@ -0,0 +1,36 @@
+
+
+
+
+
diff --git a/app/components/app/public-screen/list-cfg.ts b/app/components/app/public-screen/list-cfg.ts
index 905ec837..9f7ea4b4 100644
--- a/app/components/app/public-screen/list-cfg.ts
+++ b/app/components/app/public-screen/list-cfg.ts
@@ -1,37 +1,37 @@
-import type {
- Col,
- KeyLabel,
- RecComponent,
- RecStrFuncComponent,
- RecStrFuncUnknown,
- Th,
-} from '~/components/pub/my-ui/data/types'
+import type { Config } from '~/components/pub/my-ui/data-table'
import { defineAsyncComponent } from 'vue'
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dud.vue'))
-export const cols: Col[] = [{}, {}, { width: 50 }]
+export const config: Config = {
+ cols: [{}, {}, { width: 50 }],
-export const header: Th[][] = [[{ label: 'Kode' }, { label: 'Nama' }, { label: '' }]]
+ headers: [
+ [
+ { label: 'Kode' },
+ { label: 'Nama' },
+ { label: '' },
+ ],
+ ],
-export const keys = ['code', 'name', 'action']
+ keys: ['code', 'name', 'action'],
-export const delKeyNames: KeyLabel[] = [
- { key: 'code', label: 'Kode' },
- { key: 'name', label: 'Nama' },
-]
+ delKeyNames: [
+ { key: 'code', label: 'Kode' },
+ { key: 'name', label: 'Nama' },
+ ],
-export const funcParsed: RecStrFuncUnknown = {}
+ parses: {},
-export const funcComponent: RecStrFuncComponent = {
- action(rec, idx) {
- const res: RecComponent = {
- idx,
- rec: rec as object,
- component: action,
- }
- return res
+ components: {
+ action(rec, idx) {
+ return {
+ idx,
+ rec: rec as object,
+ component: action,
+ }
+ },
},
-}
-export const funcHtml: RecStrFuncUnknown = {}
+ htmls: {},
+}
diff --git a/app/components/app/public-screen/list.vue b/app/components/app/public-screen/list.vue
index e1b056ce..1be60a60 100644
--- a/app/components/app/public-screen/list.vue
+++ b/app/components/app/public-screen/list.vue
@@ -6,7 +6,7 @@ import PaginationView from '~/components/pub/my-ui/pagination/pagination-view.vu
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
// Configs
-import { cols, funcComponent, funcHtml, funcParsed, header, keys } from './list-cfg'
+import { config } from './list-cfg'
interface Props {
data: any[]
@@ -27,13 +27,8 @@ function handlePageChange(page: number) {
diff --git a/app/components/app/rehab/registration/sep-prosedur/list-cfg.ts b/app/components/app/rehab/registration/sep-prosedur/list-cfg.ts
index 754d2dfb..19298fbf 100644
--- a/app/components/app/rehab/registration/sep-prosedur/list-cfg.ts
+++ b/app/components/app/rehab/registration/sep-prosedur/list-cfg.ts
@@ -1,112 +1,113 @@
-import type { Col, KeyLabel, RecComponent, RecStrFuncComponent, RecStrFuncUnknown, Th } from '~/components/pub/my-ui/data/types'
+import type { Config } from '~/components/pub/my-ui/data-table'
import { defineAsyncComponent } from 'vue'
type SmallDetailDto = any
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dud.vue'))
-export const cols: Col[] = [
- {},
- {},
- {},
- { width: 100 },
- { width: 120 },
- {},
- {},
- {},
- { width: 100 },
- { width: 100 },
- {},
- { width: 50 },
-]
-
-export const header: Th[][] = [
- [
- { label: 'Nama' },
- { label: 'Rekam Medis' },
- { label: 'KTP' },
- { label: 'Tgl Lahir' },
- { label: 'Umur' },
- { label: 'JK' },
- { label: 'Pendidikan' },
- { label: 'Status' },
- { label: '' },
+export const config: Config = {
+ cols: [
+ {},
+ {},
+ {},
+ { width: 100 },
+ { width: 120 },
+ {},
+ {},
+ {},
+ { width: 100 },
+ { width: 100 },
+ {},
+ { width: 50 },
],
-]
-export const keys = [
- 'name',
- 'medicalRecord_number',
- 'identity_number',
- 'birth_date',
- 'patient_age',
- 'gender',
- 'education',
- 'status',
- 'action',
-]
+ headers: [
+ [
+ { label: 'Nama' },
+ { label: 'Rekam Medis' },
+ { label: 'KTP' },
+ { label: 'Tgl Lahir' },
+ { label: 'Umur' },
+ { label: 'JK' },
+ { label: 'Pendidikan' },
+ { label: 'Status' },
+ { label: '' },
+ ],
+ ],
-export const delKeyNames: KeyLabel[] = [
- { key: 'code', label: 'Kode' },
- { key: 'name', label: 'Nama' },
-]
+ keys: [
+ 'name',
+ 'medicalRecord_number',
+ 'identity_number',
+ 'birth_date',
+ 'patient_age',
+ 'gender',
+ 'education',
+ 'status',
+ 'action',
+ ],
-export const funcParsed: RecStrFuncUnknown = {
- name: (rec: unknown): unknown => {
- const recX = rec as SmallDetailDto
- return `${recX.firstName} ${recX.middleName || ''} ${recX.lastName || ''}`
+ delKeyNames: [
+ { key: 'code', label: 'Kode' },
+ { key: 'name', label: 'Nama' },
+ ],
+
+ parses: {
+ name: (rec: unknown): unknown => {
+ const recX = rec as SmallDetailDto
+ return `${recX.firstName} ${recX.middleName || ''} ${recX.lastName || ''}`
+ },
+ identity_number: (rec: unknown): unknown => {
+ const recX = rec as SmallDetailDto
+ if (recX.identity_number?.substring(0, 5) === 'BLANK') {
+ return '(TANPA NIK)'
+ }
+ return recX.identity_number
+ },
+ birth_date: (rec: unknown): unknown => {
+ const recX = rec as SmallDetailDto
+ if (typeof recX.birth_date === 'object' && recX.birth_date) {
+ return (recX.birth_date as Date).toLocaleDateString()
+ } else if (typeof recX.birth_date === 'string') {
+ return recX.birth_date.substring(0, 10)
+ }
+ return recX.birth_date
+ },
+ patient_age: (rec: unknown): unknown => {
+ const recX = rec as SmallDetailDto
+ return recX.birth_date?.split('T')[0]
+ },
+ gender: (rec: unknown): unknown => {
+ const recX = rec as SmallDetailDto
+ if (typeof recX?.gender_code !== 'number' && recX?.gender_code !== '') {
+ return 'Tidak Diketahui'
+ }
+ return recX.gender_code
+ },
+ education: (rec: unknown): unknown => {
+ const recX = rec as SmallDetailDto
+ if (typeof recX.education_code === 'number' && recX.education_code >= 0) {
+ return recX.education_code
+ } else if (typeof recX.education_code) {
+ return recX.education_code
+ }
+ return '-'
+ },
},
- identity_number: (rec: unknown): unknown => {
- const recX = rec as SmallDetailDto
- if (recX.identity_number?.substring(0, 5) === 'BLANK') {
- return '(TANPA NIK)'
- }
- return recX.identity_number
+
+ components: {
+ action(rec, idx) {
+ return {
+ idx,
+ rec: rec as object,
+ component: action,
+ }
+ },
},
- birth_date: (rec: unknown): unknown => {
- const recX = rec as SmallDetailDto
- if (typeof recX.birth_date == 'object' && recX.birth_date) {
- return (recX.birth_date as Date).toLocaleDateString()
- } else if (typeof recX.birth_date == 'string') {
- return (recX.birth_date as string).substring(0, 10)
- }
- return recX.birth_date
- },
- patient_age: (rec: unknown): unknown => {
- const recX = rec as SmallDetailDto
- return recX.birth_date?.split('T')[0]
- },
- gender: (rec: unknown): unknown => {
- const recX = rec as SmallDetailDto
- if (typeof recX?.gender_code !== 'number' && recX?.gender_code !== '') {
- return 'Tidak Diketahui'
- }
- return recX.gender_code
- },
- education: (rec: unknown): unknown => {
- const recX = rec as SmallDetailDto
- if (typeof recX.education_code == 'number' && recX.education_code >= 0) {
- return recX.education_code
- } else if (typeof recX.education_code) {
- return recX.education_code
- }
- return '-'
- },
-}
-
-export const funcComponent: RecStrFuncComponent = {
- action(rec, idx) {
- const res: RecComponent = {
- idx,
- rec: rec as object,
- component: action,
- }
- return res
- },
-}
-
-export const funcHtml: RecStrFuncUnknown = {
- patient_address(_rec) {
- return '-'
+
+ htmls: {
+ patient_address(_rec) {
+ return '-'
+ },
},
}
diff --git a/app/components/app/rehab/registration/sep-prosedur/list.vue b/app/components/app/rehab/registration/sep-prosedur/list.vue
index b9a74929..96697bde 100644
--- a/app/components/app/rehab/registration/sep-prosedur/list.vue
+++ b/app/components/app/rehab/registration/sep-prosedur/list.vue
@@ -1,5 +1,5 @@
-
+
diff --git a/app/components/app/sep/list-cfg.ts b/app/components/app/sep/list-cfg.ts
index 55fa91e1..4a6784fc 100644
--- a/app/components/app/sep/list-cfg.ts
+++ b/app/components/app/sep/list-cfg.ts
@@ -1,78 +1,77 @@
-import type { Col, KeyLabel, RecComponent, RecStrFuncComponent, Th } from '~/components/pub/my-ui/data/types'
+import type { Config } from '~/components/pub/my-ui/data-table'
import { defineAsyncComponent } from 'vue'
type SepDto = any
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dud.vue'))
-export const cols: Col[] = [
- { width: 120 }, // TGL. SEP
- { width: 150 }, // NO. SEP
- { width: 120 }, // PELAYANAN
- { width: 100 }, // JALUR
- { width: 150 }, // NO. RM
- { width: 200 }, // NAMA PASIEN
- { width: 150 }, // NO. KARTU BPJS
- { width: 150 }, // NO. SURAT KONTROL
- { width: 150 }, // TGL SURAT KONTROL
- { width: 150 }, // KLINIK TUJUAN
- { width: 200 }, // DPJP
- { width: 200 }, // DIAGNOSIS AWAL
- { width: 100 }, // AKSI
-]
-
-export const header: Th[][] = [
- [
- { label: 'TGL. SEP' },
- { label: 'NO. SEP' },
- { label: 'PELAYANAN' },
- { label: 'JALUR' },
- { label: 'NO. RM' },
- { label: 'NAMA PASIEN' },
- { label: 'NO. KARTU BPJS' },
- { label: 'NO. SURAT KONTROL' },
- { label: 'TGL SURAT KONTROL' },
- { label: 'KLINIK TUJUAN' },
- { label: 'DPJP' },
- { label: 'DIAGNOSIS AWAL' },
- { label: 'AKSI' },
+export const config: Config = {
+ cols: [
+ { width: 120 }, // TGL. SEP
+ { width: 150 }, // NO. SEP
+ { width: 120 }, // PELAYANAN
+ { width: 100 }, // JALUR
+ { width: 150 }, // NO. RM
+ { width: 200 }, // NAMA PASIEN
+ { width: 150 }, // NO. KARTU BPJS
+ { width: 150 }, // NO. SURAT KONTROL
+ { width: 150 }, // TGL SURAT KONTROL
+ { width: 150 }, // KLINIK TUJUAN
+ { width: 200 }, // DPJP
+ { width: 200 }, // DIAGNOSIS AWAL
+ { width: 100 }, // AKSI
],
-]
-export const keys = [
- 'tgl_sep',
- 'no_sep',
- 'pelayanan',
- 'jalur',
- 'no_rm',
- 'nama_pasien',
- 'no_kartu_bpjs',
- 'no_surat_kontrol',
- 'tgl_surat_kontrol',
- 'klinik_tujuan',
- 'dpjp',
- 'diagnosis_awal',
- 'action',
-]
+ headers: [
+ [
+ { label: 'TGL. SEP' },
+ { label: 'NO. SEP' },
+ { label: 'PELAYANAN' },
+ { label: 'JALUR' },
+ { label: 'NO. RM' },
+ { label: 'NAMA PASIEN' },
+ { label: 'NO. KARTU BPJS' },
+ { label: 'NO. SURAT KONTROL' },
+ { label: 'TGL SURAT KONTROL' },
+ { label: 'KLINIK TUJUAN' },
+ { label: 'DPJP' },
+ { label: 'DIAGNOSIS AWAL' },
+ { label: 'AKSI' },
+ ],
+ ],
-export const delKeyNames: KeyLabel[] = [
- { key: 'no_sep', label: 'NO. SEP' },
- { key: 'nama_pasien', label: 'Nama Pasien' },
-]
+ keys: [
+ 'tgl_sep',
+ 'no_sep',
+ 'pelayanan',
+ 'jalur',
+ 'no_rm',
+ 'nama_pasien',
+ 'no_kartu_bpjs',
+ 'no_surat_kontrol',
+ 'tgl_surat_kontrol',
+ 'klinik_tujuan',
+ 'dpjp',
+ 'diagnosis_awal',
+ 'action',
+ ],
-export const funcParsed: Record
any> = {
+ delKeyNames: [
+ { key: 'no_sep', label: 'NO. SEP' },
+ { key: 'nama_pasien', label: 'Nama Pasien' },
+ ],
-}
+ parses: {},
-export const funcComponent: RecStrFuncComponent = {
- action(rec, idx) {
- const res: RecComponent = {
- idx,
- rec: rec as object,
- component: action,
- }
- return res
+ components: {
+ action(rec, idx) {
+ return {
+ idx,
+ rec: rec as object,
+ component: action,
+ }
+ },
},
-}
-export const funcHtml: Record any> = {}
+ htmls: {},
+}
diff --git a/app/components/app/sep/list.vue b/app/components/app/sep/list.vue
index abf68e25..f44166e2 100644
--- a/app/components/app/sep/list.vue
+++ b/app/components/app/sep/list.vue
@@ -1,5 +1,5 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/content/device-order/list.vue b/app/components/content/device-order/list.vue
new file mode 100644
index 00000000..e62a2fbd
--- /dev/null
+++ b/app/components/content/device-order/list.vue
@@ -0,0 +1,145 @@
+
+
+
+
+
+
+
+
+ handleActionRemove(recId, getMyList, toast)"
+ @cancel=""
+ >
+
+
+
+ ID:
+ {{ record?.id }}
+
+
+ Nama:
+ {{ record.name }}
+
+
+ Kode:
+ {{ record.code }}
+
+
+
+
+
diff --git a/app/components/content/device-order/main.vue b/app/components/content/device-order/main.vue
new file mode 100644
index 00000000..ae5a9ca8
--- /dev/null
+++ b/app/components/content/device-order/main.vue
@@ -0,0 +1,12 @@
+
+
+
+
+
+
diff --git a/app/components/content/diagnose-src/list.vue b/app/components/content/diagnose-src/list.vue
new file mode 100644
index 00000000..2b056697
--- /dev/null
+++ b/app/components/content/diagnose-src/list.vue
@@ -0,0 +1,184 @@
+
+
+
+
+
+
+
+
+ handleActionRemove(recId, getItemList, toast)"
+ @cancel=""
+ >
+
+
+
+ {{ field.label }}:
+ {{ record[field.key] }}
+
+
+
+
+
diff --git a/app/components/content/division-position/list.vue b/app/components/content/division-position/list.vue
index 46e22401..019e64a9 100644
--- a/app/components/content/division-position/list.vue
+++ b/app/components/content/division-position/list.vue
@@ -132,8 +132,8 @@ onMounted(async () => {
:prep="headerPrep"
:ref-search-nav="headerPrep.refSearchNav"
@search="handleSearch"
- class="mb-4 xl:mb-5"
/>
+
([
+ { value: '1', label: 'Medical', hasChildren: true },
+ { value: '2', label: 'Nursing', hasChildren: true },
+ { value: '3', label: 'Admin', hasChildren: false },
+ { value: '4', label: 'Support', hasChildren: true },
+ { value: '5', label: 'Education', hasChildren: false },
+ { value: '6', label: 'Pharmacy', hasChildren: true },
+ { value: '7', label: 'Radiology', hasChildren: false },
+ { value: '8', label: 'Laboratory', hasChildren: true },
+])
+
+// Helper function untuk mencari dan menyisipkan data anak ke dalam tree
+function findAndInsertChildren(nodes: TreeItem[], parentId: string, newChildren: TreeItem[]): boolean {
+ for (const node of nodes) {
+ if (node.value === parentId) {
+ node.children = newChildren
+ return true
+ }
+ if (node.children && findAndInsertChildren(node.children as TreeItem[], parentId, newChildren)) {
+ return true
+ }
+ }
+ return false
+}
+
+// Fungsi untuk fetch data anak divisi (lazy loading)
+async function handleFetchDivisionChildren(parentId: string): Promise {
+ console.log(`Mengambil data sub-divisi untuk parent: ${parentId}`)
+
+ // Simulasi delay API call
+ await new Promise((resolve) => setTimeout(resolve, 800))
+
+ let childrenData: TreeItem[] = []
+
+ // Sample data berdasarkan parent ID
+ switch (parentId) {
+ case '1': // Medical
+ childrenData = [
+ { value: '1-1', label: 'Cardiology', hasChildren: true },
+ { value: '1-2', label: 'Neurology', hasChildren: false },
+ { value: '1-3', label: 'Oncology', hasChildren: false },
+ ]
+ break
+ case '2': // Nursing
+ childrenData = [
+ { value: '2-1', label: 'ICU Nursing', hasChildren: false },
+ { value: '2-2', label: 'ER Nursing', hasChildren: false },
+ { value: '2-3', label: 'Ward Nursing', hasChildren: true },
+ ]
+ break
+ case '4': // Support
+ childrenData = [
+ { value: '4-1', label: 'IT Support', hasChildren: false },
+ { value: '4-2', label: 'Maintenance', hasChildren: false },
+ ]
+ break
+ case '6': // Pharmacy
+ childrenData = [
+ { value: '6-1', label: 'Inpatient Pharmacy', hasChildren: false },
+ { value: '6-2', label: 'Outpatient Pharmacy', hasChildren: false },
+ ]
+ break
+ case '8': // Laboratory
+ childrenData = [
+ { value: '8-1', label: 'Clinical Lab', hasChildren: false },
+ { value: '8-2', label: 'Pathology Lab', hasChildren: false },
+ ]
+ break
+ case '1-1': // Cardiology sub-divisions
+ childrenData = [
+ { value: '1-1-1', label: 'Cardiac Surgery', hasChildren: false },
+ { value: '1-1-2', label: 'Cardiac Cathlab', hasChildren: false },
+ ]
+ break
+ case '2-3': // Ward Nursing sub-divisions
+ childrenData = [
+ { value: '2-3-1', label: 'Pediatric Ward', hasChildren: false },
+ { value: '2-3-2', label: 'Surgical Ward', hasChildren: false },
+ ]
+ break
+ }
+
+ // Insert data ke dalam tree state
+ findAndInsertChildren(divisionTreeData.value, parentId, childrenData)
+}
+
+export const divisionTreeConfig = computed(() => ({
+ msg: {
+ placeholder: '--- Pilih divisi induk',
+ search: 'Cari divisi...',
+ empty: 'Divisi tidak ditemukan',
+ },
+ data: divisionTreeData.value,
+ onFetchChildren: handleFetchDivisionChildren,
+}))
diff --git a/app/components/content/division/list-prev.vue b/app/components/content/division/list-prev.vue
new file mode 100644
index 00000000..d072ac9a
--- /dev/null
+++ b/app/components/content/division/list-prev.vue
@@ -0,0 +1,208 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
ID: {{ record?.id }}
+
Nama: {{ record.firstName }}
+
Kode: {{ record.cellphone }}
+
+
+
+
+
+
diff --git a/app/components/content/division/list.vue b/app/components/content/division/list.vue
index 0ad75edb..9ccefc56 100644
--- a/app/components/content/division/list.vue
+++ b/app/components/content/division/list.vue
@@ -147,8 +147,8 @@ onMounted(async () => {
:prep="headerPrep"
:ref-search-nav="headerPrep.refSearchNav"
@search="handleSearch"
- class="mb-4 xl:mb-5"
/>
+
-
+
+
diff --git a/app/components/content/encounter/list.vue b/app/components/content/encounter/list.vue
index f218444a..967bcf11 100644
--- a/app/components/content/encounter/list.vue
+++ b/app/components/content/encounter/list.vue
@@ -49,7 +49,7 @@ const refSearchNav: RefSearchNav = {
async function getPatientList() {
isLoading.isTableLoading = true
- const resp = await xfetch('/api/v1/encounter')
+ const resp = await xfetch('/api/v1/encounter?includes=patient,patient-person')
if (resp.success) {
data.value = (resp.body as Record).data
}
@@ -96,11 +96,10 @@ provide('table_data_loader', isLoading)
-
+
-
+
+