Californians with Medicare coverage would no longer be surprised by huge medical bills stemming from “observation care” in hospitals under legislation that state lawmakers approved overwhelmingly last week and sent to Gov. Jerry Brown to sign into law.

The sticker-shock can happen when people go to the hospital but health care providers are not sure what’s wrong. If the patient is not sick enough to be formally admitted, but still not healthy enough to go home, they can stay in the hospital for “observation care,” which Medicare considers an outpatient service. That can mean higher out-of-pocket expenses for the patient.

Hospitals can bill observation patients for a larger share of the cost of any treatment and tests than admitted patients. Any routine medications they usually take at home may not be covered at all in the hospital. In some parts of the country, Medicare observation patients have been charged exorbitant prices for prescription drugs, including $18 for one baby aspirin.

And because observation patients have not spent the required minimum of three straight days as an admitted patient, Medicare will not cover their follow-up nursing home expenses after discharge. Observation care doesn’t count.

But patients may not even know they have been placed on observation care status when they’re lying in a hospital bed.

Hernandez introduced the legislation requiring hospitals starting Jan. 1 to tell all patients if they are getting observation care.

The state’s observation care notice would not necessarily spell out the details, but it would warn patients that their status could affect what their insurance will cover.

After they get the notice, Medicare observation patients can try to ask their doctors to change that status. If their doctor prescribes nursing home care, they’ll have to pay the bill but can try appealing to Medicare for reimbursement, or they can go home and recover on their own.

Members of private Medicare Advantage plans should ask their plans about their observation care policies, since they can vary.

The number of Medicare observation patients at the nation’s hospitals doubled since 2006 to nearly 1.9 million in 2014, according to the most recent statistics from the Centers for Medicare & Medicaid Services.

In California, the number of people hospitalized for observation, regardless of their type of health insurance, was 417,366 in 2015, also more than twice as many as in 2006. The rate rose far faster than the percentage of patients admitted to the hospital (14 percent, to 3.54 million) during the same time, according to the California Office of Statewide Health Planning and Development.

Hospital officials have blamed the increase, in part, on stepped-up enforcement of the strict criteria Medicare has set for hospital admissions to avoid paying for unnecessary treatment. Medicare won’t pay anything for admitted patients who instead should have been placed in observation.

“We hope this legislation takes care of the problems we have seen associated with patients not being aware that they are actually not admitted into the hospital even though they are physically located in the hospital,” said Bonnie Castillo, associate executive director for the California Nurses Association, which represents more than 90,000 nurses and is a leading advocate for the bill.

Among those patients is Lois Frarie, a 96-year-old retired teacher from Monterey. She spent four days in the hospital, including two as an observation patient, after she fell and fractured her elbow and pelvis, requiring surgery four years ago. When a hospital review committee switched her status to observation, she didn’t even move to a different room.

“She had no clue this was going on,” said her niece, Sherry Smith.

It wasn’t until Frarie was about to be discharged from the hospital to a nursing home to regain her strength that her family found out Medicare would not cover her care because she didn’t have a three-day hospital admission. Before the nursing home would accept her, her family had to pay $7,000 up front. When she returned home three months later, she owed more than $19,000.

Smith appealed to Medicare for reimbursement on her aunt’s behalf, an effort that only ended last year. Officials eventually agreed only to pay for the ambulance that brought Frarie to the hospital.

The legislation also would require the nation’s first minimum nurse-to-patient staffing ratios in observation care units for hospitals that have separate units for those patients.

“We are still the only state that has these very specific mandated ratios for every unit of the hospital that have to be adhered to every minute of every day,” said Jan Emerson-Shea, a spokeswoman for the California Hospital Association, which represents 400 hospitals. Those staffing rules, however, excluded observation care units.

“We wanted to make sure hospitals didn’t use observation care as a loophole to avoid any of the minimum nursing staffing requirements,” said Sen. Hernandez.

If Gov. Brown signs the legislation, as many expect, Hernandez said California’s observation care notice could be combined with a federal observation care notice that hospitals also must use next year.

While the federal notice provides more details in a standardized form, it is only for Medicare patients and only after they’ve spent 24 hours in observation. To comply with the state requirements, California hospitals would have to give it as soon as possible to all observation patients, no matter what health insurance they have.

Although the state hospital association neither opposed nor supported the Hernandez legislation, the observation notice is important, said Debby Rogers, the association’s vice president of clinical performance and a former emergency room nurse.

“Our goals are to make decisions in the best interest of the patients, and providing notification of their status we think helps them, and at the same time informs them if there are risks,” Rogers said.

But a notice alone is not enough, said Bonnie Burns, a training and policy specialist at California Health Advocates, a Medicare advocacy group based in Sacramento.

“It is a baby step that at least tells them there is a problem,” Burns said. “The issue for many beneficiaries is that the time spent in observation doesn’t let them access the Medicare nursing home benefit. The better fix would be to allow people to use their Medicare benefit if they have been under observation.”