fix: update encounter payment method
This commit is contained in:
@@ -49,7 +49,6 @@ model.value = genEncounter()
|
||||
|
||||
// Common preparation
|
||||
const defaultCBItems = [{ label: 'Pilih', value: '' }]
|
||||
const paymentMethodItems = ref<any>({})
|
||||
|
||||
// Emit preparation
|
||||
const emit = defineEmits<{
|
||||
@@ -84,21 +83,21 @@ const sepTrafficStatus = ref('')
|
||||
const diagnosis = ref('')
|
||||
const noteReference = ref('Hanya diperlukan jika pembayaran jenis JKN')
|
||||
const noteFile = ref('Gunakan file [.pdf, .jpg, .png] dengan ukuran maksimal 1MB')
|
||||
|
||||
const mode = props.mode !== undefined ? props.mode : 'add'
|
||||
const isLoading = props.isLoading !== undefined ? props.isLoading : false
|
||||
const isReadonly = props.isReadonly !== undefined ? props.isReadonly : false
|
||||
const mode = props.mode !== undefined ? props.mode : 'add'
|
||||
// SEP validation state from props
|
||||
const isSepValid = computed(() => props.isSepValid || false)
|
||||
const isSepValid = computed(() => props.isSepValid || false) // SEP validation state from props
|
||||
const isCheckingSep = computed(() => props.isCheckingSep || false)
|
||||
const isInsurancePayment = computed(() => ['insurance', 'jkn'].includes(paymentMethodCode.value))
|
||||
const isDateLoading = ref(false)
|
||||
const isUsePaymentNew = true
|
||||
const debouncedSepNumber = refDebounced(sepNumber, 500)
|
||||
const debouncedCardNumber = refDebounced(cardNumber, 500)
|
||||
const sepFileReview = ref<any>(null)
|
||||
const sippFileReview = ref<any>(null)
|
||||
const unitFullName = ref('') // Unit, specialist, subspecialist
|
||||
const formRef = ref<HTMLFormElement | null>(null) // Expose submit method for parent component
|
||||
const paymentMethodItems = isUsePaymentNew ? props.payments : CB.recStrToItem(paymentMethodCodes)
|
||||
|
||||
if (mode === 'add') {
|
||||
// Set default sepDate to current date in YYYY-MM-DD format
|
||||
@@ -236,11 +235,6 @@ function submitForm() {
|
||||
defineExpose({
|
||||
submitForm,
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
const isPaymentMethodVclaim = true
|
||||
paymentMethodItems.value = isPaymentMethodVclaim ? props.payments : CB.recStrToItem(paymentMethodCodes)
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -393,9 +387,6 @@ onMounted(() => {
|
||||
:colCount="3"
|
||||
:cellFlex="false"
|
||||
>
|
||||
{{ JSON.stringify(paymentMethodCode) }}
|
||||
{{ JSON.stringify(paymentMethodItems, null, 2) }}
|
||||
{{ JSON.stringify(payments, null, 2) }}
|
||||
<DE.Cell>
|
||||
<DE.Label height="compact">
|
||||
Jenis Pembayaran
|
||||
@@ -406,18 +397,10 @@ onMounted(() => {
|
||||
id="paymentMethodCode"
|
||||
v-model="paymentMethodCode"
|
||||
v-bind="paymentMethodCodeAttrs"
|
||||
:items="payments as any"
|
||||
:items="paymentMethodItems as any"
|
||||
:disabled="isLoading || isReadonly"
|
||||
placeholder="Pilih Jenis Pembayaran"
|
||||
/>
|
||||
<!-- <CB.Combobox
|
||||
id="paymentMethodCode"
|
||||
v-model="paymentMethodCode"
|
||||
v-bind="paymentMethodCodeAttrs"
|
||||
:items="paymentMethodItems"
|
||||
:disabled="isLoading || isReadonly"
|
||||
placeholder="Pilih Jenis Pembayaran"
|
||||
/> -->
|
||||
</DE.Field>
|
||||
</DE.Cell>
|
||||
</DE.Block>
|
||||
|
||||
@@ -75,6 +75,7 @@ export function useEncounterEntry(props: {
|
||||
const isSaveDisabled = computed(() => {
|
||||
return !selectedPatient.value || !selectedPatientObject.value || isSaving.value || isLoadingDetail.value
|
||||
})
|
||||
const isUsePaymentNew = true
|
||||
|
||||
function getListPath(): string {
|
||||
if (props.classCode === 'ambulatory') {
|
||||
@@ -436,7 +437,7 @@ export function useEncounterEntry(props: {
|
||||
formData.registerDate = date.toISOString().split('T')[0]
|
||||
}
|
||||
|
||||
if (encounter.paymentMethod_code) {
|
||||
if (!isUsePaymentNew && encounter.paymentMethod_code) {
|
||||
formData.paymentMethodCode = encounter.paymentMethod_code
|
||||
if (encounter.paymentMethod_code === 'insurance') {
|
||||
formData.paymentType = 'jkn'
|
||||
@@ -449,7 +450,7 @@ export function useEncounterEntry(props: {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
formData.paymentType = 'spm'
|
||||
formData.paymentType = encounter.paymentMethod_code
|
||||
}
|
||||
|
||||
formData.cardNumber = encounter.member_number || ''
|
||||
@@ -520,7 +521,7 @@ export function useEncounterEntry(props: {
|
||||
sippFile.value = formValues.sippFile || null
|
||||
|
||||
let paymentMethodCode = formValues.paymentMethod_code ?? null
|
||||
if (!paymentMethodCode) {
|
||||
if (!isUsePaymentNew && !paymentMethodCode) {
|
||||
if (formValues.paymentType === 'jkn' || formValues.paymentType === 'jkmm') {
|
||||
paymentMethodCode = 'insurance'
|
||||
} else if (formValues.paymentType === 'spm') {
|
||||
|
||||
@@ -56,72 +56,35 @@ const VaccineDataListAsync = defineAsyncComponent(() => import('~/components/con
|
||||
const InitialNursingStudyAsync = defineAsyncComponent(() => import('~/components/content/initial-nursing/entry.vue'))
|
||||
|
||||
const defaultKeys: Record<string, any> = {
|
||||
status: 'status',
|
||||
earlyNurseryAssessment: 'early-nursery-assessment',
|
||||
earlyMedicalAssessment: 'early-medical-assessment',
|
||||
earlyMedicalRehabAssessment: 'early-medical-rehab-assessment',
|
||||
functionAssessment: 'function-assessment',
|
||||
therapyProtocol: 'therapy-protocol',
|
||||
chemotherapyProtocol: 'chemotherapy-protocol',
|
||||
chemotherapyMedicine: 'chemotherapy-medicine',
|
||||
educationAssessment: 'education-assessment',
|
||||
generalConsent: 'general-consent',
|
||||
patientAmbNote: 'patient-amb-note',
|
||||
patientDevNote: 'patient-dev-note',
|
||||
prescription: 'prescription',
|
||||
deviceOrder: 'device-order',
|
||||
radiologyOrder: 'radiology-order',
|
||||
cpLabOrder: 'cp-lab-order',
|
||||
microLabOrder: 'micro-lab-order',
|
||||
paLabOrder: 'pa-lab-order',
|
||||
procedureRoomOrder: 'procedure-room-order',
|
||||
mcuResult: 'mcu-result',
|
||||
actionReport: 'action-report',
|
||||
surgeryReport: 'surgery-report',
|
||||
vaccineData: 'vaccine-data',
|
||||
consultation: 'consultation',
|
||||
controlLetter: 'control-letter',
|
||||
inpatientLetter: 'inpatient-letter',
|
||||
fkr: 'fkr',
|
||||
refBack: 'reference-back',
|
||||
screening: 'screening',
|
||||
supportingDocument: 'supporting-document',
|
||||
resume: 'resume',
|
||||
ambResume: 'amb-resume',
|
||||
priceList: 'price-list',
|
||||
initialNursingStudy: 'initial-nursing-study',
|
||||
}
|
||||
|
||||
const defaultMenus: Record<string, any> = {
|
||||
status: {
|
||||
id: defaultKeys.status,
|
||||
id: 'status',
|
||||
title: 'Status Masuk/Keluar',
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
},
|
||||
// NOTE : HIDDEN UNTIL IT IS READY
|
||||
// earlyNurseryAssessment: {
|
||||
// id: defaultKeys.earlyNurseryAssessment,
|
||||
// id: 'early-nursery-assessment',
|
||||
// title: 'Pengkajian Awal Keperawatan',
|
||||
// classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
// unit: 'all',
|
||||
// },
|
||||
earlyMedicalAssessment: {
|
||||
id: defaultKeys.earlyMedicalAssessment,
|
||||
id: 'early-medical-assessment',
|
||||
title: 'Pengkajian Awal Medis',
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
afterId: 'early-medical-assessment',
|
||||
},
|
||||
earlyMedicalRehabAssessment: {
|
||||
id: defaultKeys.earlyMedicalRehabAssessment,
|
||||
id: 'rehab-medical-assessment',
|
||||
title: 'Pengkajian Awal Medis Rehabilitasi Medis',
|
||||
classCode: ['ambulatory'],
|
||||
unit: 'rehab',
|
||||
afterId: defaultKeys.earlyMedicalAssessment,
|
||||
afterId: 'early-medical-assessment',
|
||||
},
|
||||
fkr: {
|
||||
id: defaultKeys.fkr,
|
||||
id: 'fkr',
|
||||
title: 'FKR',
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
@@ -142,165 +105,165 @@ const defaultMenus: Record<string, any> = {
|
||||
// afterId: 'function-assessment',
|
||||
// },
|
||||
chemotherapyProtocol: {
|
||||
id: defaultKeys.chemotherapyProtocol,
|
||||
id: 'chemotherapy-protocol',
|
||||
title: 'Protokol Kemoterapi',
|
||||
classCode: ['ambulatory'],
|
||||
unit: 'chemo',
|
||||
afterId: defaultKeys.earlyMedicalAssessment,
|
||||
afterId: 'early-medical-assessment',
|
||||
},
|
||||
chemotherapyMedicine: {
|
||||
id: 'chemotherapy-medicine',
|
||||
title: 'Protokol Obat Kemoterapi',
|
||||
classCode: ['ambulatory'],
|
||||
unit: 'chemo',
|
||||
afterId: defaultKeys.chemotherapyProtocol,
|
||||
afterId: 'chemotherapy-protocol',
|
||||
},
|
||||
educationAssessment: {
|
||||
id: defaultKeys.educationAssessment,
|
||||
id: 'education-assessment',
|
||||
title: 'Asesmen Kebutuhan Edukasi',
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
},
|
||||
generalConsent: {
|
||||
id: defaultKeys.generalConsent,
|
||||
id: 'general-consent',
|
||||
title: 'General Consent',
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
},
|
||||
patientAmbNote: {
|
||||
id: defaultKeys.patientAmbNote,
|
||||
id: 'patient-amb-note',
|
||||
title: 'CPRJ',
|
||||
classCode: ['ambulatory', 'emergency'],
|
||||
unit: 'all',
|
||||
},
|
||||
patientDevNote: {
|
||||
id: defaultKeys.patientDevNote,
|
||||
id: 'patient-dev-note',
|
||||
title: 'CPP',
|
||||
classCode: ['inpatient'],
|
||||
unit: 'all',
|
||||
},
|
||||
prescription: {
|
||||
id: defaultKeys.prescription,
|
||||
id: 'prescription',
|
||||
title: 'Order Obat',
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
},
|
||||
deviceOrder: {
|
||||
id: defaultKeys.deviceOrder,
|
||||
id: 'device-order',
|
||||
title: 'Order Alkes',
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
},
|
||||
radiologyOrder: {
|
||||
id: defaultKeys.radiologyOrder,
|
||||
id: 'radiology-order',
|
||||
title: 'Order Radiologi',
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
},
|
||||
cpLabOrder: {
|
||||
id: defaultKeys.cpLabOrder,
|
||||
id: 'cp-lab-order',
|
||||
title: 'Order Lab PK',
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
},
|
||||
microLabOrder: {
|
||||
id: defaultKeys.microLabOrder,
|
||||
id: 'micro-lab-order',
|
||||
title: 'Order Lab Mikro',
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
},
|
||||
paLabOrder: {
|
||||
id: defaultKeys.paLabOrder,
|
||||
id: 'pa-lab-order',
|
||||
title: 'Order Lab PA',
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
},
|
||||
procedureRoomOrder: {
|
||||
id: defaultKeys.procedureRoomOrder,
|
||||
id: 'procedure-room-order',
|
||||
title: 'Order Ruang Tindakan',
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
},
|
||||
mcuResult: {
|
||||
id: defaultKeys.mcuResult,
|
||||
id: 'mcu-result',
|
||||
title: 'Hasil Penunjang',
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
},
|
||||
actionReport: {
|
||||
id: defaultKeys.actionReport,
|
||||
id: 'action-report',
|
||||
title: 'Laporan Tindakan',
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
},
|
||||
surgeryReport: {
|
||||
id: defaultKeys.surgeryReport,
|
||||
id: 'surgery-report',
|
||||
title: 'Laporan Operasi',
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
},
|
||||
vaccineData: {
|
||||
id: defaultKeys.vaccineData,
|
||||
id: 'vaccine-data',
|
||||
title: 'Data Vaksin',
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
},
|
||||
consultation: {
|
||||
id: defaultKeys.consultation,
|
||||
id: 'consultation',
|
||||
title: 'Konsultasi',
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
},
|
||||
controlLetter: {
|
||||
id: defaultKeys.controlLetter,
|
||||
id: 'control-letter',
|
||||
title: 'Surat Kontrol',
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
},
|
||||
inpatientLetter: {
|
||||
id: defaultKeys.inpatientLetter,
|
||||
id: 'inpatient-letter',
|
||||
title: 'SPRI',
|
||||
classCode: ['ambulatory', 'emergency'],
|
||||
unit: 'all',
|
||||
},
|
||||
refBack: {
|
||||
id: defaultKeys.refBack,
|
||||
id: 'reference-back',
|
||||
title: 'PRB',
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
},
|
||||
screening: {
|
||||
id: defaultKeys.screening,
|
||||
id: 'screening',
|
||||
title: 'Skrinning MPP',
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
},
|
||||
supportingDocument: {
|
||||
id: defaultKeys.supportingDocument,
|
||||
id: 'supporting-document',
|
||||
title: 'Upload Dokumen Pendukung',
|
||||
classCode: ['ambulatory'],
|
||||
unit: 'all',
|
||||
},
|
||||
resume: {
|
||||
id: defaultKeys.resume,
|
||||
id: 'resume',
|
||||
title: 'Resume',
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
},
|
||||
ambResume: {
|
||||
id: defaultKeys.ambResume,
|
||||
id: 'amb-resume',
|
||||
title: 'Resume Medis Rawat Jalan',
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
},
|
||||
priceList: {
|
||||
id: defaultKeys.priceList,
|
||||
id: 'price-list',
|
||||
title: 'Tarif Tindakan',
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
},
|
||||
initialNursingStudy: {
|
||||
id: defaultKeys.initialNursingStudy,
|
||||
id: 'initial-nursing-study',
|
||||
title: 'Kajian Awal Keperawatan',
|
||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||
unit: 'all',
|
||||
@@ -338,7 +301,7 @@ export function insertItemByAfterId(id: string, items: EncounterItem[], newItem:
|
||||
}
|
||||
|
||||
export function injectComponents(id: string | number, data: EncounterListData, meta: EncounterListData) {
|
||||
const currentKeys = { ...defaultMenus }
|
||||
const currentKeys = { ...defaultKeys }
|
||||
if (currentKeys?.status) {
|
||||
currentKeys.status['component'] = StatusAsync
|
||||
currentKeys.status['props'] = { encounter: data?.encounter }
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { isValid } from "date-fns"
|
||||
import { z } from 'zod'
|
||||
|
||||
const ERROR_MESSAGES = {
|
||||
@@ -16,6 +17,7 @@ const ERROR_MESSAGES = {
|
||||
}
|
||||
|
||||
const ACCEPTED_UPLOAD_TYPES = ['image/jpeg', 'image/png', 'application/pdf']
|
||||
const isValidationSep = false
|
||||
|
||||
const IntegrationEncounterSchema = z
|
||||
.object({
|
||||
@@ -116,7 +118,7 @@ const IntegrationEncounterSchema = z
|
||||
.refine(
|
||||
(data) => {
|
||||
// If payment type is jkn and SEP type is selected, then SEP number is required
|
||||
if (data.paymentMethod_code === 'jkn' && data.sepType && data.sepType.trim() !== '') {
|
||||
if (isValidationSep && data.paymentMethod_code === 'jkn' && data.sepType && data.sepType.trim() !== '') {
|
||||
return data.sepNumber && data.sepNumber.trim() !== ''
|
||||
}
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user