A 34-year-old man with major depression tells his general practitioner that he has thought about dying and has imagined taking an overdose. He has no tablets at home, agrees that his partner will hold his medicines, accepts antidepressant treatment and daily telephone contact, and can explain the reasons for this plan. He declines hospital admission but agrees to return immediately if the thoughts intensify. Which is the most appropriate course under mental health legislation?