BERLIN (AP) — Austria’s parliament has approved legislation that will allow chronically or terminally ill people to stipulate their will to die in tightly defined circumstances.

Lawmakers approved the new rules by a broad majority on Thursday, with only one of three opposition parties voting against, the Austria Press Agency reported. A change was necessary after a federal court last year overturned a provision in criminal law that outlaws all forms of assistance to those who kill themselves.

From next year, people who are chronically seriously ill or have no prospect of recovery will be able to state their will to die, a device somewhat similar to a living will.

The legislation seeks to prevent potential abuse by explicitly excluding minors. Adults who want to end their lives will have to produce a diagnosis and have their ability to make their own decision confirmed. They will have to speak with two doctors before, after a period of reflection, depositing their notification with a lawyer or notary.

They would then be able to get lethal drugs at a pharmacy. Names of the pharmacies that provide the drugs will not be advertized publicly, and will only be disclosed to the lawyers and notaries who receive the notifications.

Active assistance to suicide will remain outlawed.

At present, Austria’s criminal code states that anyone who “induces another person to kill himself or gives him help to do so” incurs a prison term of between six months and five years.

After considering a series of complaints, the Constitutional Court ruled in December 2020 that the words “or gives him help to do so” were unconstitutional and would be removed from the code at the end of this year.

The court said that the clause “violates the right of self-determination because (it) bans every kind of assistance under all circumstances.”

It upheld the rest of the provision and also upheld a provision that sets out the same punishment for anyone who “kills another person at his serious and emphatic request.”