Akira-Kurusu commited on
Commit
f2959a6
·
verified ·
1 Parent(s): 8e4bfa3

Update web/patients.html

Browse files
Files changed (1) hide show
  1. web/patients.html +4 -6
web/patients.html CHANGED
@@ -574,7 +574,6 @@
574
 
575
  loadPatientsList();
576
  loadRiskFactors();
577
- loadStatistics();
578
 
579
  setupEventListeners();
580
  }
@@ -610,6 +609,7 @@
610
  filteredPatients = [...allPatients];
611
  displayPatients(filteredPatients);
612
  updatePatientStats();
 
613
  console.log('Pacientes cargados:', allPatients.length);
614
  } else {
615
  console.log('Error cargando pacientes');
@@ -628,11 +628,9 @@
628
  }
629
 
630
  function loadStatistics() {
631
- api.getDashboardStats().then(function(response) {
632
- if (response && response.success) {
633
- $('#totalPatients').text(response.stats.total_patients || 0);
634
- }
635
- });
636
  }
637
 
638
  function displayPatients(patients) {
 
574
 
575
  loadPatientsList();
576
  loadRiskFactors();
 
577
 
578
  setupEventListeners();
579
  }
 
609
  filteredPatients = [...allPatients];
610
  displayPatients(filteredPatients);
611
  updatePatientStats();
612
+ loadStatistics(); // llamar aquí para tener allPatients ya disponible
613
  console.log('Pacientes cargados:', allPatients.length);
614
  } else {
615
  console.log('Error cargando pacientes');
 
628
  }
629
 
630
  function loadStatistics() {
631
+ // El total real de pacientes se toma directamente de la lista completa
632
+ // ya cargada, no del dashboard (que filtra solo por diagnosticados)
633
+ $('#totalPatients').text(allPatients.length);
 
 
634
  }
635
 
636
  function displayPatients(patients) {