The U.S. Department of Justice with the help of a San Antonio whistleblower settled a 7 year-old court case over allegations that Caremark, a part of CVS Health, intentionally miscalculated the amount they repaid Medicaid for prescriptions for more than a decade.

According to unsealed court documents, Donald Well found an error in the way his employer was calculating government reimbursements while auditing the company’s reimbursement program in 2004.

Well was a claims manager for CaremarkPCS, a pharmacy benefit management company, also called a PBM. It would later become CaremarkRx, a subsidiary of CVS Health. Basically insurance companies, unions, and others pay PBMs to manage the prescription portion of health plans.

Let’s say you qualify for Medicaid, but you are also on a private insurer--maybe your spouse’s job covers you--regardless you are what is called a "dual eligible." If you go to fill a prescription, your private insurer must pick up the tab. The government is by law an insurer of last resort.

But sometimes that isn’t how it goes. For whatever reason you might flash your Medicaid card and the pharmacy charges Medicaid. Then months later the government comes back to Caremark with a request for reimbursement, since they should have paid the bill in the first place.

Well let’s say your pills were 100 bucks, minus a 20 dollar co-pay when the feds come back and say, ok Caremark how much benefit is available for reimbursing us. According to the complaint filled in federal court this is where things got tricky.

“Even though they really had a 100 dollar benefit less a copay of 20 dollars, they would process the claim as if their benefit was the 80 dollars that Medicaid paid but from that they would take off the 20 dollars. They were basically making 20 bucks of the transaction,” says Glenn Grossenbacher, one of Donald Well's attorneys.

Furthermore, according Grossenbacher and their complaint, this skimming went on for a long time. Court documents allege since the early 90s.

Grossenbacher says that Well told his bosses and they didn’t do anything to fix it. After leaving the company in 2006 he filed suit under the False Claims Act, which allows individuals to sue on the behalf of the United States government. It’s called a qui tam case, and it allows the whistleblower to have a portion of the settlement. In Donald Well’s case, that’s about $1 million dollars of a six million dollar settlement.

According to the DOJ, the False Claims Act is one of their most powerful tools. They say since 2009 they have recouped more than $22 billion from companies defrauding the government. More than $14 billion was from cases involving federal health programs.

While the court documents allege willful dishonesty and fraud, Caremark--which is now CVS Health--denies any wrongdoing, and in a statement to TPR says they settled to avoid protracted litigation in the 7 year-old case.

CVS Health, also settled a very similar case last December with a different whistleblower for $4 million. That one had been going on for 14 years.