Fewer seniors are re-entering the hospital after their first stay there, according to recent data from the Centers for Medicare and Medicaid Services. The Obama administration says that we have Obamacare to thank for this “positive transformative change.”

But the only thing that’s “changed” is how hospitals fill out the government’s forms. Many are choosing to record hospital stays under Medicare, the federal government’s healthcare program for seniors, as outpatient “medical observation” rather than formal readmission. That’s strapping patients with huge bills and limited options for follow-up care.

So hospitals are indeed meeting Obamacare’s statistical goals — at the expense of patients.

Obamacare’s architects wanted to reduce the number of times a patient returned to a hospital. Fewer readmissions, they reasoned, meant a hospital was doing a better job.

To achieve that goal, they created a penalty. If a hospital had an “excessive” number of readmissions within 30 days of an inpatient stay, Obamacare would reduce its Medicare payments.

Last year, the law cut payments to 2,592 hospitals — almost half of all hospitals — for a combined loss of $420 million. All but 209 of these hospitals also faced the penalty in 2014.

Unsurprisingly, hospitals have sought to avoid the penalty. Between 2012 and 2013, hospitals reported 150,000 fewer readmissions among Medicare patients.

To drive down readmission rates, hospitals simply manipulated the data. Patients returning with complications were no longer formally readmitted and given inpatient status. Instead, hospitals entered them as under outpatient “observation status.”

Indeed, as an August Health Affairs report noted, the readmission penalty “pressures hospitals to cheat.”

Of the 3,500 general hospitals subject to Obamacare’s penalty, readmission rates dropped by 9 percent between 2010 and 2013. But observation rates soared 48 percent. That uptick accounted for about 40 percent of the reduction in readmissions.

Problem solved, penalty avoided.

Unfortunately, patients under “observation” don’t qualify for Medicare’s benefits. For the program to pay for a subsequent nursing-home stay, a beneficiary must spend at least three nights in a hospital as an inpatient.

A patient under observation doesn’t meet that standard. So even if a patient spends days in a hospital bed, the federal government won’t cover the cost of his or her rehabilitative treatment or medication afterward.

That can leave seniors responsible for thousands of dollars in medical bills.

Consider the case of Bob Wellentin. After his wife spent four days in a hospital, she went to a nursing home. But since she had been classified as “under observation” — not as a readmission — Medicare wouldn’t pay for her nursing-home stay. She was handed a bill for $20,000. To pay it, she and her husband had to liquidate a life-insurance policy.

Meanwhile, Harold Engler endured a 10-day outpatient “medical observation” stay because of complications from hernia surgery. He ended up with $7,859 in nursing-home rehabilitation costs.

Once patients have been deemed under observation, it’s difficult to get the classification reversed. They often must pay out of pocket for their care and then seek reimbursement. That’s difficult for the many Americans who don’t have thousands of dollars lying around. And they must wage a two-front legal battle against both the federal government and medical bureaucracies.

Keeping seniors from having to be readmitted to the hospital is a worthy goal. Unfortunately, Obamacare has blessed fraud as an acceptable means of achieving it. Seniors are paying the price.

Sally C. Pipes is President, CEO, and Thomas W. Smith Fellow in Health Care Policy at the Pacific Research Institute. Her latest book, The Way Out of Obamacare (Encounter), was released in January.