In 1992, the federal government told drugmakers they had to give steep discounts to hospitals that treat a large percentage of poor patients.

The law got bipartisan support and it was a boon for hospitals and the federal government. In the decades that followed, the discount program has grown by leaps and bounds.

But this spring, as the feds have been drawing up new rules for the program, a pitched battle has broken out between hospitals and drug manufacturers who say the program, known as 340B, is bloated and badly regulated.

The drugmakers say the law is meant to benefit patients like David Chance. He turned up at Oregon Health and Science University Hospital in Portland a few weeks ago saying it was hard to breathe every time he laid down.

"They put a catheter in the vein in my leg that goes up to my heart, injected some dye so they could see the circulation around and in the vessels around the heart," he says.

Chance has an enlarged heart and a valve that doesn't close properly. "I'll be changing my diet and on prescriptions for a little while," he says.

Those prescriptions include a cholesterol-lowering statin and a blood thinner that cost about $125 a month. Chance works at a Portland area call center and doesn't have health insurance, so the hospital is using its 340B funds to give Chance his first month of prescription medicine free.

"Yeah, it's great," he says. "I'd probably be having difficulties affording them otherwise."

Chance's case is an example of what the drug companies say 340B hospitals should be doing with the discounts: helping poor and vulnerable patients.

But, here's the rub. Sometimes, instead of passing on drug discounts to patients like Chance, the hospitals sell the medicines at higher prices to their insured patients.

Copyright 2016 Oregon Public Broadcasting. To see more, visit Oregon Public Broadcasting.