During the 1980s, when I first started as an emergency room doctor at New York City’s Bellevue Hospital, a frequent part of the job was treating homeless people who were FOS — short for Found on Street. These patients might be victims of rape, hypothermia or starvation. They might have hepatitis or tuberculosis. But they were also more than occasionally sent to the hospital because what they needed was “three squares and a blanket,” as we called it.

Since those days, New York has seen a huge shift for the better, and it’s something Los Angeles could learn from. Together, California and New York account for more than 40% of the nation’s homeless population. But the approaches of Los Angeles and New York City in dealing with the crisis couldn’t be more different.

Whereas L.A. has focused (unsuccessfully) on trying to create long-term affordable housing, New York City has focused on creating temporary shelters. As a result, today only about 5% of New York City’s homeless population is without shelter. In Los Angeles, 75% of the homeless population is without shelter. Our homeless numbers are not that different from yours in Los Angeles, but in New York, few people are living on the street.

People become homeless for a variety of reasons, including financial setbacks, mental illness and addiction. And once people land on the streets, their physical and mental conditions escalate. As a physician, I witnessed firsthand a huge shift when New York began its emphasis on providing shelter for all. Mental illness, drug addiction and contagious diseases like hepatitis A, B and C were still a problem, but they weren’t nearly as severe as when so much of the homeless population was “bedless,” living in cardboard boxes or in the subway. It is simply impossible to provide good treatment to a patient with mental or physical illness living in that way.

In Los Angeles, local government officials are dispatching more garbage trucks and portable toilets and showers to skid row, but that’s just a Band-Aid. As long as there are thousands of people living on single city blocks, there will be problems with garbage disposal and human waste, which means rats will abound. And rats carry fleas, and fleas are carriers of typhus bacteria, which causes fever, muscle aches and severe headaches, among other symptoms.

Part of the problem in Los Angeles is financial commitment. Up until recently, the city spent only about $5,000 per homeless person. New York City, by contrast, spends about $17,000. Measure HHH, a tax hike that voters passed in November 2016, has the potential to move the needle by putting $1.2 billion toward homeless services and housing construction. One of the stated priorities of HHH is to expand the city’s “bridge housing” — temporary living spaces similar to shelters. As New York’s success has shown, temporary shelter is a crucial part of the equation. But while L.A. has allocated an additional $20 million for shelters, there has been a lot of resistance in communities and relatively few facilities have been built.

The fact that most of our homeless residents spend their nights indoors doesn’t mean we don’t have challenges. The homeless population continues to rise dramatically, as it does in Los Angeles. But we’ve made progress, and the money we have spent has had downstream benefits in money saved on things such as incarceration and emergency healthcare.

Emergency rooms never should have been on the front lines of trying to address the homeless crisis. In New York, they can now play a smaller and more appropriate role. Los Angeles should follow our lead.

Marc Siegel is a professor of medicine and medical director of Doctor Radio at NYU Langone Health. He wrote “The Unreal World” column for the L.A. Times for several years.