diff --git a/app/assets/css/main.css b/app/assets/css/main.css index cab62d6e..17502027 100644 --- a/app/assets/css/main.css +++ b/app/assets/css/main.css @@ -174,7 +174,7 @@ body { } body, table, label { - @apply md:!text-xs 2xl:!text-sm; + @apply md:!text-xs 2xl:!text-sm; } /* Container */ diff --git a/app/components/app/diagnose-src/entry-form.vue b/app/components/app/diagnose-src/entry-form.vue new file mode 100644 index 00000000..3f84b2a2 --- /dev/null +++ b/app/components/app/diagnose-src/entry-form.vue @@ -0,0 +1,137 @@ + + + diff --git a/app/components/app/diagnose-src/list-cfg.ts b/app/components/app/diagnose-src/list-cfg.ts new file mode 100644 index 00000000..0a576270 --- /dev/null +++ b/app/components/app/diagnose-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/diagnose-src/list.vue b/app/components/app/diagnose-src/list.vue new file mode 100644 index 00000000..1be60a60 --- /dev/null +++ b/app/components/app/diagnose-src/list.vue @@ -0,0 +1,36 @@ + + + diff --git a/app/components/app/encounter/entry-form.vue b/app/components/app/encounter/entry-form.vue index fd6c8da9..25bdf9d8 100644 --- a/app/components/app/encounter/entry-form.vue +++ b/app/components/app/encounter/entry-form.vue @@ -108,248 +108,246 @@ function onAddSep() { :initial-values="initialValues" >
-
-
-
-

Data Pasien

-
-
- - Sudah pernah terdaftar sebagai pasien? - - - - Belum pernah terdaftar sebagai pasien? - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Data Kunjungan

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - -
- - - -
-
- -
-
-
-
- - - - - - - - -
- - - -
-
- -
-
-
-
- +
+
+ Data Pasien
+
+ + Sudah pernah terdaftar sebagai pasien? + + + + Belum pernah terdaftar sebagai pasien? + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Data Kunjungan +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+ + + +
+
+ +
+
+
+
+ + + + + + + + +
+ + + +
+
+ +
+
+
+
+
diff --git a/app/components/app/encounter/list-cfg.ts b/app/components/app/encounter/list-cfg.ts deleted file mode 100644 index fb15bc06..00000000 --- a/app/components/app/encounter/list-cfg.ts +++ /dev/null @@ -1,127 +0,0 @@ -import type { Config, RecComponent } 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-pdud.vue')) -const statusBadge = defineAsyncComponent(() => import('./status-badge.vue')) - -export const config: Config = { - cols: [ - {}, - {}, - {}, - { width: 100 }, - { width: 120 }, - {}, - {}, - {}, - { width: 100 }, - { width: 100 }, - {}, - { width: 50 }, - ], - - headers: [ - [ - { label: 'Nama' }, - { label: 'Rekam Medis' }, - { label: 'KTP' }, - { label: 'Tgl Lahir' }, - { label: 'Umur' }, - { label: 'JK' }, - { label: 'Pendidikan' }, - { label: 'Status' }, - { label: '' }, - ], - ], - - keys: [ - 'name', - 'medicalRecord_number', - 'identity_number', - 'birth_date', - 'patient_age', - 'gender', - 'education', - 'status', - 'action', - ], - - 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 '-' - }, - }, - - 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 - }, - }, - - htmls: { - patient_address(_rec) { - return '-' - }, - }, -} diff --git a/app/components/app/encounter/list.cfg.ts b/app/components/app/encounter/list.cfg.ts new file mode 100644 index 00000000..9ebbc34f --- /dev/null +++ b/app/components/app/encounter/list.cfg.ts @@ -0,0 +1,104 @@ +import type { Config, RecComponent } from '~/components/pub/my-ui/data-table' +import { defineAsyncComponent } from 'vue' +import type { Encounter } from '~/models/encounter' +import { educationCodes, genderCodes } from '~/lib/constants' +import { getAge } from '~/lib/date' + +type SmallDetailDto = Encounter + +const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-pdud.vue')) +const statusBadge = defineAsyncComponent(() => import('./status-badge.vue')) + +export const config: Config = { + cols: [ + {}, + {}, + {}, + { width: 160 }, + {}, + { width: 70 }, + { }, + { width: 50 }, + ], + + headers: [ + [ + { label: 'Nama' }, + { label: 'Rekam Medis' }, + { label: 'KTP' }, + { label: 'Tgl Lahir / Umur' }, + { label: 'JK' }, + { label: 'Pendidikan' }, + { label: 'Status', classVal: '!text-center' }, + { label: '' }, + ], + ], + + keys: [ + 'patient.person.name', + 'patient.number', + 'patient.person.residentIdentityNumber', + 'birth_date', + 'gender', + 'education', + 'status', + 'action', + ], + + delKeyNames: [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, + ], + + parses: { + gender: (rec: unknown): unknown => { + const recX = rec as Encounter + if (recX.patient?.person?.gender_code) { + return genderCodes[recX.patient.person.gender_code] + } + return '-' + }, + education: (rec: unknown): unknown => { + const recX = rec as SmallDetailDto + if (recX.patient?.person?.education_code) { + return educationCodes[recX.patient.person.education_code] + } + return '-' + }, + }, + + components: { + action(rec, idx) { + const res: RecComponent = { + idx, + rec: rec as object, + component: action, + } + return res + }, + status(rec, idx) { + const recX = rec as Encounter + if (!recX.status_code) { + recX.status_code = 'new' + } + const res: RecComponent = { + idx, + rec: recX, + component: statusBadge, + } + return res + }, + }, + + htmls: { + birth_date: (rec: unknown): unknown => { + const recX = rec as Encounter + if (recX.patient?.person?.birthDate) { + return '' + + '
' + (recX.patient.person.birthDate as string).substring(0, 10) + ' /
' + + getAge(recX.patient.person.birthDate as string).extFormat + } + return '-' + }, + }, +} diff --git a/app/components/app/encounter/list.vue b/app/components/app/encounter/list.vue index 96697bde..1d58d6a7 100644 --- a/app/components/app/encounter/list.vue +++ b/app/components/app/encounter/list.vue @@ -1,7 +1,7 @@ diff --git a/app/components/app/encounter/quick-info.vue b/app/components/app/encounter/quick-info.vue index 49d81926..37ed817f 100644 --- a/app/components/app/encounter/quick-info.vue +++ b/app/components/app/encounter/quick-info.vue @@ -1,35 +1,50 @@ 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' } + " >

{{ props.title }}

-
-
- - - - + + + + + + + + + + +
+ - - - -