fix: solve entry on encounter

This commit is contained in:
riefive
2025-12-03 10:06:51 +07:00
parent e8c15e189f
commit 42bb79554f
2 changed files with 59 additions and 209 deletions
+8 -36
View File
@@ -11,11 +11,8 @@ import { refDebounced } from '@vueuse/core'
// Handlers
import { getDetail as getDoctorDetail } from '~/services/doctor.service'
import { useEncounterEntry } from '~/handlers/encounter-entry.handler'
<<<<<<< HEAD
import { useIntegrationSepEntry } from '~/handlers/integration-sep-entry.handler'
=======
import { genDoctor, type Doctor } from '~/models/doctor'
>>>>>>> 9a8ee9d90f669a5395b14107d86d9f788118fa92
// Props
const props = defineProps<{
@@ -66,31 +63,14 @@ const { recSepId, openHistory, histories, getMonitoringHistoryMappers } = useInt
const debouncedSepNumber = refDebounced(sepNumber, 500)
const selectedDoctor = ref<Doctor>(genDoctor())
provide('rec_select_id', recSelectId)
provide('table_data_loader', isLoading)
watch(debouncedSepNumber, async (newValue) => {
await getValidateSepNumber(newValue)
})
watch(
() => formObjects.value?.paymentType,
(newValue) => {
isSepValid.value = false
if (newValue !== 'jkn') {
sepNumber.value = ''
}
},
)
onMounted(async () => {
await handleInit()
if (props.id > 0) {
await loadEncounterDetail()
}
})
///// Functions
async function getDoctorInfo(value: string) {
const resp = await getDoctorDetail(value, { includes: 'unit,specialist,subspecialist'})
if (resp.success) {
selectedDoctor.value = resp.body.data
}
}
function handleSavePatient() {
selectedPatientObject.value = null
setTimeout(() => {
@@ -152,7 +132,6 @@ async function handleEvent(menu: string, value?: any) {
}
}
<<<<<<< HEAD
provide('rec_select_id', recSelectId)
provide('rec_sep_id', recSepId)
provide('table_data_loader', isLoading)
@@ -184,15 +163,8 @@ onMounted(async () => {
await handleInit()
if (props.formType === 'edit' && props.id > 0) {
await getFetchEncounterDetail()
=======
async function getDoctorInfo(value: string) {
const resp = await getDoctorDetail(value, { includes: 'unit,specialist,subspecialist'})
if (resp.success) {
selectedDoctor.value = resp.body.data
// console.log(selectedDoctor.value)
>>>>>>> 9a8ee9d90f669a5395b14107d86d9f788118fa92
}
}
})
</script>
<template>