| import pandas as pd |
| from datetime import datetime, timedelta |
|
|
| |
| MOCK_PATIENTS = [ |
| {"id": "P001", "name": "John Doe", "last_visit": "2023-10-01", "assigned_chw": "Alice Smith"}, |
| {"id": "P002", "name": "Jane Roe", "last_visit": "2023-10-05", "assigned_chw": "Bob Jones"}, |
| {"id": "P003", "name": "Sam S.", "last_visit": "2023-10-10", "assigned_chw": "Alice Smith"}, |
| ] |
|
|
| |
| history_data = { |
| "patient_id": ["P001", "P001", "P001", "P002", "P002", "P003"], |
| "date": [ |
| (datetime.now() - timedelta(days=30)).strftime("%Y-%m-%d"), |
| (datetime.now() - timedelta(days=15)).strftime("%Y-%m-%d"), |
| datetime.now().strftime("%Y-%m-%d"), |
| (datetime.now() - timedelta(days=10)).strftime("%Y-%m-%d"), |
| datetime.now().strftime("%Y-%m-%d"), |
| datetime.now().strftime("%Y-%m-%d"), |
| ], |
| "rri": [0.15, 0.45, 0.78, 0.22, 0.25, 0.65], |
| "mood": ["Good", "Anxious", "Stressed", "Stable", "Good", "Lonely"], |
| } |
| MOCK_HISTORY = pd.DataFrame(history_data) |
|
|
| def get_patient_history(patient_id): |
| return MOCK_HISTORY[MOCK_HISTORY["patient_id"] == patient_id] |
|
|
| def get_aggregated_stats(): |
| |
| return { |
| "total_patients": 150, |
| "high_risk_alerts": 12, |
| "readmission_reduction": "15%", |
| "avg_rri_trend": [0.45, 0.42, 0.38, 0.35], |
| } |
|
|