recepcion: auto-expand patient history with exams on patient select

Previously the history section required a manual click to expand and load.
Now it opens and fetches automatically when a patient is selected.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-21 16:30:05 -05:00
co-authored by Claude Sonnet 4.6
parent 7842de0d21
commit 89b407f5cc
+6 -8
View File
@@ -1622,15 +1622,13 @@ function seleccionarPaciente(pac) {
document.getElementById('bloque-pac-kiosko').classList.remove('d-none');
}
// Mostrar historial del paciente
const secHist = document.getElementById('sec-historial-pac');
secHist.classList.remove('d-none');
// Resetear estado colapsado
document.getElementById('hist-pac-body').classList.add('d-none');
document.getElementById('btn-hist-toggle').classList.remove('open');
// Precargar en background (usuario decide si abre)
_historialPacienteCargado = false;
// Mostrar historial del paciente y cargar automáticamente
document.getElementById('sec-historial-pac').classList.remove('d-none');
document.getElementById('hist-pac-body').classList.remove('d-none');
document.getElementById('btn-hist-toggle').classList.add('open');
_historialPacienteCargado = true;
_historialPacienteId = pac.id;
cargarHistorialPaciente(pac.id);
// Consultar exámenes recientes en RIPS (últimos 5 min)
const cedula = (pac.numero_documento || pac.documento || '').toString().trim();