While much of Brooklyn is setting the pace for New York's economic expansion, Interfaith Medical Center -- serving Bedford-Stuyvesant and Crown Heights -- is pulling itself out of a code-blue, near-death free fall.

What's next?

There's major good news: The hospital this week emerged from bankruptcy with a new financial blueprint.

And there's major bad news: Years of managerial chaos and living life on the financial edge have taken a toll. The hospital has lost many valued doctors and staffers, and its daily patient census has dropped by about 25 percent.

So now the place must recover -- but how?

Interfaith must quickly affiliate with a larger health care network. The formula for its financial difficulties began with a high-needs patient base -- about 160,000 people -- in an age of fast-shrinking Medicaid dollars. By going it alone, the hospital generated oceans of red ink. A well-off partner could help Interfaith stabilize its finances and make sure patients get quality care in all specialties.

Interfaith should concentrate especially on behavioral health, where it has traditionally played a major role. City mental health programs are in a state of crisis. A strong Interfaith could make a big difference. About 60 percent of the hospital's patient discharges traditionally have been people with behavioral diagnoses.

Interfaith must remain a safety-net hospital -- with an ability to serve a highly vulnerable population. State and federal health officials should make sure it has enough money to play that role effectively.

If Interfaith's patient census has shrunk in recent months, local health advocates say the reason is not falling demand, but questions about its bankruptcy and viability -- and those have been settled. The medical center does not face the same kind of broad market shift that doomed Long Island College Hospital in affluent Cobble Hill.

It's great that Brooklyn's economy is going full tilt. The trouble is, not everyone is at the party. Interfaith deserves to come back transformed -- and better than ever.