Alberta has one year to overhaul its mental health law, after a court decision found that the existing rules allowed doctors to confine and medicate a Calgary man against his will in violation of his Charter rights.

Court of Queen's Bench Justice Kristine Eidsvik ruled six provisions under the Mental Health Act unconstitutional and has given the government 12 months to fix it.

The decision, delivered Wednesday, comes after reviewing a case centred on a 49-year-old man, given the initials J.H. to protect his privacy, who was detained for more than nine months and medicated against his will at Foothills hospital.

In her ruling, Justice Eidsvik wrote "J.H. suffered multiple breaches of his fundamental rights to life liberty and security protected by s. 7 of the Charter, was arbitrarily detained in breach of s.9, and was not given appropriate notice of the reason for his detention or his right to legal counsel in breach of s. 10 (a) and (b). AHS is responsible for these breaches."

J.H. was the victim of a 2014 hit-and-run and was hospitalized for injuries to his leg and back. While in hospital, he became homeless and had trouble accessing social assistance once he was discharged.

He later returned to the hospital to receive surgery for complications arising from his injuries. But when it came time to discharge him, he was instead certified and held under the Mental Health Act.

Justice Eidsvik found that J.H. was then given psychiatric medications, which were not medically required, and that he was not told about his right to free legal advice within a reasonable time.

Eidsvik said the Mental Health Act's criteria for detaining people is too broad and she recommended new safeguards be created to protect patients.

'Strong message,' says legal advocate

Calgary Legal Guidance, which was an intervener in the case, is pleased with the decision, said executive director Marina Giacomin.

"This is a strong message about upholding individual rights," especially for people who are marginalized and may not be able to speak well on their own behalf, she said.

Marina Giacomin is the executive director of Calgary Legal Guidance, an organization that provides free legal assistance and advocacy to individuals experiencing financial hardship. (CBC)

Giacomin said her organization has seen hundreds of cases like this, which is why it wanted to be involved in J.H.'s.

"This was a really brave individual who worked as hard as they could to advocate for themselves and finally was able to get a lawyer to represent them and tell their story."

Gov't, AHS say they're working on it

In emailed statements to CBC, both Alberta Justice and AHS said they are reviewing the decision.

"We are committed to ensuring that people receive the help they need while ensuring Albertans' rights are protected," said Lisa Glover, senior communications advisor with Alberta Justice and Solicitor General.

AHS said a number of steps have already been taken to make sure patients know what their rights are once they have been certified under the Mental Health Act.

Media relations director Don Stewart said AHS has developed a checklist for doctors and nurses to outline the steps required when informing a patient they have been certified under the Mental Health Act.

He also said all certified patients on medical wards are given a brochure that highlights how to access a Mental Health Patient Advocate and what services they can provide.