diff --git a/.prettierrc.json b/.prettierrc.json index 28b1a8b3..bff36007 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -5,5 +5,7 @@ "trailingComma": "all", "printWidth": 120, "semi": false, - "plugins": ["prettier-plugin-tailwindcss"] + "plugins": ["prettier-plugin-tailwindcss"], + "htmlWhitespaceSensitivity": "ignore", + "singleAttributePerLine": true } diff --git a/app/assets/css/main.css b/app/assets/css/main.css index 8f547641..b5064af7 100644 --- a/app/assets/css/main.css +++ b/app/assets/css/main.css @@ -346,6 +346,7 @@ body, table, label { color: hsl(var(--destructive)); /* font-size: 0.875rem; */ margin-top: 0.25rem; + min-height: 1rem; /* Reserve space to prevent CLS */ line-height: 1.25; } @@ -374,4 +375,4 @@ body, table, label { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; } -} \ No newline at end of file +} diff --git a/app/components/app/assesment-function/entry-form.vue b/app/components/app/assesment-function/entry-form.vue new file mode 100644 index 00000000..5768c6a0 --- /dev/null +++ b/app/components/app/assesment-function/entry-form.vue @@ -0,0 +1,47 @@ + + + diff --git a/app/components/app/assesment-function/list-cfg.ts b/app/components/app/assesment-function/list-cfg.ts new file mode 100644 index 00000000..460cacd9 --- /dev/null +++ b/app/components/app/assesment-function/list-cfg.ts @@ -0,0 +1,119 @@ +import type { + Col, + KeyLabel, + RecComponent, + RecStrFuncComponent, + RecStrFuncUnknown, + Th, +} from '~/components/pub/my-ui/data/types' +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 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/assesment-function/list.vue b/app/components/app/assesment-function/list.vue new file mode 100644 index 00000000..b9a74929 --- /dev/null +++ b/app/components/app/assesment-function/list.vue @@ -0,0 +1,19 @@ + + + diff --git a/app/components/app/assesment-function/picker.vue b/app/components/app/assesment-function/picker.vue new file mode 100644 index 00000000..e69de29b diff --git a/app/components/app/assesment-function/search.vue b/app/components/app/assesment-function/search.vue new file mode 100644 index 00000000..e69de29b diff --git a/app/components/app/bed/entry-form.vue b/app/components/app/bed/entry-form.vue new file mode 100644 index 00000000..fb851aa4 --- /dev/null +++ b/app/components/app/bed/entry-form.vue @@ -0,0 +1,105 @@ + + + diff --git a/app/components/app/bed/list-cfg.ts b/app/components/app/bed/list-cfg.ts new file mode 100644 index 00000000..5174e69a --- /dev/null +++ b/app/components/app/bed/list-cfg.ts @@ -0,0 +1,47 @@ +import type { + Col, + KeyLabel, + RecComponent, + RecStrFuncComponent, + RecStrFuncUnknown, + Th, +} from '~/components/pub/my-ui/data/types' +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: 50 }] + +export const header: Th[][] = [[{ label: 'Kode' }, { label: 'Nama' }, { label: 'Counter Induk' }, { label: '' }]] + +export const keys = ['code', 'name', 'parent', 'action'] + +export const delKeyNames: KeyLabel[] = [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, +] + +export const funcParsed: RecStrFuncUnknown = { + parent: (rec: unknown): unknown => { + const recX = rec as SmallDetailDto + return recX.parent?.name || '-' + }, +} + +export const funcComponent: RecStrFuncComponent = { + action(rec, idx) { + const res: RecComponent = { + idx, + rec: rec as object, + component: action, + props: { + size: 'sm', + }, + } + return res + }, +} + +export const funcHtml: RecStrFuncUnknown = {} diff --git a/app/components/app/bed/list.vue b/app/components/app/bed/list.vue new file mode 100644 index 00000000..af63d76e --- /dev/null +++ b/app/components/app/bed/list.vue @@ -0,0 +1,36 @@ + + + diff --git a/app/components/app/building/entry-form.vue b/app/components/app/building/entry-form.vue new file mode 100644 index 00000000..c2851e2d --- /dev/null +++ b/app/components/app/building/entry-form.vue @@ -0,0 +1,108 @@ + + + diff --git a/app/components/app/building/list-cfg.ts b/app/components/app/building/list-cfg.ts new file mode 100644 index 00000000..905ec837 --- /dev/null +++ b/app/components/app/building/list-cfg.ts @@ -0,0 +1,37 @@ +import type { + Col, + KeyLabel, + RecComponent, + RecStrFuncComponent, + RecStrFuncUnknown, + Th, +} from '~/components/pub/my-ui/data/types' +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 header: Th[][] = [[{ label: 'Kode' }, { label: 'Nama' }, { label: '' }]] + +export const keys = ['code', 'name', 'action'] + +export const delKeyNames: KeyLabel[] = [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, +] + +export const funcParsed: RecStrFuncUnknown = {} + +export const funcComponent: RecStrFuncComponent = { + action(rec, idx) { + const res: RecComponent = { + idx, + rec: rec as object, + component: action, + } + return res + }, +} + +export const funcHtml: RecStrFuncUnknown = {} diff --git a/app/components/app/building/list.vue b/app/components/app/building/list.vue new file mode 100644 index 00000000..e1b056ce --- /dev/null +++ b/app/components/app/building/list.vue @@ -0,0 +1,41 @@ + + + diff --git a/app/components/app/chamber/entry-form.vue b/app/components/app/chamber/entry-form.vue new file mode 100644 index 00000000..fb851aa4 --- /dev/null +++ b/app/components/app/chamber/entry-form.vue @@ -0,0 +1,105 @@ + + + diff --git a/app/components/app/chamber/list-cfg.ts b/app/components/app/chamber/list-cfg.ts new file mode 100644 index 00000000..5174e69a --- /dev/null +++ b/app/components/app/chamber/list-cfg.ts @@ -0,0 +1,47 @@ +import type { + Col, + KeyLabel, + RecComponent, + RecStrFuncComponent, + RecStrFuncUnknown, + Th, +} from '~/components/pub/my-ui/data/types' +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: 50 }] + +export const header: Th[][] = [[{ label: 'Kode' }, { label: 'Nama' }, { label: 'Counter Induk' }, { label: '' }]] + +export const keys = ['code', 'name', 'parent', 'action'] + +export const delKeyNames: KeyLabel[] = [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, +] + +export const funcParsed: RecStrFuncUnknown = { + parent: (rec: unknown): unknown => { + const recX = rec as SmallDetailDto + return recX.parent?.name || '-' + }, +} + +export const funcComponent: RecStrFuncComponent = { + action(rec, idx) { + const res: RecComponent = { + idx, + rec: rec as object, + component: action, + props: { + size: 'sm', + }, + } + return res + }, +} + +export const funcHtml: RecStrFuncUnknown = {} diff --git a/app/components/app/chamber/list.vue b/app/components/app/chamber/list.vue new file mode 100644 index 00000000..af63d76e --- /dev/null +++ b/app/components/app/chamber/list.vue @@ -0,0 +1,36 @@ + + + diff --git a/app/components/app/counter/entry-form.vue b/app/components/app/counter/entry-form.vue new file mode 100644 index 00000000..c2851e2d --- /dev/null +++ b/app/components/app/counter/entry-form.vue @@ -0,0 +1,108 @@ + + + diff --git a/app/components/app/counter/list-cfg.ts b/app/components/app/counter/list-cfg.ts new file mode 100644 index 00000000..905ec837 --- /dev/null +++ b/app/components/app/counter/list-cfg.ts @@ -0,0 +1,37 @@ +import type { + Col, + KeyLabel, + RecComponent, + RecStrFuncComponent, + RecStrFuncUnknown, + Th, +} from '~/components/pub/my-ui/data/types' +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 header: Th[][] = [[{ label: 'Kode' }, { label: 'Nama' }, { label: '' }]] + +export const keys = ['code', 'name', 'action'] + +export const delKeyNames: KeyLabel[] = [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, +] + +export const funcParsed: RecStrFuncUnknown = {} + +export const funcComponent: RecStrFuncComponent = { + action(rec, idx) { + const res: RecComponent = { + idx, + rec: rec as object, + component: action, + } + return res + }, +} + +export const funcHtml: RecStrFuncUnknown = {} diff --git a/app/components/app/counter/list.vue b/app/components/app/counter/list.vue new file mode 100644 index 00000000..e1b056ce --- /dev/null +++ b/app/components/app/counter/list.vue @@ -0,0 +1,41 @@ + + + diff --git a/app/components/app/division/entry-form.vue b/app/components/app/division/entry-form.vue index a928c1bd..c58d83ac 100644 --- a/app/components/app/division/entry-form.vue +++ b/app/components/app/division/entry-form.vue @@ -4,6 +4,7 @@ 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 TreeSelect from '~/components/pub/my-ui/select-tree/tree-select.vue' // Types import type { DivisionFormData } from '~/schemas/division.schema.ts' @@ -15,6 +16,7 @@ import { useForm } from 'vee-validate' interface Props { schema: z.ZodSchema + divisions: any[] values: any isLoading?: boolean isReadonly?: boolean @@ -33,33 +35,38 @@ const { defineField, errors, meta } = useForm({ initialValues: { code: '', name: '', - division_id: '', + parent_id: null, + division_id: null, } as Partial, }) const [code, codeAttrs] = defineField('code') const [name, nameAttrs] = defineField('name') -const [division, divisionAttrs] = defineField('division_id') +const [parent, parentAttrs] = defineField('parent_id') +const [division] = defineField('division_id') // 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.division_id !== undefined) division.value = props.values.division_id + if (props.values.parent_id !== undefined) parent.value = String(props.values.parent_id) + if (props.values.division_id !== undefined) division.value = String(props.values.division_id) } const resetForm = () => { code.value = '' name.value = '' - division.value = '' + parent.value = null + division.value = null } // Form submission handler -function onSubmitForm(values: any) { +function onSubmitForm() { const formData: DivisionFormData = { name: name.value || '', code: code.value || '', - division_id: division.value || '', + parent_id: parent.value || null, + division_id: division.value || null, } emit('submit', formData, resetForm) } @@ -85,6 +92,22 @@ function onCancelForm() { + + + + + +
diff --git a/app/components/app/division/list-cfg.ts b/app/components/app/division/list-cfg.ts index 079faf52..d5479579 100644 --- a/app/components/app/division/list-cfg.ts +++ b/app/components/app/division/list-cfg.ts @@ -12,11 +12,11 @@ type SmallDetailDto = any const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-ud.vue')) -export const cols: Col[] = [{ width: 100 }, {}, {}, { width: 50 }] +export const cols: Col[] = [{}, {}, {}, { width: 50 }] export const header: Th[][] = [[{ label: 'Kode' }, { label: 'Nama' }, { label: 'Divisi Induk' }, { label: '' }]] -export const keys = ['code', 'name', 'ancestor', 'action'] +export const keys = ['code', 'name', 'parent', 'action'] export const delKeyNames: KeyLabel[] = [ { key: 'code', label: 'Kode' }, @@ -24,13 +24,9 @@ export const delKeyNames: KeyLabel[] = [ ] export const funcParsed: RecStrFuncUnknown = { - ancestor: (rec: unknown): unknown => { + parent: (rec: unknown): unknown => { const recX = rec as SmallDetailDto - if (recX.meta === null) { - return '-' - } - - return recX.meta.name + return recX.parent?.name || '-' }, } diff --git a/app/components/app/division/list.vue b/app/components/app/division/list.vue index 9169bcac..e1b056ce 100644 --- a/app/components/app/division/list.vue +++ b/app/components/app/division/list.vue @@ -1,6 +1,11 @@ + + \ No newline at end of file diff --git a/app/components/app/equipment/list.vue b/app/components/app/equipment/list.vue index 9d655fdf..3af2b398 100644 --- a/app/components/app/equipment/list.vue +++ b/app/components/app/equipment/list.vue @@ -1,6 +1,11 @@ + + diff --git a/app/components/app/floor/list-cfg.ts b/app/components/app/floor/list-cfg.ts new file mode 100644 index 00000000..33b1a8af --- /dev/null +++ b/app/components/app/floor/list-cfg.ts @@ -0,0 +1,44 @@ +import type { + Col, + KeyLabel, + RecComponent, + RecStrFuncComponent, + RecStrFuncUnknown, + Th, +} from '~/components/pub/my-ui/data/types' +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: 50 }] + +export const header: Th[][] = [[{ label: 'Kode' }, { label: 'Nama' }, { label: 'Gedung' }, { label: '' }]] + +export const keys = ['code', 'name', 'parent', 'action'] + +export const delKeyNames: KeyLabel[] = [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, +] + +export const funcParsed: RecStrFuncUnknown = { + parent: (rec: unknown): unknown => { + const recX = rec as SmallDetailDto + return recX.parent?.name || '-' + }, +} + +export const funcComponent: RecStrFuncComponent = { + action(rec, idx) { + const res: RecComponent = { + idx, + rec: rec as object, + component: action, + } + return res + }, +} + +export const funcHtml: RecStrFuncUnknown = {} diff --git a/app/components/app/floor/list.vue b/app/components/app/floor/list.vue new file mode 100644 index 00000000..e1b056ce --- /dev/null +++ b/app/components/app/floor/list.vue @@ -0,0 +1,41 @@ + + + diff --git a/app/components/app/icd/entry-form.vue b/app/components/app/icd/entry-form.vue new file mode 100644 index 00000000..7c850a16 --- /dev/null +++ b/app/components/app/icd/entry-form.vue @@ -0,0 +1,43 @@ + + + diff --git a/app/components/app/icd/list-cfg.ts b/app/components/app/icd/list-cfg.ts new file mode 100644 index 00000000..c74ef59b --- /dev/null +++ b/app/components/app/icd/list-cfg.ts @@ -0,0 +1,131 @@ +import type { + Col, + KeyLabel, + RecComponent, + RecStrFuncComponent, + RecStrFuncUnknown, + Th, +} from '~/components/pub/my-ui/data/types' +import { defineAsyncComponent } from 'vue' + +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 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/icd/list.vue b/app/components/app/icd/list.vue new file mode 100644 index 00000000..b9a74929 --- /dev/null +++ b/app/components/app/icd/list.vue @@ -0,0 +1,19 @@ + + + diff --git a/app/components/app/icd/multiselect-picker.vue b/app/components/app/icd/multiselect-picker.vue new file mode 100644 index 00000000..9a08bb86 --- /dev/null +++ b/app/components/app/icd/multiselect-picker.vue @@ -0,0 +1,20 @@ + + + diff --git a/app/components/app/icd/preview.vue b/app/components/app/icd/preview.vue new file mode 100644 index 00000000..36bb193c --- /dev/null +++ b/app/components/app/icd/preview.vue @@ -0,0 +1,46 @@ + + + diff --git a/app/components/app/icd/search.vue b/app/components/app/icd/search.vue new file mode 100644 index 00000000..e69de29b diff --git a/app/components/app/icd/status-badge.vue b/app/components/app/icd/status-badge.vue new file mode 100644 index 00000000..32cdfbca --- /dev/null +++ b/app/components/app/icd/status-badge.vue @@ -0,0 +1,29 @@ + + + diff --git a/app/components/app/installation/entry-form.vue b/app/components/app/installation/entry-form.vue index 4257b712..9d57b434 100644 --- a/app/components/app/installation/entry-form.vue +++ b/app/components/app/installation/entry-form.vue @@ -1,125 +1,119 @@ diff --git a/app/components/app/installation/list-cfg.ts b/app/components/app/installation/list-cfg.ts index 81de0024..8c3fa5b4 100644 --- a/app/components/app/installation/list-cfg.ts +++ b/app/components/app/installation/list-cfg.ts @@ -12,13 +12,11 @@ type SmallDetailDto = any const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-ud.vue')) -export const cols: Col[] = [{ width: 100 }, {}, {}, {}, { width: 50 }] +export const cols: Col[] = [{}, {}, {}, { width: 50 }] -export const header: Th[][] = [ - [{ label: 'Id' }, { label: 'Nama' }, { label: 'Kode' }, { label: 'Encounter Class' }, { label: '' }], -] +export const header: Th[][] = [[{ label: 'Kode' }, { label: 'Nama' }, { label: 'Encounter Class' }, { label: '' }]] -export const keys = ['id', 'name', 'cellphone', 'religion_code', 'action'] +export const keys = ['code', 'name', 'encounterClass_code', 'action'] export const delKeyNames: KeyLabel[] = [ { key: 'code', label: 'Kode' }, @@ -28,22 +26,7 @@ export const delKeyNames: KeyLabel[] = [ export const funcParsed: RecStrFuncUnknown = { name: (rec: unknown): unknown => { const recX = rec as SmallDetailDto - return `${recX.firstName} ${recX.lastName || ''}`.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') + return `${recX.name}`.trim() }, } diff --git a/app/components/app/installation/list.vue b/app/components/app/installation/list.vue index 72973ca3..e1b056ce 100644 --- a/app/components/app/installation/list.vue +++ b/app/components/app/installation/list.vue @@ -1,6 +1,11 @@ + + diff --git a/app/components/app/patient/_common/input-patient-name.vue b/app/components/app/patient/_common/input-patient-name.vue new file mode 100644 index 00000000..fbc57351 --- /dev/null +++ b/app/components/app/patient/_common/input-patient-name.vue @@ -0,0 +1,102 @@ + + + diff --git a/app/components/app/patient/_common/radio-communication-barrier.vue b/app/components/app/patient/_common/radio-communication-barrier.vue new file mode 100644 index 00000000..463b3659 --- /dev/null +++ b/app/components/app/patient/_common/radio-communication-barrier.vue @@ -0,0 +1,94 @@ + + + diff --git a/app/components/app/patient/_common/radio-disability.vue b/app/components/app/patient/_common/radio-disability.vue new file mode 100644 index 00000000..312c3730 --- /dev/null +++ b/app/components/app/patient/_common/radio-disability.vue @@ -0,0 +1,94 @@ + + + diff --git a/app/components/app/patient/_common/radio-gender.vue b/app/components/app/patient/_common/radio-gender.vue new file mode 100644 index 00000000..108b1d22 --- /dev/null +++ b/app/components/app/patient/_common/radio-gender.vue @@ -0,0 +1,92 @@ + + + diff --git a/app/components/app/patient/_common/radio-nationality.vue b/app/components/app/patient/_common/radio-nationality.vue new file mode 100644 index 00000000..9c0eef1d --- /dev/null +++ b/app/components/app/patient/_common/radio-nationality.vue @@ -0,0 +1,94 @@ + + + diff --git a/app/components/app/patient/_common/select-disability.vue b/app/components/app/patient/_common/select-disability.vue new file mode 100644 index 00000000..de65a07f --- /dev/null +++ b/app/components/app/patient/_common/select-disability.vue @@ -0,0 +1,81 @@ + + + diff --git a/app/components/app/patient/_common/select-dob.vue b/app/components/app/patient/_common/select-dob.vue new file mode 100644 index 00000000..938bd254 --- /dev/null +++ b/app/components/app/patient/_common/select-dob.vue @@ -0,0 +1,142 @@ + + + diff --git a/app/components/app/patient/_common/select-education.vue b/app/components/app/patient/_common/select-education.vue new file mode 100644 index 00000000..33caac16 --- /dev/null +++ b/app/components/app/patient/_common/select-education.vue @@ -0,0 +1,88 @@ + + + diff --git a/app/components/app/patient/_common/select-ethnicity.vue b/app/components/app/patient/_common/select-ethnicity.vue new file mode 100644 index 00000000..a4231571 --- /dev/null +++ b/app/components/app/patient/_common/select-ethnicity.vue @@ -0,0 +1,86 @@ + + + diff --git a/app/components/app/patient/_common/select-job.vue b/app/components/app/patient/_common/select-job.vue new file mode 100644 index 00000000..b9804bb5 --- /dev/null +++ b/app/components/app/patient/_common/select-job.vue @@ -0,0 +1,155 @@ + + + diff --git a/app/components/app/patient/_common/select-lang.vue b/app/components/app/patient/_common/select-lang.vue new file mode 100644 index 00000000..aadf9313 --- /dev/null +++ b/app/components/app/patient/_common/select-lang.vue @@ -0,0 +1,82 @@ + + + diff --git a/app/components/app/patient/_common/select-marital-status.vue b/app/components/app/patient/_common/select-marital-status.vue new file mode 100644 index 00000000..cb3b56fb --- /dev/null +++ b/app/components/app/patient/_common/select-marital-status.vue @@ -0,0 +1,78 @@ + + + diff --git a/app/components/app/patient/_common/select-religion.vue b/app/components/app/patient/_common/select-religion.vue new file mode 100644 index 00000000..069e3575 --- /dev/null +++ b/app/components/app/patient/_common/select-religion.vue @@ -0,0 +1,86 @@ + + + diff --git a/app/components/app/patient/entry-form.vue b/app/components/app/patient/entry-form.vue index 7c850a16..e3587988 100644 --- a/app/components/app/patient/entry-form.vue +++ b/app/components/app/patient/entry-form.vue @@ -1,43 +1,225 @@ diff --git a/app/components/app/patient/list-cfg.ts b/app/components/app/patient/list-cfg.ts index c74ef59b..4fbdf694 100644 --- a/app/components/app/patient/list-cfg.ts +++ b/app/components/app/patient/list-cfg.ts @@ -6,53 +6,28 @@ import type { RecStrFuncUnknown, Th, } from '~/components/pub/my-ui/data/types' +import type { PatientEntity } from '~/models/patient' import { defineAsyncComponent } from 'vue' - -type SmallDetailDto = any +import { educationCodes, genderCodes } from '~/lib/constants' +import { calculateAge } from '~/lib/utils' 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 cols: Col[] = [{}, {}, {}, {}, {}, {}, {}, { width: 5 }] export const header: Th[][] = [ [ { label: 'Nama' }, - { label: 'Rekam Medis' }, - { label: 'KTP' }, + { label: 'NIK' }, { label: 'Tgl Lahir' }, { label: 'Umur' }, - { label: 'JK' }, + { label: 'Jenis Kelamin' }, { label: 'Pendidikan' }, - { label: 'Status' }, { label: '' }, ], ] -export const keys = [ - 'name', - 'medicalRecord_number', - 'identity_number', - 'birth_date', - 'patient_age', - 'gender', - 'education', - 'status', - 'action', -] +export const keys = ['name', 'identity_number', 'birth_date', 'patient_age', 'gender', 'education', 'action'] export const delKeyNames: KeyLabel[] = [ { key: 'code', label: 'Kode' }, @@ -61,42 +36,47 @@ export const delKeyNames: KeyLabel[] = [ export const funcParsed: RecStrFuncUnknown = { name: (rec: unknown): unknown => { - const recX = rec as SmallDetailDto - return `${recX.firstName} ${recX.middleName || ''} ${recX.lastName || ''}` + const { person } = rec as PatientEntity + return person.name.trim() }, identity_number: (rec: unknown): unknown => { - const recX = rec as SmallDetailDto - if (recX.identity_number?.substring(0, 5) === 'BLANK') { + const { person } = rec as PatientEntity + + if (person?.residentIdentityNumber?.substring(0, 5) === 'BLANK') { return '(TANPA NIK)' } - return recX.identity_number + return person.residentIdentityNumber }, 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) + 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 recX.birth_date + return person.birthDate }, patient_age: (rec: unknown): unknown => { - const recX = rec as SmallDetailDto - return recX.birth_date?.split('T')[0] + const { person } = rec as PatientEntity + return calculateAge(person.birthDate) }, gender: (rec: unknown): unknown => { - const recX = rec as SmallDetailDto - if (typeof recX?.gender_code !== 'number' && recX?.gender_code !== '') { - return 'Tidak Diketahui' + 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 recX.gender_code + return '-' }, 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 + 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 '-' }, @@ -111,17 +91,6 @@ export const funcComponent: RecStrFuncComponent = { } 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 = { diff --git a/app/components/app/patient/list.vue b/app/components/app/patient/list.vue index b9a74929..53558b2b 100644 --- a/app/components/app/patient/list.vue +++ b/app/components/app/patient/list.vue @@ -1,19 +1,36 @@ diff --git a/app/components/app/patient/preview.vue b/app/components/app/patient/preview.vue new file mode 100644 index 00000000..ec3d8b6d --- /dev/null +++ b/app/components/app/patient/preview.vue @@ -0,0 +1,153 @@ + + + + + diff --git a/app/components/app/person-address/_common/radio-residence.vue b/app/components/app/person-address/_common/radio-residence.vue new file mode 100644 index 00000000..f6e429a8 --- /dev/null +++ b/app/components/app/person-address/_common/radio-residence.vue @@ -0,0 +1,95 @@ + + + diff --git a/app/components/app/person-address/_common/select-district.vue b/app/components/app/person-address/_common/select-district.vue new file mode 100644 index 00000000..97b50e4e --- /dev/null +++ b/app/components/app/person-address/_common/select-district.vue @@ -0,0 +1,63 @@ + + + diff --git a/app/components/app/person-address/_common/select-postal.vue b/app/components/app/person-address/_common/select-postal.vue new file mode 100644 index 00000000..84df7b33 --- /dev/null +++ b/app/components/app/person-address/_common/select-postal.vue @@ -0,0 +1,76 @@ + + + diff --git a/app/components/app/person-address/_common/select-province.vue b/app/components/app/person-address/_common/select-province.vue new file mode 100644 index 00000000..bf984154 --- /dev/null +++ b/app/components/app/person-address/_common/select-province.vue @@ -0,0 +1,69 @@ + + + diff --git a/app/components/app/person-address/_common/select-regency.vue b/app/components/app/person-address/_common/select-regency.vue new file mode 100644 index 00000000..bb2202d3 --- /dev/null +++ b/app/components/app/person-address/_common/select-regency.vue @@ -0,0 +1,65 @@ + + + diff --git a/app/components/app/person-address/_common/select-village.vue b/app/components/app/person-address/_common/select-village.vue new file mode 100644 index 00000000..561fa9b6 --- /dev/null +++ b/app/components/app/person-address/_common/select-village.vue @@ -0,0 +1,64 @@ + + + diff --git a/app/components/app/person-address/entry-form-relative.vue b/app/components/app/person-address/entry-form-relative.vue new file mode 100644 index 00000000..1c8c91a7 --- /dev/null +++ b/app/components/app/person-address/entry-form-relative.vue @@ -0,0 +1,369 @@ + + + diff --git a/app/components/app/person-address/entry-form.vue b/app/components/app/person-address/entry-form.vue index bb10d3d4..a26381d8 100644 --- a/app/components/app/person-address/entry-form.vue +++ b/app/components/app/person-address/entry-form.vue @@ -1,171 +1,268 @@ diff --git a/app/components/app/person-contact/_common/select-contact-type.vue b/app/components/app/person-contact/_common/select-contact-type.vue new file mode 100644 index 00000000..d6f8fe24 --- /dev/null +++ b/app/components/app/person-contact/_common/select-contact-type.vue @@ -0,0 +1,71 @@ + + + diff --git a/app/components/app/person-contact/entry-form.vue b/app/components/app/person-contact/entry-form.vue index d7da4e91..5fa451b4 100644 --- a/app/components/app/person-contact/entry-form.vue +++ b/app/components/app/person-contact/entry-form.vue @@ -1,112 +1,110 @@ diff --git a/app/components/app/person-relative/_common/select-relations.vue b/app/components/app/person-relative/_common/select-relations.vue new file mode 100644 index 00000000..179976bf --- /dev/null +++ b/app/components/app/person-relative/_common/select-relations.vue @@ -0,0 +1,65 @@ + + + diff --git a/app/components/app/person-relative/_common/table-head.vue b/app/components/app/person-relative/_common/table-head.vue new file mode 100644 index 00000000..1994147e --- /dev/null +++ b/app/components/app/person-relative/_common/table-head.vue @@ -0,0 +1,22 @@ + + + diff --git a/app/components/app/person-relative/entry-form.vue b/app/components/app/person-relative/entry-form.vue index 15aea135..411fab37 100644 --- a/app/components/app/person-relative/entry-form.vue +++ b/app/components/app/person-relative/entry-form.vue @@ -1,235 +1,155 @@ diff --git a/app/components/app/person/_common/radio-parents-input.vue b/app/components/app/person/_common/radio-parents-input.vue new file mode 100644 index 00000000..bd8b6f15 --- /dev/null +++ b/app/components/app/person/_common/radio-parents-input.vue @@ -0,0 +1,94 @@ + + + diff --git a/app/components/app/person/entry-form.vue b/app/components/app/person/entry-form.vue index 24705de4..a9a9c6cf 100644 --- a/app/components/app/person/entry-form.vue +++ b/app/components/app/person/entry-form.vue @@ -1,5 +1,6 @@ + + diff --git a/app/components/app/room/entry-form.vue b/app/components/app/room/entry-form.vue new file mode 100644 index 00000000..6f4e7708 --- /dev/null +++ b/app/components/app/room/entry-form.vue @@ -0,0 +1,195 @@ + + + diff --git a/app/components/app/room/list-cfg.ts b/app/components/app/room/list-cfg.ts new file mode 100644 index 00000000..98e7eb50 --- /dev/null +++ b/app/components/app/room/list-cfg.ts @@ -0,0 +1,61 @@ +import type { + Col, + KeyLabel, + RecComponent, + RecStrFuncComponent, + RecStrFuncUnknown, + Th, +} from '~/components/pub/my-ui/data/types' +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: 50 }] + +export const header: Th[][] = [ + [ + { label: 'Kode' }, + { label: 'Nama' }, + { label: 'Spesialis' }, + { label: 'Sub Spesialis' }, + { label: 'Unit' }, + { label: '' }, + ], +] + +export const keys = ['code', 'name', 'specialist', 'subspecialist', 'unit', 'action'] + +export const delKeyNames: KeyLabel[] = [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, +] + +export const funcParsed: RecStrFuncUnknown = { + specialist: (rec: unknown): unknown => { + const recX = rec as SmallDetailDto + return recX.specialist?.name || '-' + }, + subspecialist: (rec: unknown): unknown => { + const recX = rec as SmallDetailDto + return recX.subspecialist?.name || '-' + }, + unit: (rec: unknown): unknown => { + const recX = rec as SmallDetailDto + return recX.unit?.name || '-' + }, +} + +export const funcComponent: RecStrFuncComponent = { + action(rec, idx) { + const res: RecComponent = { + idx, + rec: rec as object, + component: action, + } + return res + }, +} + +export const funcHtml: RecStrFuncUnknown = {} diff --git a/app/components/app/room/list.vue b/app/components/app/room/list.vue new file mode 100644 index 00000000..e1b056ce --- /dev/null +++ b/app/components/app/room/list.vue @@ -0,0 +1,41 @@ + + + diff --git a/app/components/app/sep/entry-form.vue b/app/components/app/sep/entry-form.vue index 9ff4c8cd..9aea7c31 100644 --- a/app/components/app/sep/entry-form.vue +++ b/app/components/app/sep/entry-form.vue @@ -7,7 +7,7 @@ import * as z from 'zod' import { Button } from '~/components/pub/ui/button' import { Input } from '~/components/pub/ui/input' import { Label } from '~/components/pub/ui/label' -import { Select } from '~/components/pub/ui/select' +import Select from '~/components/pub/ui/select/Select.vue' import { RadioGroup, RadioGroupItem } from '~/components/pub/ui/radio-group' import { Textarea } from '~/components/pub/ui/textarea' import DatepickerSingle from '~/components/pub/my-ui/form/datepicker-single.vue' diff --git a/app/components/app/soapi/early-entry.vue b/app/components/app/soapi/early-entry.vue new file mode 100644 index 00000000..c5697a7a --- /dev/null +++ b/app/components/app/soapi/early-entry.vue @@ -0,0 +1,222 @@ + + +