diff --git a/app/components/app/document-upload/_common/select-doc-type.vue b/app/components/app/document-upload/_common/select-doc-type.vue index 0e86f596..70f78a7b 100644 --- a/app/components/app/document-upload/_common/select-doc-type.vue +++ b/app/components/app/document-upload/_common/select-doc-type.vue @@ -2,7 +2,7 @@ import type { FormErrors } from '~/types/error' import Combobox from '~/components/pub/my-ui/combobox/combobox.vue' import { cn, mapToComboboxOptList } from '~/lib/utils' -import { supportingDocTypeCode, supportingDocOpt, type supportingDocTypeCodeKey } from '~/lib/constants' +import { docTypeCode, supportingDocOpt, type docTypeCodeKey } from '~/lib/constants' import { getValueLabelList as getDoctorLabelList } from '~/services/doctor.service' import { getValueLabelList as getUnitLabelList } from '~/services/unit.service' diff --git a/app/components/app/document-upload/list.cfg.ts b/app/components/app/document-upload/list.cfg.ts index 508ad3ea..7f275d31 100644 --- a/app/components/app/document-upload/list.cfg.ts +++ b/app/components/app/document-upload/list.cfg.ts @@ -1,5 +1,6 @@ import type { Config } from '~/components/pub/my-ui/data-table' import { defineAsyncComponent } from 'vue' +import { docTypeCode, docTypeLabel, type docTypeCodeKey } from '~/lib/constants' const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dd.vue')) @@ -22,6 +23,10 @@ export const config: Config = { ], parses: { + type_code: (v: unknown) => { + console.log(v) + return docTypeLabel[v as docTypeCodeKey] + }, }, components: { diff --git a/app/lib/constants.ts b/app/lib/constants.ts index 430b2902..48fb5c8c 100644 --- a/app/lib/constants.ts +++ b/app/lib/constants.ts @@ -405,17 +405,21 @@ export const encounterDocOpt: { label: string; value: encounterDocTypeCodeKey }[ ] -export const supportingDocTypeCode = { +export const docTypeCode = { "encounter-patient": 'encounter-patient', "encounter-support": 'encounter-support', "encounter-other": 'encounter-other', + "vclaim-sep": 'vclaim-sep', + "vclaim-sipp": 'vclaim-sipp', } as const -export const supportingDocTypeLabel = { +export const docTypeLabel = { "encounter-patient": 'Data Pasien', "encounter-support": 'Data Penunjang', "encounter-other": 'Lain - Lain', + "vclaim-sep": 'SEP', + "vclaim-sipp": 'SIPP', } as const -export type supportingDocTypeCodeKey = keyof typeof supportingDocTypeCode +export type docTypeCodeKey = keyof typeof docTypeCode export const supportingDocOpt = [ { label: 'Data Pasien', value: 'encounter-patient' }, { label: 'Data Penunjang', value: 'encounter-support' }, diff --git a/app/models/encounter-document.ts b/app/models/encounter-document.ts index c4f9898c..5a98ccd5 100644 --- a/app/models/encounter-document.ts +++ b/app/models/encounter-document.ts @@ -1,5 +1,5 @@ import { type Base, genBase } from "./_base" -import { supportingDocOpt, supportingDocTypeCode, supportingDocTypeLabel, type supportingDocTypeCodeKey } from '~/lib/constants' +import { docTypeLabel, } from '~/lib/constants' import { genEmployee, type Employee } from "./employee" import { genEncounter, type Encounter } from "./encounter" @@ -21,7 +21,7 @@ export function genEncounterDocument(): EncounterDocument { encounter: genEncounter(), upload_employee_id: 0, employee: genEmployee(), - type_code: supportingDocTypeLabel["encounter-patient"], + type_code: docTypeLabel["encounter-patient"], name: 'example', filePath: 'https://bing.com', fileName: 'example',