feat(encounter): update encounter permissions and enhance entry form handling
This commit is contained in:
@@ -128,17 +128,20 @@ async function handleSaveEncounter(formValues: any) {
|
|||||||
visitDate: formatDate(formValues.registerDate),
|
visitDate: formatDate(formValues.registerDate),
|
||||||
class_code: props.classCode || '',
|
class_code: props.classCode || '',
|
||||||
subClass_code: props.subClassCode || '',
|
subClass_code: props.subClassCode || '',
|
||||||
infra_id: 0,
|
infra_id: null,
|
||||||
unit_id: 0,
|
unit_id: null,
|
||||||
appointment_doctor_id: Number(formValues.doctorId),
|
appointment_doctor_id: Number(formValues.doctorId),
|
||||||
responsible_doctor_id: Number(formValues.doctorId),
|
responsible_doctor_id: Number(formValues.doctorId),
|
||||||
paymentType: formValues.paymentType,
|
paymentType: formValues.paymentType,
|
||||||
cardNumber: formValues.cardNumber,
|
cardNumber: formValues.cardNumber,
|
||||||
adm_employee_id: employeeId,
|
|
||||||
refSource_name: '',
|
refSource_name: '',
|
||||||
appointment_id: null,
|
appointment_id: null,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (employeeId && employeeId > 0) {
|
||||||
|
payload.adm_employee_id = employeeId
|
||||||
|
}
|
||||||
|
|
||||||
// Add specialist_id and subspecialist_id if available
|
// Add specialist_id and subspecialist_id if available
|
||||||
if (specialist_id) {
|
if (specialist_id) {
|
||||||
payload.specialist_id = specialist_id
|
payload.specialist_id = specialist_id
|
||||||
@@ -149,7 +152,7 @@ async function handleSaveEncounter(formValues: any) {
|
|||||||
|
|
||||||
if (formValues.paymentType === 'jkn') {
|
if (formValues.paymentType === 'jkn') {
|
||||||
payload.paymentMethod_code = 'insurance'
|
payload.paymentMethod_code = 'insurance'
|
||||||
payload.insuranceCompany_id = 0
|
payload.insuranceCompany_id = null
|
||||||
payload.member_number = formValues.cardNumber
|
payload.member_number = formValues.cardNumber
|
||||||
payload.ref_number = formValues.sepNumber
|
payload.ref_number = formValues.sepNumber
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,30 @@ export const PAGE_PERMISSIONS = {
|
|||||||
billing: ['R'],
|
billing: ['R'],
|
||||||
management: ['R'],
|
management: ['R'],
|
||||||
},
|
},
|
||||||
|
'/outpatient/encounter': {
|
||||||
|
doctor: ['C', 'R', 'U', 'D'],
|
||||||
|
nurse: ['C', 'R', 'U', 'D'],
|
||||||
|
admisi: ['R'],
|
||||||
|
pharmacy: ['R'],
|
||||||
|
billing: ['R'],
|
||||||
|
management: ['R'],
|
||||||
|
},
|
||||||
|
'/emergency/encounter': {
|
||||||
|
doctor: ['C', 'R', 'U', 'D'],
|
||||||
|
nurse: ['C', 'R', 'U', 'D'],
|
||||||
|
admisi: ['R'],
|
||||||
|
pharmacy: ['R'],
|
||||||
|
billing: ['R'],
|
||||||
|
management: ['R'],
|
||||||
|
},
|
||||||
|
'/inpatient/encounter': {
|
||||||
|
doctor: ['C', 'R', 'U', 'D'],
|
||||||
|
nurse: ['C', 'R', 'U', 'D'],
|
||||||
|
admisi: ['R'],
|
||||||
|
pharmacy: ['R'],
|
||||||
|
billing: ['R'],
|
||||||
|
management: ['R'],
|
||||||
|
},
|
||||||
'/rehab/encounter': {
|
'/rehab/encounter': {
|
||||||
doctor: ['C', 'R', 'U', 'D'],
|
doctor: ['C', 'R', 'U', 'D'],
|
||||||
nurse: ['R'],
|
nurse: ['R'],
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ useHead({
|
|||||||
title: () => `${route.meta.title}`, // backtick to avoid the ts-plugin(2322) warning
|
title: () => `${route.meta.title}`, // backtick to avoid the ts-plugin(2322) warning
|
||||||
})
|
})
|
||||||
|
|
||||||
const roleAccess: PagePermission = PAGE_PERMISSIONS['/rehab/encounter']
|
const roleAccess: PagePermission = PAGE_PERMISSIONS['/emergency/encounter']
|
||||||
|
|
||||||
const { checkRole, hasCreateAccess } = useRBAC()
|
const { checkRole, hasCreateAccess } = useRBAC()
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ useHead({
|
|||||||
title: () => route.meta.title as string,
|
title: () => route.meta.title as string,
|
||||||
})
|
})
|
||||||
|
|
||||||
const roleAccess: PagePermission = PAGE_PERMISSIONS['/rehab/encounter']
|
const roleAccess: PagePermission = PAGE_PERMISSIONS['/emergency/encounter']
|
||||||
|
|
||||||
const { checkRole, hasReadAccess } = useRBAC()
|
const { checkRole, hasReadAccess } = useRBAC()
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ useHead({
|
|||||||
title: () => `${route.meta.title}`, // backtick to avoid the ts-plugin(2322) warning
|
title: () => `${route.meta.title}`, // backtick to avoid the ts-plugin(2322) warning
|
||||||
})
|
})
|
||||||
|
|
||||||
const roleAccess: PagePermission = PAGE_PERMISSIONS['/rehab/encounter']
|
const roleAccess: PagePermission = PAGE_PERMISSIONS['/inpatient/encounter']
|
||||||
|
|
||||||
const { checkRole, hasCreateAccess } = useRBAC()
|
const { checkRole, hasCreateAccess } = useRBAC()
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ useHead({
|
|||||||
title: () => route.meta.title as string,
|
title: () => route.meta.title as string,
|
||||||
})
|
})
|
||||||
|
|
||||||
const roleAccess: PagePermission = PAGE_PERMISSIONS['/rehab/encounter']
|
const roleAccess: PagePermission = PAGE_PERMISSIONS['/inpatient/encounter']
|
||||||
|
|
||||||
const { checkRole, hasReadAccess } = useRBAC()
|
const { checkRole, hasReadAccess } = useRBAC()
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ useHead({
|
|||||||
title: () => `${route.meta.title}`, // backtick to avoid the ts-plugin(2322) warning
|
title: () => `${route.meta.title}`, // backtick to avoid the ts-plugin(2322) warning
|
||||||
})
|
})
|
||||||
|
|
||||||
const roleAccess: PagePermission = PAGE_PERMISSIONS['/rehab/encounter']
|
const roleAccess: PagePermission = PAGE_PERMISSIONS['/outpatient/encounter']
|
||||||
|
|
||||||
const { checkRole, hasCreateAccess } = useRBAC()
|
const { checkRole, hasCreateAccess } = useRBAC()
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ useHead({
|
|||||||
title: () => route.meta.title as string,
|
title: () => route.meta.title as string,
|
||||||
})
|
})
|
||||||
|
|
||||||
const roleAccess: PagePermission = PAGE_PERMISSIONS['/rehab/encounter']
|
const roleAccess: PagePermission = PAGE_PERMISSIONS['/outpatient/encounter']
|
||||||
|
|
||||||
const { checkRole, hasReadAccess } = useRBAC()
|
const { checkRole, hasReadAccess } = useRBAC()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user