An emergency room is, by definition, a destination of last resort.

Dr. Lois Lee, an emergency medicine physician at Boston Children’s Hospital, has worked at the hospital's Emergency Department since 1999.

Mostly, she oversees the treatment of critically ill children.

But not all the emergencies Dr. Lee sees are medical. Last December, a woman showed up at the emergency room, pregnant and with her two-year-old twins.

The twins weren’t sick. The family was there because they had nowhere else to go. They had found themselves homeless.

Emergency rooms are not meant, of course, to serve as emergency housing.

But hospital officials and some advocates for homeless families say that the number of homeless families turning to emergency rooms — and not the state — for shelter is on the rise. And data reviewed by WGBH News suggests an increase in the proportion of families turning to state shelter in Massachusetts —the only “Right to Shelter” state in the country — after having already gone without adequate shelter.

The woman and her twins at Boston Children’s Hospital were assigned a hospital social worker to help seek alternative shelter.

But when shelter couldn’t be secured, the family was given one of the hospital’s small rooms to sleep in. They would end up staying a week.

“If there truly is no safe place for them we cannot in good conscience send these families back out,” says Lee. 

It’s hardly an ideal solution for anyone. Families, Lee notes, risk exposure to contagious disease. Children could witness traumatic events in E.R. And the potential for trauma doesn’t end there.

 “These are just really families trying to do the best they can for themselves and have just come to a place where they — they can’t,” Lee said. “And that’s very hard.”

Lee says she regularly sees probably between ten and fifteen families a month, and similar reports have surfaced at other area hospitals.

During busy hours, families might have to wait in the waiting room. When things calm down, staff will try to find them a room.

And the number of these families appears to be growing.

Since Lee and her colleagues began collecting data on these visits, about eight years ago, the number of families reporting to the Children’s Hospital E.R. because they were homeless has grown from just seven families showing up without a place to sleep in 2012 — to some one hundred forty families in 2015.

In just the first two months of 2016, the last for which they collected data, they saw over forty families — about the same number who showed up all year in 2013.

What the numbers don’t explain is: why?

Some advocates for homeless families blame changes made years ago to the state’s “Emergency Assistance” program for homeless families — as well as a recent push by Governor Charlie Baker to eliminate the use of hotels and motels as emergency housing.

State officials, meanwhile, deny those claims and emphasize that families facing homelessness are placed in the state’s Emergency Assistance program “presumptively,” — with an assumption, in other words, of eligibility for assistance.

Massachusetts is the only state in the country that guarantees that homeless families be provided shelter, at the state’s expense, immediately.

But a 2012 change to the law spelled out certain eligibility criteria, including fleeing domestic abuse, fire or natural disaster, eviction, substance abuse or safety threats — or having spent the previous night in a place “not meant for human habitation.”

It’s that last threshold that has caused the most controversy.

Prior to the change, said Kelly Turley, director of legislative advocacy for the Massachusetts Coalition for the Homeless, families who found themselves suddenly upended from housing — kicked out of a friend’s house, for example — “would apply for shelter and they would be placed that night.”

“But now they have to wait to show that they’ve gone to the extreme of staying in an unfit place,” Turley said — like an emergency room.

Paul McMorrow, a spokesman for the state Department of Housing and Community Development, says that families are placed in the state’s Emergency Assistance program “presumptively,” — with an assumption that they are eligible — and that no family should ever feel forced to approach an emergency room for shelter.

McMorrow said the Department has met with hospital officials to work on the issue.

Some critics of the state’s apparatus, meanwhile, point to another change in the landscape of shelter for families: the rapid decline of the state’s use of hotels and motels as temporary housing.

Under a directive by Governor Charlie Baker the state has gone from housing over fifteen hundred families in hotel rooms just over one year ago to fewer than ninety now.

The use of hotels has long been controversial, and there is widespread agreement that they are hardly ideal shelter for families.

But as the use of hotels has dwindled, while some capacity has been replaced with shelter units — not all of it has (the state has increased the use of vouchers and other programs to “divert” families who might otherwise become homeless).

In December, the nonprofit law firm Greater Boston Legal Services sued the state’s Department of Housing and Community Development, which oversees the state’s Emergency Assistance program, alleging, in part, that in its push to end the use of hotels the state has been failing to meet its legal obligations to house families.

According to a complaint filed this January, one of the named plaintiffs, a mother of two girls, aged 7 and 9 and who is pregnant, was denied emergency assistance after the family was told they had to leave a friend’s house where they’d been staying. After spending the night sleeping on the floor of an un-named nonprofit, the complaint alleges, the family re-applied for state assistance.

“They still didn’t place her then, so the next night she went to the emergency room, having no other place to go, and stayed there,” says Ruth Bourquin a senior attorney at GBLS.

State officials forcefully dispute the claim that eligible families are being turned away and say that the department is meeting its obligations under the law.

State data reviewed by WGBH News does not indicate that the state’s placement rate for homeless families has changed substantially over the last year (though critics contend that the numbers don’t include families turned away before they apply).

But the proportion of families seeking shelter after having stayed in a place “not meant for human habitation” did increase, according to state records — from 11 percent in 2015 to 19 percent last year.

Legislation recently submitted by State Representative Marjorie Decker, of Cambridge, would change the program’s requirement language, removing the criteria of having already spent the night in an unsafe place.

“The idea that someone who is not really entitled to emergency shelter wants to spend one night voluntarily in a shelter, with their children —” said Decker, “To suggest that they have a better alternative, but they’re not choosing it, is absurd.”