diff --git "a/web/diagnosis.html" "b/web/diagnosis.html" --- "a/web/diagnosis.html" +++ "b/web/diagnosis.html" @@ -6,10 +6,10 @@ - Diagnóstico IA + Dashboard - + @@ -19,191 +19,22 @@ - - - +
-
- -
- -
-
-

- - Diagnóstico con Inteligencia Artificial -

-

Diagnostico de retinopatía diabética mediante análisis de imágenes

+
+
+
+
+
+
+ + + +
+
+

Total Pacientes

+ 0 +
+
+
+
-
- - -
-
-
-
-
- Cargar Imágenes para Análisis -
+
+
+
+
+
+ + + +
+
+

Con Retinopatía

+ 0 +
+
+
+
+
+
-
- -
-
Ojo Derecho
- - - - - -
- -
Arrastra una imagen aquí o haz clic para seleccionar
-

Formatos soportados: JPG, PNG, JPEG (Máx. 10MB)

-
- - - - - - +
+
+ + +
- - -
-
Ojo Izquierdo
- - - - - -
- -
Arrastra una imagen aquí o haz clic para seleccionar
-

Formatos soportados: JPG, PNG, JPEG (Máx. 10MB)

-
- - - - - - +
+

Sin Retinopatía

+ 0
+
+
+
+
+
+ + + +
+
+

Tasa Positividad

+ 0% +
+
+
+
+
+
+ +
+
+
+
+
+
+
Estadísticas de Consultas
+
+
+
+
+
+
- -
-
+
+
+
- Información del Paciente y Consulta + + Rangos de Edad con Retinopatía
-
- +
- - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + function populateAgeDetailsModal(data) { + if (!data.success) return; - + $('#modalAvgAge').text(stats.avg_age + ' años'); + $('#modalMedianAge').text(stats.median_age + ' años'); + if (summary.most_affected_range) { + $('#mostAffectedRange').text(summary.most_affected_range[0] + ' años'); + $('#mostAffectedCount').text(summary.most_affected_range[1] + ' pacientes'); + } + const tbody = $('#ageDistributionTable tbody'); + tbody.empty(); + + const total = data.chart_data.total; + Object.entries(data.filtered_ranges).forEach(([range, count]) => { + const percentage = ((count / total) * 100).toFixed(1); + const barWidth = Math.max((count / total) * 100, 5); + + tbody.append(` + + ${range} años + ${count} + ${percentage}% + +
+
+
+ + + `); + }); + } + }); + } + function updateAgeStatistics(data) { + if (!data || !data.success) return; + api.getDashboardStats().then(function(response) { + if (response && response.success && response.detailed_analysis) { + const stats = response.detailed_analysis.statistics; + $('#avgAge').text(stats.avg_age || '-'); + $('#ageRange').text(stats.min_age && stats.max_age ? + stats.min_age + '-' + stats.max_age : '-'); + $('#totalPatientsAge').text(stats.total_patients || '-'); + } + }); + } - + function showAnalysisDetails(analysis) { + const modal = ` + + `; + $('body').append(modal); + $('#analysisModal').modal('show'); + $('#analysisModal').on('hidden.bs.modal', function() { + $(this).remove(); + }); + } + window.updateChartData = updateChartData; + }); + + + + - if (userRole === 'Admin') { - // Usuario es Admin - mostrar elemento - if (navItemContainer) { - navItemContainer.style.display = 'block'; + - - - - + \ No newline at end of file