feat(encounter): update encounter permissions and enhance entry form handling

This commit is contained in:
riefive
2025-11-09 18:36:15 +07:00
parent 9fad8f4123
commit 5e309801ed
8 changed files with 37 additions and 10 deletions
+7 -4
View File
@@ -128,17 +128,20 @@ async function handleSaveEncounter(formValues: any) {
visitDate: formatDate(formValues.registerDate),
class_code: props.classCode || '',
subClass_code: props.subClassCode || '',
infra_id: 0,
unit_id: 0,
infra_id: null,
unit_id: null,
appointment_doctor_id: Number(formValues.doctorId),
responsible_doctor_id: Number(formValues.doctorId),
paymentType: formValues.paymentType,
cardNumber: formValues.cardNumber,
adm_employee_id: employeeId,
refSource_name: '',
appointment_id: null,
}
if (employeeId && employeeId > 0) {
payload.adm_employee_id = employeeId
}
// Add specialist_id and subspecialist_id if available
if (specialist_id) {
payload.specialist_id = specialist_id
@@ -149,7 +152,7 @@ async function handleSaveEncounter(formValues: any) {
if (formValues.paymentType === 'jkn') {
payload.paymentMethod_code = 'insurance'
payload.insuranceCompany_id = 0
payload.insuranceCompany_id = null
payload.member_number = formValues.cardNumber
payload.ref_number = formValues.sepNumber
}
+24
View File
@@ -25,6 +25,30 @@ export const PAGE_PERMISSIONS = {
billing: ['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': {
doctor: ['C', 'R', 'U', 'D'],
nurse: ['R'],
@@ -16,7 +16,7 @@ useHead({
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()
@@ -16,7 +16,7 @@ useHead({
title: () => route.meta.title as string,
})
const roleAccess: PagePermission = PAGE_PERMISSIONS['/rehab/encounter']
const roleAccess: PagePermission = PAGE_PERMISSIONS['/emergency/encounter']
const { checkRole, hasReadAccess } = useRBAC()
@@ -16,7 +16,7 @@ useHead({
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()
@@ -16,7 +16,7 @@ useHead({
title: () => route.meta.title as string,
})
const roleAccess: PagePermission = PAGE_PERMISSIONS['/rehab/encounter']
const roleAccess: PagePermission = PAGE_PERMISSIONS['/inpatient/encounter']
const { checkRole, hasReadAccess } = useRBAC()
@@ -16,7 +16,7 @@ useHead({
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()
@@ -16,7 +16,7 @@ useHead({
title: () => route.meta.title as string,
})
const roleAccess: PagePermission = PAGE_PERMISSIONS['/rehab/encounter']
const roleAccess: PagePermission = PAGE_PERMISSIONS['/outpatient/encounter']
const { checkRole, hasReadAccess } = useRBAC()