How equipo5-aqp/healthradar works
HealthRadar is a Peruvian epidemiological-surveillance system. Analysts use separate consulta and históricos microfrontends: natural-language questions produce analytical reports and trends, while historical views expose filtered data. The README documents n8n as the sole logic orchestrator, with PostgreSQL/pgvector, external AI and weather services, and a weekly MINSA bulletin-ingestion workflow. The graph includes the sampled core decision library and frontend adapters; ingestion internals and n8n workflows are documented capabilities, but their implementation files are not in the supplied tree.
Main entry points: index.js Core exports · n8nConsultaAdapter.js Consulta adapter · consulta/route.js Consulta API · tendencia/route.js Trend API
Components 29
User interfaces
- Consulta UI
src/mf-consulta/src/app/page.js - Consulta hooks
src/mf-consulta/src/modules/consulta/hooks/useConsultaNLQ.js - Consulta adapter
src/mf-consulta/src/modules/consulta/infrastructure/n8nConsultaAdapter.js - Consulta API
src/mf-consulta/src/app/api/consulta/route.js - Trend API
src/mf-consulta/src/app/api/tendencia/route.js - Trend hook
src/mf-consulta/src/modules/consulta/hooks/useTendencia.js - History UI
src/mf-historicos/src/app/page.js - History hook
src/mf-historicos/src/modules/historicos/hooks/useHistoricos.js - History adapter
src/mf-historicos/src/modules/historicos/infrastructure/n8nHistoricosAdapter.js - History API
src/mf-historicos/src/app/api/historicos/route.js
Decision core
- Core exports
src/core/index.js - Query parsers
src/core/parsers - Prediction decision
src/core/decisions/activar-prediccion.js - Bulletin filter
src/core/filters/boletines.js - Climate filter
src/core/filters/clima.js - Prompt context
src/core/builders/contexto-prompt.js - Trend builder
src/core/builders/tendencia.js - Bulletin validator
src/core/validators/resumen-boletin.js - Presentation rules
src/core/presentacion
Data ingestion
- MINSA / CDC
- Open-Meteo
- Gemini Flash
- MINSA data loader
src/database/cargar_datos_minsa.py - Dataset cleaning
src/database/limpiar_datasets_minsa.py
Orchestration and services
- n8n orchestrator
- PostgreSQL + pgvector
- Claude Haiku
- Arize Phoenix
Other components
- Health analyst
Connections 27
- Health analyst → Consulta UI: asks questions
- Health analyst → History UI: views history
- Consulta hooks → Consulta adapter: calls
src/mf-consulta/src/modules/consulta/hooks/useConsultaNLQ.js - Consulta adapter → Consulta API: posts query
src/mf-consulta/src/modules/consulta/infrastructure/n8nConsultaAdapter.js - Trend hook → Consulta adapter: loads trends
src/mf-consulta/src/modules/consulta/hooks/useTendencia.js - Consulta adapter → Trend API: posts trend request
src/mf-consulta/src/modules/consulta/infrastructure/n8nConsultaAdapter.js - History hook → History adapter: loads history
src/mf-historicos/src/modules/historicos/hooks/useHistoricos.js - History adapter → History API: requests history
- Consulta API → n8n orchestrator: proxies query
- Trend API → n8n orchestrator: proxies trend
- History API → n8n orchestrator: proxies history
- n8n orchestrator → Core exports: uses core
src/core/index.js - Core exports → Query parsers: exports parsers
src/core/index.js - Core exports → Prediction decision: exports decision
src/core/index.js - Core exports → Bulletin filter: exports filter
src/core/index.js - Core exports → Climate filter: exports filter
src/core/index.js - Core exports → Prompt context: exports builder
src/core/index.js - Core exports → Trend builder: exports builder
src/core/index.js - Core exports → Bulletin validator: exports validator
src/core/index.js - Core exports → Presentation rules: exports rules
src/core/index.js - n8n orchestrator → PostgreSQL + pgvector: queries and writes
- n8n orchestrator → Claude Haiku: requests reports
- n8n orchestrator → Arize Phoenix: sends traces
- n8n orchestrator → MINSA / CDC: downloads bulletins
- n8n orchestrator → Open-Meteo: fetches climate
- n8n orchestrator → Gemini Flash: extracts bulletin data
- n8n orchestrator → PostgreSQL + pgvector: stores ingested data