feat/page-cleaning: adjust add encounter

This commit is contained in:
Andrian Roshandy
2025-12-02 10:02:00 +07:00
parent d221203bd5
commit 88a2dc5aba
9 changed files with 779 additions and 224 deletions
+15 -17
View File
@@ -70,18 +70,18 @@ export function useEncounterEntry(props: {
})
function getListPath(): string {
if (props.classCode === 'ambulatory' && props.subClassCode === 'rehab') {
return '/rehab/encounter'
}
if (props.classCode === 'ambulatory' && props.subClassCode === 'reg') {
return '/outpatient/encounter'
}
if (props.classCode === 'emergency') {
return '/emergency/encounter'
}
if (props.classCode === 'inpatient') {
return '/inpatient/encounter'
if (props.classCode === 'ambulatory') {
return '/ambulatory/encounter'
}
// if (props.classCode === 'ambulatory' && props.subClassCode === 'reg') {
// return '/outpatient/encounter'
// }
// if (props.classCode === 'emergency') {
// return '/emergency/encounter'
// }
// if (props.classCode === 'inpatient') {
// return '/inpatient/encounter'
// }
return '/encounter'
}
@@ -257,11 +257,10 @@ export function useEncounterEntry(props: {
async function handleFetchDoctors(subSpecialistId: string | null = null) {
try {
const filterParams: any = { 'page-size': 100, includes: 'employee-Person' }
const filterParams: any = { 'page-size': 100, includes: 'employee-Person,unit,specialist,subspecialist' }
if (!subSpecialistId) {
const doctors = await getDoctorValueLabelList(filterParams, true)
doctorsList.value = doctors
doctorsList.value = await getDoctorValueLabelList(filterParams, true)
return
}
@@ -273,8 +272,7 @@ export function useEncounterEntry(props: {
filterParams['specialist-id'] = subSpecialistId
}
const doctors = await getDoctorValueLabelList(filterParams, true)
doctorsList.value = doctors
doctorsList.value = await getDoctorValueLabelList(filterParams, true)
} catch (error) {
console.error('Error fetching doctors:', error)
doctorsList.value = []
@@ -497,7 +495,7 @@ export function useEncounterEntry(props: {
if (paymentMethodCode) {
payload.paymentMethod_code = paymentMethodCode
}
if (paymentMethodCode === 'insurance') {
payload.insuranceCompany_id = formValues.insuranceCompany_id ?? null
if (memberNumber) payload.member_number = memberNumber