Unless you are a serious danger to yourself (e.g. suicide) or someone else, doctors must keep your information confidential.
If doctors break confidentiality without good reason (as above), they can face investigation and punishment by the GMC
I cannot imagine doctors would have an interest or good reason to tell anyone about you taking ritalin
(we covered this in a lecture last semester)
It is important that doctors keep confidentiality so that patients can feel free enough to discuss their health problems. Breaking confidentiality undermines the doctor-patient relationship