diff --git a/app/components/app/encounter/quick-info.vue b/app/components/app/encounter/quick-info.vue index 17e1053b..4705264b 100644 --- a/app/components/app/encounter/quick-info.vue +++ b/app/components/app/encounter/quick-info.vue @@ -7,17 +7,37 @@ const props = defineProps<{ data: Encounter }>() -let address = ref('') -if (props.data.patient.person.addresses) { - address.value = props.data.patient.person.addresses.map((a) => a.address).join(', ') -} +const addressText = computed(() => { + if (props.data.patient.person.addresses && props.data.patient.person.addresses.length > 0) { + return props.data.patient.person.addresses.map((a) => a.address).join(', ') + } + return '-' +}) -let dpjp = ref('') +const paymentMethodText = computed(() => { + const code = props.data.paymentMethod_code + if (!code) return '-' + + // Map payment method codes + if (code === 'insurance') { + return 'JKN' + } else if (code === 'jkn') { + return 'JKN' + } else if (code === 'jkmm') { + return 'JKMM' + } else if (code === 'spm') { + return 'SPM' + } else if (code === 'pks') { + return 'PKS' + } +}) + +let dpjpText = ref('') if (props.data.responsible_doctor) { const dp = props.data.responsible_doctor.employee.person - dpjp.value = `${dp.frontTitle} ${dp.name} ${dp.endTitle}` + dpjpText.value = `${dp.frontTitle} ${dp.name} ${dp.endTitle}` } else if (props.data.appointment_doctor) { - dpjp.value = props.data.appointment_doctor.employee.person.name + dpjpText.value = props.data.appointment_doctor.employee.person.name } @@ -31,7 +51,7 @@ if (props.data.responsible_doctor) {