Write a SQL query to identify patient adherence rates over a twelve-month treatment cycle.
Use the provided patient, treatment cycle, and dose record data. Treat each cycle as twelve expected monthly treatment periods. A month is completed when at least one dose record for that month has status taken; missing or non-taken records do not count.
Output
- One row per treatment cycle.
- Columns:
patient_id, patient_name, cycle_start, months_expected, months_completed, and adherence_rate_pct.
- Include cycles with no completed months, order by adherence rate descending, then
patient_id ascending.