fix: connect all UI hooks and resolve ReferenceErrors (v4)
Build Curio HMS / build-and-deploy (push) Has been cancelled Details

This commit is contained in:
Deep Koluguri 2026-05-14 23:54:11 -04:00
parent 3b0115bbac
commit ca69905915
1 changed files with 32 additions and 0 deletions

View File

@ -238,6 +238,38 @@ window.printSummary = () => {
alert(`🖨️ Printing Handover Note:\n\n${summary}`);
};
// 7. Missing UI Hooks (Repaired)
window.openHistory = () => {
const name = document.querySelector(".current-patient h1").innerText.split(' (')[0];
alert(`📂 Loading Patient History for ${name}...\n\n- Visit (05/12/26): Chronic Gastritis\n- Lab (05/10/26): HbA1c 7.2% (Warning)`);
};
window.openConsultation = () => {
const modal = document.getElementById("consultationModal");
if (modal) {
// Auto-fill diagnosis based on triage context
const meta = document.querySelector(".patient-meta").innerText;
document.getElementById("rxDiagnosis").value = meta.split(' • ')[1] || "";
modal.style.display = "block";
}
};
// 8. Sidebar Toggle
window.toggleSidebar = () => {
const sidebar = document.getElementById('sidebar');
if (!sidebar) return;
if (sidebar.style.display === 'flex') {
sidebar.style.display = 'none';
} else {
sidebar.style.display = 'flex';
sidebar.style.position = 'fixed';
sidebar.style.top = '50px';
sidebar.style.width = '100%';
sidebar.style.height = 'calc(100vh - 50px)';
sidebar.style.zIndex = '999';
}
};
// Close Modals
if (closeModal) closeModal.onclick = () => modal.style.display = "none";