BEGINNING next week, hospital emergency-room managers, like Dr. Kevin Hanson of EvergreenHealth in Kirkland, are going to face a moral dilemma.

Hanson envisions this scenario, which is hypothetical but appallingly routine: An elderly male patient with dementia arrives at the ER accompanied by his wife, whom the husband had assaulted in his delirium. The man is evaluated and meets the standard for involuntary psychiatric commitment. But due to an acute shortage of psychiatric beds, there is no place for the man to go, except Hanson’s ER.

Until now, the man would have been “boarded” in the ER until a bed is found in coming days. But a new state Supreme Court ruling, which takes effect Aug. 27, rightly outlawed the inhumane practice of boarding because patients routinely languish with little or no real treatment.

Hanson’s choice: follow the high court’s ruling and release the man, which would violate federal law mandating hospitals provide emergency care, and could endanger the wife. Or ignore the court’s mandate, risk a lawsuit or even a criminal charge, but comply with the physician’s Hippocratic oath.

Unlimited Digital Access. $1 for 4 weeks.

“We’re caught between a rock and a hard place,” said Hanson.

The governor, the Legislature and the state’s congressional delegation must step up to make Hanson’s choice less crushing.

The state Department of Social and Health Services is working on an emergency plan to open as many psychiatric beds as quickly as possible. About 200 more beds will be needed statewide on Aug. 27, at an estimated cost of perhaps $20 million or more, just through 2014. Without more beds, very sick patients might be cut loose, endangering themselves or others.

Rather than calling an expensive special session to appropriate more funds, Gov. Jay Inslee should broker a bipartisan agreement with state House and Senate leaders to allow DSHS to overspend its mental-health budget until the Legislature convenes in January.

Lawmakers must work now on a fuller response. The court’s ruling spotlighted huge gaps in inpatient care, but more robust preventive care can avert hospitalization. Existing programs in crisis diversion have proved effective.

The congressional delegation also must step up and persuade the Obama administration to grant an emergency waiver from federal-funding restrictions.

Medicaid, under a 1960s-era rule, does not pay for care at psychiatric hospitals larger than 16 beds. That onerous, outdated rule means large King County psychiatric hospitals, such as Fairfax Hospital in Kirkland, cannot help ease the immediate crisis.

Washington’s immediate crisis has been decades in the making, due to perpetually inadequate funding. The Supreme Court’s ruling should focus all levels of government on working toward immediate — and long-term — fixes to Washington’s safety net for the most vulnerable.

Editorial board members are editorial page editor Kate Riley, Frank A. Blethen, Ryan Blethen, Sharon Pian Chan, Jonathan Martin, Erik Smith, Thanh Tan, William K. Blethen (emeritus) and Robert C. Blethen (emeritus).