Originally published as a complete guide at Signature Care's medication management resource
Polypharmacy β the concurrent use of five or more medications β affects 66% of older Canadian adults. For developers building health-tech tools, family caregivers coordinating complex schedules, or technical professionals architecting home care workflows, understanding medication management as a system design problem unlocks better outcomes and fewer dangerous errors.
This guide breaks down medication safety at home using technical frameworks: data models, decision trees, protocol specifications, and tooling recommendations.
Tags
#healthtech #caregiving #systemdesign #productivity
The Problem: Medication Management as a Distributed Systems Challenge
Home medication management shares structural similarities with distributed systems engineering:
- Multiple data sources (several prescribers, pharmacies, specialists)
- Race conditions (drug interactions, timing conflicts)
- State management failures (missed doses, double doses)
- No single source of truth (fragmented across providers)
When any of these fail in production, the consequences aren't a degraded user experience β they're hospitalizations. In Canada, medication non-adherence among seniors accounts for 10% of all preventable hospital admissions annually.
1. Data Architecture: Building Your Medication Record
Start by treating your loved one's medication list as a structured data schema, not a Post-it note on the fridge.
Recommended Medication Record Schema
{
"patient": {
"name": "Jane Doe",
"dob": "1942-06-15",
"health_card": "MANITOBA-XXXXXXXX",
"allergies": ["penicillin", "sulfa drugs"],
"primary_pharmacy": {
"name": "Shoppers Drug Mart Winnipeg",
"phone": "204-XXX-XXXX",
"fax": "204-XXX-XXXX"
}
},
"medications": [
{
"id": "med_001",
"name": "Warfarin",
"generic_name": "warfarin sodium",
"brand_name": "Coumadin",
"dosage": "5mg",
"route": "oral",
"frequency": "once_daily",
"timing": "18:00",
"food_instructions": "consistent_vitamin_k_intake",
"prescriber": "Dr. Smith β Cardiology",
"rx_number": "RX-XXXXXXX",
"start_date": "2023-11-01",
"refill_date": "2024-02-01",
"high_risk": true,
"interaction_flags": ["aspirin", "ibuprofen", "st_johns_wort"]
}
],
"otc_supplements": [
{
"name": "Vitamin D3",
"dosage": "1000 IU",
"frequency": "once_daily",
"timing": "morning"
}
],
"last_reviewed": "2024-01-15",
"reviewed_by": "Pharmacist β Jane Williams"
}
Key design principles:
- Include both brand and generic names β switching between them is a common source of accidental double-dosing
- Flag
high_risk: truefor medications with narrow therapeutic windows (blood thinners, heart medications, seizure drugs) - Store
interaction_flagsas arrays to support automated cross-referencing
2. Schedule Architecture: Preventing Race Conditions
Medication timing conflicts β two drugs that shouldn't be taken together, or one that requires an empty stomach while another requires food β are real race conditions.
Medication Schedule State Machine
States: PENDING β DISPENSED β CONFIRMED β LOGGED
β
MISSED β ESCALATED β PROVIDER_NOTIFIED
from enum import Enum
from datetime import datetime
class DoseStatus(Enum):
PENDING = "pending"
DISPENSED = "dispensed"
CONFIRMED = "confirmed"
MISSED = "missed"
ESCALATED = "escalated"
class MedicationDose:
def __init__(self, med_id, scheduled_time, window_minutes=30):
self.med_id = med_id
self.scheduled_time = scheduled_time
self.window_minutes = window_minutes # acceptable administration window
self.status = DoseStatus.PENDING
self.administered_at = None
self.caregiver_id = None
self.notes = ""
def administer(self, caregiver_id: str, timestamp: datetime):
delta = abs((timestamp - self.scheduled_time).total_seconds() / 60)
if delta > self.window_minutes:
self.notes = f"Administered {delta:.0f} min outside window"
self.status = DoseStatus.CONFIRMED
self.administered_at = timestamp
self.caregiver_id = caregiver_id
def mark_missed(self):
self.status = DoseStatus.MISSED
# Trigger escalation workflow
self._escalate()
def _escalate(self):
self.status = DoseStatus.ESCALATED
# Notify caregiver β family member β healthcare provider
print(f"[ALERT] Missed dose escalation for med_id={self.med_id}")
This state machine structure maps directly onto commercial medication management platforms and can guide how you evaluate or build caregiver-facing tools.
3. Storage Configuration: Environmental Constraints as System Requirements
Medication storage failures are configuration errors. Most degradation events are preventable.
Storage Requirement Matrix
| Medication Type | Temp Range | Humidity | Light | Special |
|---|---|---|---|---|
| Most oral tablets | 15β25Β°C | <60% | Avoid direct | Original container |
| Insulin (opened) | Room temp | <60% | Avoid | Use within 28β30 days |
| Insulin (unopened) | 2β8Β°C (fridge) | Controlled | Avoid | Don't freeze |
| Nitroglycerin | <25Β°C | Low | Dark container | Away from heat sources |
| Liquid antibiotics | 2β8Β°C (fridge) | N/A | Avoid | Discard after course |
| Eye drops (opened) | Room temp | Low | Avoid | Discard after 28 days |
Common configuration anti-patterns:
β Bathroom medicine cabinet β high humidity, temperature spikes
β Kitchen windowsill β direct sunlight, heat
β Hot car glovebox β extreme temperature variance
β Unlocked drawer β accessible to children/pets
β Mixed container β identification errors
β
Cool bedroom drawer β stable temp, low humidity
β
Locked box (controlled Rx) β security requirement met
β
Original containers β label integrity preserved
β
Separate daily vs PRN β reduces selection errors
4. Interaction Checking: The Dependency Graph Problem
Drug interactions are a dependency resolution problem. Each medication is a node; interactions are edges. High-risk combinations are circular dependencies that can cascade into system failure.
High-Risk Interaction Pairs (Canadian context)
HIGH_RISK_INTERACTIONS = {
"warfarin": [
"aspirin",
"ibuprofen",
"naproxen",
"st_johns_wort",
"vitamin_e_high_dose",
"ciprofloxacin"
],
"metformin": [
"contrast_dye", # pre-procedure alert
"alcohol_heavy"
],
"digoxin": [
"amiodarone",
"clarithromycin",
"licorice_supplements"
],
"ssri_class": [
"tramadol", # serotonin syndrome risk
"linezolid",
"st_johns_wort"
]
}
def check_interactions(current_meds: list, new_med: str) -> list:
"""
Returns list of flagged interactions for review.
NOT a substitute for pharmacist review.
"""
flags = []
new_med_lower = new_med.lower().replace(" ", "_")
for med in current_meds:
med_key = med.lower().replace(" ", "_")
if med_key in HIGH_RISK_INTERACTIONS:
if new_med_lower in HIGH_RISK_INTERACTIONS[med_key]:
flags.append({
"existing_med": med,
"new_med": new_med,
"severity": "HIGH",
"action": "PHARMACIST_REVIEW_REQUIRED"
})
return flags
β οΈ Critical note: Automated checking is a triage tool, not a clinical decision system. Always escalate flagged interactions to a licensed pharmacist or physician before proceeding.
5. The Five Rights Protocol: Your Production Checklist
Professional caregivers use the Five Rights framework as a pre-administration checklist. Think of it as a pre-flight check or a CI/CD gate before deployment.
PRE-ADMINISTRATION CHECKLIST
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β‘ RIGHT PERSON β Verified patient identity matches prescription label
β‘ RIGHT MEDICATION β Generic + brand name confirmed; not expired
β‘ RIGHT DOSE β Dosage matches current prescription; not doubled
β‘ RIGHT TIME β Within acceptable administration window
β‘ RIGHT ROUTE β Oral / sublingual / topical / injection confirmed
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
SECONDARY CHECKS:
β‘ No recent vomiting (oral medications)
β‘ No food/drug timing conflict
β‘ Caregiver notes any observed reactions post-administration
β‘ Log entry created with timestamp and caregiver ID
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Research indicates that standardized Five Rights protocols reduce medication errors by 70% in home care settings.
6. Alert Escalation: Defining Your On-Call Runbook
Like any production system, medication management needs a defined escalation path. Here's a structured decision tree:
SYMPTOM DETECTED
β
βΌ
Is this a known, documented side effect?
β
YES β NO
β β
βΌ βΌ
Monitor + log Is it severe?
Notify family (breathing, chest pain,
caregiver unconsciousness, anaphylaxis)
β β
β YES β NO
β β β β
β βΌ β βΌ
β CALL 911 β Contact prescriber
β β or Health Links
β β 204-788-8200
β β
βββββββββββββββββββββββ
β
βΌ
Document in medication log
Flag for pharmacist review at next refill
Clinical Alert Thresholds
ALERT_THRESHOLDS = {
"call_911": [
"difficulty_breathing",
"chest_pain",
"loss_of_consciousness",
"severe_allergic_reaction",
"signs_of_overdose",
"severe_confusion_acute_onset"
],
"contact_provider_urgent": [
"irregular_heartbeat",
"persistent_severe_nausea",
"unexpected_significant_bleeding",
"sudden_behaviour_change"
],
"contact_provider_routine": [
"persistent_mild_side_effects",
"multiple_missed_doses",
"new_otc_supplement_addition",
"pre_surgery_or_dental_procedure",
"international_travel_planned"
],
"monitor_and_log": [
"mild_transient_nausea",
"minor_dizziness_first_week",
"known_documented_side_effect"
]
}
7. Tooling Evaluation Framework
When selecting medication management tools β whether apps, dispensers, or workflow platforms β evaluate them against these requirements:
Functional Requirements Checklist
CORE FEATURES
β‘ Multi-medication schedule management
β‘ Caregiver + family member access (role-based)
β‘ Missed dose logging and alerting
β‘ Interaction checking (with pharmacist escalation path)
β‘ Refill tracking and reminders
β‘ Shareable records for provider appointments
SAFETY FEATURES
β‘ Photo identification of pills
β‘ Barcode/QR scanning of prescription labels
β‘ Emergency contact quick-access
β‘ Exportable medication history (PDF or structured data)
INTEGRATION
β‘ Compatible with Manitoba Health resources
β‘ Pharmacy data import capability
β‘ HL7 FHIR compliance (for clinical-grade tools)
β‘ Audit trail / immutable logs
Tool Categories
| Tool Type | Best For | Limitations |
|---|---|---|
| Weekly pill organizer | Simple schedules, stable regimens | No alerting, human error risk |
| Smartphone reminder app | Tech-comfortable users, moderate complexity | Requires consistent device access |
| Automated pill dispenser | Complex schedules, cognitive decline | Cost, mechanical failure modes |
| Blister pack (pharmacy) | Polypharmacy, compliance issues | Less flexible for PRN medications |
| Professional home care coordination | High-complexity cases, post-hospital | Requires care plan setup |
8. Disposal Protocol: Secure Decommissioning
Unused or expired medications are a security and environmental vulnerability β treat disposal like decommissioning sensitive infrastructure.
Manitoba Disposal Protocol
MEDICATION DISPOSAL DECISION TREE
ββββββββββββββββββββββββββββββββββββββ
Is medication expired or no longer needed?
β
βΌ
YES β Return to pharmacy via
Drug Return Program
(available at most
Manitoba pharmacies,
no charge)
DO NOT:
β Flush down toilet
β Place in household garbage
β Leave in unsecured location
β Share with others
Special cases:
β’ Patient deceased β prompt return, document inventory
β’ Transition to care facility β coordinate with facility pharmacist
β’ Controlled substances β may require witnessed disposal
Putting It All Together: Implementation Priorities
If you're implementing or auditing a home medication management system, here's a prioritized rollout:
PHASE 1 β Foundation (Week 1)
βββ Build complete medication record (JSON schema above)
βββ Share with all prescribers and pharmacists
βββ Establish secure storage configuration
PHASE 2 β Process (Week 2)
βββ Implement Five Rights pre-administration checklist
βββ Set up logging system (app or written log)
βββ Define escalation contacts and thresholds
PHASE 3 β Tooling (Week 3β4)
βββ Evaluate and select reminder/dispensing tools
βββ Book pharmacist medication review
βββ Configure refill tracking and alerts
PHASE 4 β Ongoing Operations
βββ Monthly: Review and update medication record
βββ Quarterly: Pharmacist medication review
βββ Annually: Full medication reconciliation with all providers
Key Resources (Manitoba)
- Health Links - Info SantΓ©: 204-788-8200 (non-emergency medication guidance)
- Winnipeg Drug Return Program: Available at most local pharmacies at no charge
- Manitoba pharmacists: Can conduct comprehensive medication reviews and arrange blister packaging
- Signature Care home care services: View care coordination and medication support services
Takeaways
- Treat medication records as structured data β schema design prevents documentation gaps
- Model interactions as a dependency graph β and always resolve conflicts with a pharmacist
- Use state machines for dose tracking β missed doses need escalation paths, not just reminders
- Store configuration matters β most degradation events are preventable environment failures
- The Five Rights protocol is your pre-flight checklist β don't skip gates under time pressure
- **Define











