Who’s to blame for the failure of the Republican bill to repeal and replace ObamaCare? Who cares?

What matters now is that Democrats stop gloating, Republicans stop sulking and each party come to the table to improve a health care system that both parties agree needs work.

After the bill collapsed on Friday afternoon, President Trump accused the Democrats of obstruction, Senate Minority Leader Charles Schumer accused the president of incompetence, Speaker Paul Ryan said health care was done and House Minority Leader Nancy Pelosi bragged that it was a great day. No one had the courage to pick up the pieces and point the way forward.

The Affordable Care Act has provided health care coverage to millions more Americans, but there are still some 30 million with no insurance. Premiums are too high. The individual mandate isn’t encouraging enough people to buy into the system.

Some of its regulations and taxes make little sense. Insurance markets are too thin, providing consumers too little choice. Health care savings accounts do too little to encourage savings.

Republicans have viable ideas to address these issues, including high-risk insurance pools and capping the tax exclusion that companies get for providing employees with health insurance. It’s regrettable that none of these ideas was seriously considered in the rush to repeal ObamaCare.

Equally regrettable is that Republicans appear to be giving up and moving on to other issues. If they can’t get everything they want, they seem to have concluded, they’ll take nothing.

It’s a bad strategy. As Sen. John McCain said Saturday, Republicans need Democrats to reform health care. The art of governing is compromise — and not just within the majority party. The sooner Ryan accepts the fact that Democrats can be a cudgel to use against the Freedom Caucus, the more successful he and Congress will be.

Ronald Reagan was known to say that he would happily take 70 or 80 percent of what he wanted and come back for the rest later. Yet instead of living by Reagan’s rule, Republicans are hung up on the Hastert Rule, named for Dennis Hastert, the former (and now disgraced) House speaker: Only bills that can get through without Democratic votes are brought to the floor.

This led the party to produce a deeply flawed health care bill that, ultimately, did not win strong support from the Republicans’ moderate or Tea Party wings.

At the same time, Democrats steadfastly refused to reach across the aisle to produce a bipartisan alternative. Gloating only makes that more difficult.

On Friday, Schumer said that Democrats are ready to work with Republicans to improve the Affordable Care Act on one condition: that Republicans take repeal off the table. This is not an auspicious step. Democrats ought to allow Republicans to call a new bill whatever they want. The details are what matters, not the label.

Michael R. Bloomberg is the former mayor of New York City.

©2017 Bloomberg News