Other countries don't have gun rights protected in their constitution, the US does.
Licensing, required testing every few years, inspection of firearms every few years, better tracking of gun sold by private owners or sun shows, limiting concealed carry permits, not permitting military armaments and ammo to certain collectors or ranges (most people don't need tanks and artillery in their front yard nor machine gun for hunting)
It is one thing to own guns, but most people do not need an armory in their home, nor armor piercing ammo.
Those know to have certain mental health issue should not be permitted to own guns, or more than one gun for hunting in rural areas for food. Not all mental health issues makes one a danger to himself of others.
Doctor patient confidentiality should only go so far, the conditions for reporting a potential danger to authorities should be broader. Maybe the patient could be evaluated by another doctor or a board of doctors. Patients that work in certain professions where others might be endangered (accidently or intentionally) should be reported. Those on certain medicines, should perhaps be listed and more frequently evaluated by other doctors or authorities.
There are measure that can be taken without unnecessarily restricting the rights of the majority of the population.