Wrongly coded patient visits caused Medicare to overpay hospitals nearly $8 million, an inspector general's report has found.

After sampling 110 random line items from hospitals around the country, the Centers for Medicare and Medicaid's IG found that only two were correct.

Thus, the IG calculated that CMS wrongly paid out $7.5 million to hospitals in 2010 and 2011 for hospital visits.

"The hospitals attributed the incorrect payments to clerical errors, staff not fully understanding Medicare billing requirements for clinic visits, reliance on the code that the physician selected for the visit, or billing systems that could not identify established patients," the report said.

Labeling patients as "new" instead of "established" — which is required when the patient already has a medical record at a hospital — was found to be a cause of many of the incorrect payments.

As of Jan. 1 of this year, CMS replaced the codes with a single code to "describe any and all hospital outpatient clinic visits," according to the report.

CMS said it will at first consider its "return on investment" before it attempts to get back the overpayments.