fix: reload doctor fetch

This commit is contained in:
riefive
2025-12-03 15:54:57 +07:00
parent 5059f24c60
commit f94e8df57f
2 changed files with 34 additions and 31 deletions
+3 -11
View File
@@ -9,10 +9,8 @@ import AppViewHistory from '~/components/app/sep/view-history.vue'
import { refDebounced } from '@vueuse/core'
// Handlers
import { getDetail as getDoctorDetail } from '~/services/doctor.service'
import { useEncounterEntry } from '~/handlers/encounter-entry.handler'
import { useIntegrationSepEntry } from '~/handlers/integration-sep-entry.handler'
import { genDoctor, type Doctor } from '~/models/doctor'
// Props
const props = defineProps<{
@@ -42,6 +40,7 @@ const {
isSaveDisabled,
isLoading,
patients,
selectedDoctor,
selectedPatient,
selectedPatientObject,
paginationMeta,
@@ -53,7 +52,8 @@ const {
getPatientsList,
getPatientCurrent,
getPatientByIdentifierSearch,
getIsSubspecialist,
// getIsSubspecialist,
getDoctorInfo,
getValidateMember,
getValidateSepNumber,
handleFetchDoctors,
@@ -61,16 +61,8 @@ const {
const { recSepId, openHistory, histories, getMonitoringHistoryMappers } = useIntegrationSepEntry()
const debouncedSepNumber = refDebounced(sepNumber, 500)
const selectedDoctor = ref<Doctor>(genDoctor())
///// 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(() => {