that varies across the countries. where I live, a doctor must not reveal anything the patient has told them during a visit/medical procedure/etc., with the only exception being when there’s a risk of a future harm. so a doctor can’t report the patient has admitted to having murdered someone, but should report if they say they’re about to.