Update web/diagnosis.html
Browse files- web/diagnosis.html +9 -14
web/diagnosis.html
CHANGED
|
@@ -904,20 +904,15 @@
|
|
| 904 |
function handlePatientSearch() {
|
| 905 |
const searchTerm = $('#patientSearch').val().trim();
|
| 906 |
|
| 907 |
-
if (searchTerm.length <
|
| 908 |
-
|
| 909 |
-
|
| 910 |
-
|
| 911 |
-
|
| 912 |
-
|
| 913 |
-
|
| 914 |
-
|
| 915 |
-
|
| 916 |
-
{ patientID: 2, name: 'María García', birthDate: '2005-08-22', diabetesType: 'Tipo 1' },
|
| 917 |
-
{ patientID: 3, name: 'Carlos López', birthDate: '1990-12-10', diabetesType: 'Tipo 2' }
|
| 918 |
-
].filter(p => p.name.toLowerCase().includes(searchTerm.toLowerCase()));
|
| 919 |
-
|
| 920 |
-
displayPatientResults(mockPatients);
|
| 921 |
return;
|
| 922 |
}
|
| 923 |
|
|
|
|
| 904 |
function handlePatientSearch() {
|
| 905 |
const searchTerm = $('#patientSearch').val().trim();
|
| 906 |
|
| 907 |
+
if (searchTerm.length < 1) {
|
| 908 |
+
// Mostrar todos los pacientes si el campo está vacío
|
| 909 |
+
api.getPatients('').then(function(response) {
|
| 910 |
+
if (response && response.success && response.patients.length > 0) {
|
| 911 |
+
displayPatientResults(response.patients);
|
| 912 |
+
} else {
|
| 913 |
+
$('#patientResults').hide();
|
| 914 |
+
}
|
| 915 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 916 |
return;
|
| 917 |
}
|
| 918 |
|