Then she went home, but felt faint and took several falls. Five days later, her primary care doctor sent her back to the hospital. This time, her stay lasted 39 days while physicians tried various medications to regulate her blood pressure.

Though they eventually succeeded, Mrs. Niemi, 84, a retired insurance agent, had grown so weak that she could no longer walk.

“They said, ‘She really needs to go to a skilled nursing facility for physical therapy,’” recalled her son Tom Krpata, 63, who’d come from his home in Holliston, Mass., to be with her.

He agreed, but soon learned one of the brutal truths of Medicare policy: Patients can be hospitalized for days, can undergo exams and tests, can receive drugs — without ever officially being admitted to the hospital.

Instead, they’re “under observation,” which means they’re outpatients, not inpatients. That can bring financial hardships — including lack of coverage for subsequent nursing home care.

That’s why Mrs. Niemi, on observation status through both hospital stays except for one night, had to pay for rehab herself. “By declaring her an outpatient, they really took away her Medicare benefits,” Mr. Krpata said.

Patients can appeal virtually any other claim that Medicare denies. But there’s no way to appeal observation status. Even Mrs. Niemi’s congressman, contacted by her family, couldn’t help.

But a recent ruling in a case that’s bounced through the courts since 2011 may be a harbinger of changes to come.

On July 31, a federal judge in Connecticut certified a class in a class-action lawsuit: all Medicare recipients who’ve been hospitalized and received observation services as outpatients since January 1, 2009.

That means hundreds of thousands of people, Ms. Niemi among them, will be eligible to join the suit against the Centers for Medicare and Medicaid Services, with a trial expected next year. If the plaintiffs prevail, they’ll be able to appeal their observation-outpatient stays.

“People call in dire situations, and we have to tell them there’s no way to challenge this,” said Alice Bers, litigation director of the Center for Medicare Advocacy, which brought the lawsuit with Justice in Aging and a law firm, Wilson Sonsini Goodrich & Rosati. “Now we can tell them, ‘You’re a member of the class, so stay tuned.’”

A quick primer on a confusing situation: Medicare Part A covers hospital care for inpatients. Outpatients, including those on observation status, are covered under Part B. That distinction has generated complaints and controversy for years, as the number of inpatient hospitalizations has declined among Medicare recipients and outpatient stays have become more common.

Why does the classification matter? Outpatients can face higher payments for drugs and coinsurance, but the big-ticket item is nursing home care.

After a hospital discharge, Medicare pays the full cost of skilled nursing for the first 20 days, and most costs up to 100 days — but only for patients who’ve spent three consecutive days as inpatients. Without three inpatient days, patients are on their own.

Though most observation patients return home and needn’t to worry about nursing home costs, nearly two-thirds of those who do need skilled nursing have to shoulder the substantial costs themselves, according to a report from the AARP Public Policy Institute.

Mrs. Niemi did go to a nursing home and now owes close to $5,000 — only because nursing homes near Greenville charge a comparatively modest $150 to $160 a day. Nationally, nursing home care cost $225 a day last year, according to the Genworth Cost of Care Study, and more than $400 a day in cities like New York and San Francisco.

Recognizing the problem, Congress passed legislation that took effect earlier this year, requiring that hospitals inform patients when they’re not inpatients but are under observation.

So while it came as news to Mr. Krpata that his mother’s status would mean no coverage for a nursing home, at least he knew what her status was — not that he could do anything about it.

Medicare administrators, who declined to comment for this article because of the ongoing litigation, tried to clarify observation status in 2013 with the so-called “two midnight rule.” When physicians expect a hospitalized patient to need care for at least two midnights, Medicare expects that inpatient care is probably appropriate; for shorter stays, beneficiaries would likely remain outpatients.

The rule hasn’t helped, though, according to a report last year from the Office of Inspector General of the Department of Health and Human Services. Inpatient stays are still decreasing and outpatient stays are growing, the report found. More of those outpatients have “limited access” to skilled nursing afterward, and pay more for it.

Gaining the right to appeal observation-outpatient classification won’t solve that problem, even if patients should win their class action suit.

“The Medicare appeals system is far from perfect,” said Ms. Bers. Patients routinely lose in the early stages, and though their odds of success improve if they pursue the appeal to an administrative law judge, many drop out before that point.

A far more effective remedy: the Improving Access to Medicare Coverage Act that Rep. Joe Courtney, Democrat of Connecticut, has introduced in each Congress since 2010. It calls for counting any consecutive three days spent in a hospital toward the requirement for nursing home benefits, regardless of whether people are inpatients or outpatients.

Not only has the bill drawn broad bipartisan support in both the House and Senate, a raft of medical and advocacy groups also have also endorsed it, including the American Medical Association and AARP.

“Going to a nursing facility is not on everybody’s wish list,” said Carol Levine, director of the United Hospital Fund’s Families and Health Care Project, who said she was not speaking for the group.

“But if it’s the best alternative for the patient, they shouldn’t have to jump over these kinds of bureaucratic rules that make it financially impossible.”

So far, though, the legislation has gone nowhere. For now, suing Medicare for the right to appeal probably offers the best route to fairer treatment for hospitalized patients.

“That’s the way these things move, in incremental steps,” Ms. Levine said. “And this could be an important one.”