How kilapkilap25/emr_diseasetrendanalytics works
Valenzuela District 1 is a standalone, browser-based barangay EMR: health workers use it to manage patient care, records, prescriptions and inventory, while administrators also manage accounts and generate reports. Analytics, disease surveillance, pregnancy tracking, AI insights and real-time updates are additional product branches. The README documents the browser/API and database roles; source-index references establish many backend module relationships. Some frontend-to-feature wiring and unsampled router behavior are not shown, so those links are omitted rather than inferred.
Main entry points: main.py FastAPI application · database.py Barangay database · prescriptions.py Prescriptions · patients.py Patient records
Components 30
Browser experience
- EMR browser
emr_system/frontend/js/api.js - Patient workspace
emr_system/frontend/js/patients.js - Visit records
emr_system/frontend/js/records.js - Dashboard
emr_system/frontend/js/dashboard.js - Inventory UI
emr_system/frontend/js/inventory.js - AI insights UI
emr_system/frontend/js/ai-insights.js
Clinical API
- FastAPI application
emr_system/backend/main.py - Authentication
emr_system/backend/routers/auth.py - User management
emr_system/backend/routers/users.py - WebSocket endpoint
emr_system/backend/routers/websocket.py
Care operations
- Patient records
emr_system/backend/routers/patients.py - Pregnancy care
emr_system/backend/routers/pregnancy.py - Prescriptions
emr_system/backend/routers/prescriptions.py - Inventory
emr_system/backend/routers/inventory.py - Visit queue
emr_system/backend/routers/queue.py - Patient notifications
emr_system/backend/routers/notifications.py
Insights and reporting
- Disease surveillance
emr_system/backend/routers/diseases.py - Analytics
emr_system/backend/routers/analytics.py - Geographic analytics
emr_system/backend/routers/analytics_geo.py - AI insights API
emr_system/backend/routers/ai_insights.py - AI resources
emr_system/backend/routers/ai_resources.py - PDF reports
emr_system/backend/routers/reports.py
Data and security
- Barangay database
emr_system/backend/database.py - EMR data models
emr_system/backend/models/models.py - Auth and permissions
emr_system/backend/middleware/auth.py - Token security
emr_system/backend/utils/security.py - Inventory batches
emr_system/backend/utils/inventory_batches.py - Prescription status
emr_system/backend/utils/prescription_status.py - Realtime events
emr_system/backend/websocket_manager.py
Other components
- Health staff
Connections 43
- Health staff → EMR browser: uses
- EMR browser → FastAPI application: calls API
- FastAPI application → Authentication: registers
emr_system/backend/main.py - FastAPI application → User management: registers
emr_system/backend/main.py - FastAPI application → Patient records: registers
emr_system/backend/main.py - FastAPI application → Prescriptions: registers
emr_system/backend/main.py - FastAPI application → Inventory: registers
emr_system/backend/main.py - FastAPI application → Visit queue: registers
emr_system/backend/main.py - FastAPI application → Pregnancy care: registers
emr_system/backend/main.py - FastAPI application → Analytics: registers
emr_system/backend/main.py - FastAPI application → PDF reports: registers
emr_system/backend/main.py - FastAPI application → AI insights API: registers
emr_system/backend/main.py - FastAPI application → AI resources: registers
emr_system/backend/main.py - FastAPI application → WebSocket endpoint: registers
emr_system/backend/main.py - Authentication → Token security: uses
emr_system/backend/routers/auth.py - Auth and permissions → Token security: verifies tokens
emr_system/backend/middleware/auth.py - Auth and permissions → Barangay database: queries users
emr_system/backend/middleware/auth.py - Patient records → Pregnancy care: uses rules
emr_system/backend/routers/patients.py - Prescriptions → Inventory batches: allocates stock
emr_system/backend/routers/prescriptions.py - Prescriptions → Prescription status: checks status
emr_system/backend/routers/prescriptions.py - Inventory → Inventory batches: manages batches
emr_system/backend/routers/inventory.py - Inventory → Prescription status: recomputes status
emr_system/backend/routers/inventory.py - Prescriptions → Realtime events: broadcasts events
emr_system/backend/routers/prescriptions.py - Visit queue → Realtime events: broadcasts events
emr_system/backend/routers/queue.py - WebSocket endpoint → Realtime events: manages connections
emr_system/backend/routers/websocket.py - Geographic analytics → Analytics: uses analytics
emr_system/backend/routers/analytics_geo.py - Analytics → Dashboard: serves analytics
- AI insights API → AI insights UI: serves insights
- Health staff → Patient workspace: manages patients
- Health staff → Visit records: records visits
- Health staff → Inventory UI: handles stock
- FastAPI application → Barangay database: uses sessions
emr_system/backend/main.py - Patient records → Barangay database: queries records
emr_system/backend/routers/patients.py - Prescriptions → Barangay database: reads and writes
emr_system/backend/routers/prescriptions.py - Analytics → Barangay database: queries data
emr_system/backend/routers/analytics.py - PDF reports → Barangay database: queries data
emr_system/backend/routers/reports.py - AI insights API → Barangay database: queries data
emr_system/backend/routers/ai_insights.py - AI resources → Barangay database: queries data
emr_system/backend/routers/ai_resources.py - Patient records → EMR data models: uses models
emr_system/backend/routers/patients.py - Prescriptions → EMR data models: uses models
emr_system/backend/routers/prescriptions.py - Disease surveillance → EMR data models: uses models
emr_system/backend/routers/diseases.py - PDF reports → EMR data models: uses models
emr_system/backend/routers/reports.py - Patient notifications → Barangay database: queries data
emr_system/backend/routers/notifications.py