diff --git a/app/components/app/divison/list.vue b/app/components/app/divison/list.vue index e2540e85..dd450462 100644 --- a/app/components/app/divison/list.vue +++ b/app/components/app/divison/list.vue @@ -22,11 +22,16 @@ function handlePageChange(page: number) { diff --git a/app/components/app/encounter/assesment-function/entry-form.vue b/app/components/app/encounter/assesment-function/entry-form.vue new file mode 100644 index 00000000..5768c6a0 --- /dev/null +++ b/app/components/app/encounter/assesment-function/entry-form.vue @@ -0,0 +1,47 @@ + + + diff --git a/app/components/app/encounter/assesment-function/list-cfg.ts b/app/components/app/encounter/assesment-function/list-cfg.ts new file mode 100644 index 00000000..24cc80d1 --- /dev/null +++ b/app/components/app/encounter/assesment-function/list-cfg.ts @@ -0,0 +1,112 @@ +import type { Col, KeyLabel, RecComponent, RecStrFuncComponent, RecStrFuncUnknown, Th } from '~/components/pub/custom-ui/data/types' +import { defineAsyncComponent } from 'vue' + +type SmallDetailDto = any + +const action = defineAsyncComponent(() => import('~/components/pub/custom-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 keys = [ + 'name', + 'medicalRecord_number', + 'identity_number', + 'birth_date', + 'patient_age', + 'gender', + 'education', + 'status', + 'action', +] + +export const delKeyNames: KeyLabel[] = [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, +] + +export const funcParsed: RecStrFuncUnknown = { + 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 '-' + }, +} + +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 '-' + }, +} diff --git a/app/components/app/encounter/assesment-function/list.vue b/app/components/app/encounter/assesment-function/list.vue new file mode 100644 index 00000000..5b8778d9 --- /dev/null +++ b/app/components/app/encounter/assesment-function/list.vue @@ -0,0 +1,19 @@ + + + diff --git a/app/components/app/encounter/assesment-function/picker.vue b/app/components/app/encounter/assesment-function/picker.vue new file mode 100644 index 00000000..e69de29b diff --git a/app/components/app/encounter/assesment-function/search.vue b/app/components/app/encounter/assesment-function/search.vue new file mode 100644 index 00000000..e69de29b diff --git a/app/components/app/encounter/entry-form.vue b/app/components/app/encounter/entry-form.vue new file mode 100644 index 00000000..50189589 --- /dev/null +++ b/app/components/app/encounter/entry-form.vue @@ -0,0 +1,353 @@ + + + diff --git a/app/components/app/encounter/filter.vue b/app/components/app/encounter/filter.vue new file mode 100644 index 00000000..91812991 --- /dev/null +++ b/app/components/app/encounter/filter.vue @@ -0,0 +1,114 @@ + + + diff --git a/app/components/app/encounter/list-cfg.ts b/app/components/app/encounter/list-cfg.ts new file mode 100644 index 00000000..9e1b5d33 --- /dev/null +++ b/app/components/app/encounter/list-cfg.ts @@ -0,0 +1,131 @@ +import type { + Col, + KeyLabel, + RecComponent, + RecStrFuncComponent, + RecStrFuncUnknown, + Th, +} from '~/components/pub/custom-ui/data/types' +import { defineAsyncComponent } from 'vue' + +type SmallDetailDto = any + +const action = defineAsyncComponent(() => import('~/components/pub/custom-ui/data/dropdown-action-pdud.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 keys = [ + 'name', + 'medicalRecord_number', + 'identity_number', + 'birth_date', + 'patient_age', + 'gender', + 'education', + 'status', + 'action', +] + +export const delKeyNames: KeyLabel[] = [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, +] + +export const funcParsed: RecStrFuncUnknown = { + 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 '-' + }, +} + +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 '-' + }, +} diff --git a/app/components/app/encounter/list.vue b/app/components/app/encounter/list.vue new file mode 100644 index 00000000..5b8778d9 --- /dev/null +++ b/app/components/app/encounter/list.vue @@ -0,0 +1,19 @@ + + + diff --git a/app/components/app/encounter/picker.vue b/app/components/app/encounter/picker.vue new file mode 100644 index 00000000..e69de29b diff --git a/app/components/app/encounter/search.vue b/app/components/app/encounter/search.vue new file mode 100644 index 00000000..e69de29b diff --git a/app/components/app/encounter/status-badge.vue b/app/components/app/encounter/status-badge.vue new file mode 100644 index 00000000..32cdfbca --- /dev/null +++ b/app/components/app/encounter/status-badge.vue @@ -0,0 +1,29 @@ + + + diff --git a/app/components/app/patient/picker.vue b/app/components/app/patient/picker.vue index e69de29b..a1dda029 100644 --- a/app/components/app/patient/picker.vue +++ b/app/components/app/patient/picker.vue @@ -0,0 +1,20 @@ + + + diff --git a/app/components/app/patient/quick-info.vue b/app/components/app/patient/quick-info.vue new file mode 100644 index 00000000..1f8943c2 --- /dev/null +++ b/app/components/app/patient/quick-info.vue @@ -0,0 +1,75 @@ + + + diff --git a/app/components/app/sep/small-entry.vue b/app/components/app/sep/small-entry.vue new file mode 100644 index 00000000..4b099b67 --- /dev/null +++ b/app/components/app/sep/small-entry.vue @@ -0,0 +1,218 @@ + + + diff --git a/app/components/content/encounter/assesment-function/add.vue b/app/components/content/encounter/assesment-function/add.vue new file mode 100644 index 00000000..128cf74a --- /dev/null +++ b/app/components/content/encounter/assesment-function/add.vue @@ -0,0 +1,3 @@ + diff --git a/app/components/content/encounter/assesment-function/list.vue b/app/components/content/encounter/assesment-function/list.vue new file mode 100644 index 00000000..c53a6881 --- /dev/null +++ b/app/components/content/encounter/assesment-function/list.vue @@ -0,0 +1,64 @@ + + + diff --git a/app/components/content/encounter/entry.vue b/app/components/content/encounter/entry.vue new file mode 100644 index 00000000..275a9529 --- /dev/null +++ b/app/components/content/encounter/entry.vue @@ -0,0 +1,51 @@ + + + diff --git a/app/components/content/encounter/home.vue b/app/components/content/encounter/home.vue new file mode 100644 index 00000000..2a4be548 --- /dev/null +++ b/app/components/content/encounter/home.vue @@ -0,0 +1,100 @@ + + + diff --git a/app/components/content/encounter/list.vue b/app/components/content/encounter/list.vue new file mode 100644 index 00000000..33ed1483 --- /dev/null +++ b/app/components/content/encounter/list.vue @@ -0,0 +1,110 @@ + + + diff --git a/app/components/content/rehab/registration/home.vue b/app/components/content/rehab/registration/home.vue index 7fe1e669..f6b646a9 100644 --- a/app/components/content/rehab/registration/home.vue +++ b/app/components/content/rehab/registration/home.vue @@ -1,57 +1,86 @@ - - diff --git a/app/components/content/satusehat/list.vue b/app/components/content/satusehat/list.vue index 879a3fed..ab0bf8c2 100644 --- a/app/components/content/satusehat/list.vue +++ b/app/components/content/satusehat/list.vue @@ -112,27 +112,27 @@ const activeTabFilter = computed({
-

FHIR Resource

+

FHIR Resource

-
+
+ > {{ tab.label }} -
- +
- - + @@ -152,19 +152,13 @@ v-for="tab in tabs" :key="tab.value" :value="tab.value" Status @@ -181,12 +175,8 @@ v-for="tab in tabs" :key="tab.value" :value="tab.value" - - + + @@ -194,9 +184,11 @@ v-for="tab in tabs" :key="tab.value" :value="tab.value" + />
@@ -206,11 +198,11 @@ v-for="action in actions" :key="action.value" :icon="action.icon"
+ v-if="!isLoading.satusehatConn && !isLoading.isTableLoading && pagination.total > 0" + class="mt-4 flex items-center justify-between" + >
- Menampilkan {{ ((pagination.page - 1) * pagination.limit) + 1 }} - + Menampilkan {{ (pagination.page - 1) * pagination.limit + 1 }} - {{ Math.min(pagination.page * pagination.limit, pagination.total) }} dari {{ pagination.total }} data
diff --git a/app/components/pub/base/data-table/data-table.vue b/app/components/pub/base/data-table/data-table.vue index e4413432..1127b4e4 100644 --- a/app/components/pub/base/data-table/data-table.vue +++ b/app/components/pub/base/data-table/data-table.vue @@ -13,6 +13,12 @@ const props = defineProps<{ funcParsed: RecStrFuncUnknown funcHtml: RecStrFuncUnknown funcComponent: RecStrFuncComponent + selectMode?: 'single' | 'multiple' + modelValue?: any[] | any +}>() + +const emit = defineEmits<{ + (e: 'update:modelValue', val: any[] | any): void }>() const getSkeletonSize = computed(() => { @@ -20,6 +26,24 @@ const getSkeletonSize = computed(() => { }) const loader = inject('table_data_loader') as DataTableLoader +// local state utk selection +const selected = ref([]) + +function toggleSelection(row: any) { + if (props.selectMode === 'single') { + selected.value = [row] + emit('update:modelValue', row) + } else { + const idx = selected.value.findIndex((r) => r === row) + if (idx >= 0) { + selected.value.splice(idx, 1) + } else { + selected.value.push(row) + } + emit('update:modelValue', [...selected.value]) + } +} + function handleActionCellClick(event: Event, _cellRef: string) { // Prevent event if clicked directly on the button/dropdown const target = event.target as HTMLElement @@ -70,32 +94,38 @@ function handleActionCellClick(event: Event, _cellRef: string) { - - - + + + + + + + + + + -