/* Bernard Health SeniorCare V4.3.8 — enrutamiento médico por rol, no por nombre */
(function(){
'use strict';
const doctorScreens=new Set(['medicalDashboard','medicalAppointmentsDoctor','medicalHistory','medicalConsultation','medicalOrders','medicalStudies','medicalResults','medicalPrescriptions','medicalEmergencies','vitals']);
const role=()=>String(window.currentUser?.role||'').toLowerCase();
function normalize(){
 if(role()!=='doctor') return;
 const s=String(window.activeScreen||'medicalDashboard');
 if(!doctorScreens.has(s) && typeof window.go==='function') window.go('medicalDashboard',{scope:'global'},{replace:true});
}
addEventListener('seniorcare:user-ready',()=>setTimeout(normalize,350));
addEventListener('pageshow',()=>setTimeout(normalize,80));
})();
