Tracks daily medication schedules for elderly patients. Monitors dose confirmations, identifies missed doses, and maintains a real-time adherence log.
This skill manages the patient's medication schedule. It is the core intelligence of MedGuard — knowing what to take, when to take it, whether it was taken, and what to do when it isn't.
This skill activates when:
When a reminder time is reached, send:
"Hi [Name]! 💊 It's time for your [Medication Name] ([Dosage]). Have you taken it yet?" Buttons: [✅ Yes, I took it] [⏰ Remind me in 15 mins] [❓ I'm not sure]
If no confirmation after 2 reminders → mark as MISSED. Trigger the caregiver-alert skill.
The agent reads from a structured schedule stored in data/schedules/{patient_id}.json:
{
"patient_id": "P-001",
"patient_name": "Margaret Collins",
"medications": [
{
"name": "Metformin",
"dosage": "500mg",
"times": ["08:00", "20:00"],
"with_food": true,
"critical": false
},
{
"name": "Warfarin",
"dosage": "2.5mg",
"times": ["18:00"],
"with_food": false,
"critical": true
}
]
}
Every event is logged to data/logs/{patient_id}/adherence_{YYYY-MM-DD}.jsonl:
{"timestamp": "2025-08-15T08:03:22Z", "medication": "Metformin 500mg", "status": "CONFIRMED", "channel": "app", "snooze_count": 0}
{"timestamp": "2025-08-15T18:45:00Z", "medication": "Warfarin 2.5mg", "status": "MISSED", "channel": "sms", "snooze_count": 2, "escalated": true}
weekly_adherence_rate = (confirmed_doses / total_scheduled_doses) * 100
Flag if rate drops below 80% in any 7-day window.