In 2007, CMS adopted a new system for assigning different health conditions levels of severity, which could affect how much hospitals are paid for treating patients with those conditions.

Despite being relatively rare in the United States, "Medicare paid hospitals $2.5 billion for claims that included a diagnosis code for Kwashiorkor" from 2006 through 2014, according to the probe by the Office of the Inspector General at the U.S. Health and Human Services Department.

Kwashiorkor typically is seen in children living in tropical and subtropical parts of the world.

The issue is related diagnosis codes used to bill the nation's Medicare system for treatments of people with the disease Kwashiorkor , a form of severe protein malnutrition. Medicare pays health providers set rates for treatment or services to patients depending on the codes submitted.

Just a fraction of that money — $5.7 million to date — has been repaid by hospitals to the Centers for Medicare and Medicaid Services in connection with billing CMS for patients who did not have the disease claimed on invoices, according to investigators.

A top federal health agency's failure for seven years to fix a known problem with a Medicare billing code may have unnecessarily cost taxpayers $102 million in payments to hospitals , an investigation has found.

Kwashiorkor has a higher level of severity — meaning hospitals could get paid more for treating patients with that disease. Other, less severe forms of malnutrition or protein deficiency were paid at a lower rate.

But it turned out that the same code number — 260 — was assigned to both Kwashiorkor and to less severe forms of malnutritions on one list that was part of the international coding classification that is a key tool for for billing. However, on another type of list in that classification system, Kwashiorkor alone had the 260 designation.

"Even though CMS was aware of the discrepancy, it did not take any separate action to address it," the inspector general's report said.

"CMS did not have adequate policies and procedures in place to address this discrepancy."

Thousands of hospitals submitted claims with a 260 code for a patient suffering from malnutrition, but not from Kwashiorkor. In many of those cases, the IG's office said, hospitals received more money than they were entitled to from Medicare because the system was assuming the patient had Kwashiorkor given the diagnosis code submitted.

In 2006, about 11,000 Medicare claims included diagnosis code 260.

Over the next three years, after CMS implemented the new system, "the number of claims that included diagnosis code 260 rose to approximately 45,000" for 2009, according to the IG's office.

There was a sharp drop-off in the number of claims with that code after 2009, when the American Hospital Association published a guidance noting that the 260 code should be used for Kwashiorkor only. But the IG's office found there still were many cases after 2009 of improper use of the code.

The discrepancy in the coding classifications was corrected in 2015, with the issuance of a new coding system, known as ICD-10.

The IG's office said it reviewed 4,393 patient claims with 260 codes from the years 2010 through 2015 at 25 hospitals. For 2,248 of those claims, removing the 260 code had no effect in the payment amount the hospitals would have received or in the severity designation for the claim.

For the remaining 2,145 claims, all but one claim incorrectly included the diagnosis code for Kwashiorkor, resulting in overpayments of $6.03 million, the IG's office said.

"We determined that all of the providers should have used codes for other forms of malnutrition or no malnutrition code at all instead of using the diagnosis cost 260," the report said.

It said the IG's office had obtained repayment of $5.68 million from the hospitals found to have improperly billed Medicare using the 260 code.

But "we estimate that Medicare could have saved approximately $102 million from [2006 through 2014] if the coding discrepancy had been immediately corrected," the report said.

A spokesman for CMS noted, in response to a request for comment from CNBC, that the agency had concurred with the IG office's recommendations in the report.

CMS has asked the AHA to publish additional coding guidance on the use of the Kwashiorkor diagnosis code to address the incorrect use of the code by some health-care providers.

"We are also working with the AHA and doctors to provide more education on appropriate use and how it is filed in their medical claims for payment," CMS said.