Rich Pedroncelli, Associated Press
In this March 25, 2015, file photo, a portrait of Brittany Maynard sits on the dias of the Senate Health Committee at the Capitol in Sacramento, Calif., as lawmakers took testimony on proposed legislation allowing doctors to prescribe life ending medication to terminally ill patients.

SAN DIEGO — A judge has thrown out a lawsuit against the state of California by three terminally ill residents seeking doctor-prescribed fatal medication.

San Diego Superior Court Judge Gregory Pollack said in his written ruling issued Monday that his court is not the place to change the state statute barring the prescriptions.

Pollack says the law is best changed by the Legislature or through a ballot measure.

A bill seeking such a right stalled in the state Legislature earlier this month. The plaintiffs want an expedited process because of their deteriorating health.

They asked the court to declare the law unconstitutional as applied to doctors who prescribe fatal medication for mentally competent, terminally ill adults.

Pollack says the law is constitutional. The plaintiffs vowed to appeal.