The Centers for Medicare & Medicaid Services has miscalculated hospital star ratings for two years, according to a startling report published by Modern Healthcare Friday.

Reviewing its own data, leaders at Rush University Medical Center in Chicago found that CMS gave more weight to certain factors during different rating periods. The hospital said the formula relied heavily on a measure for patient safety and adverse events for the first four releases, and then shifted preference toward hip and knee replacement complications for the latest one. In each calculation, a lone measure accounted for about 98% of a hospital’s safety performance, according to Rush.

The safety category greatly influences a hospital’s overall star rating. As in the skilled nursing world, star ratings are used by consumers and to help attract providers.

Modern Healthcare reported computer modeling led to the miscalculation, and that other analytic experts had approached CMS with concerns about its use.

Rush University discovered the error when it previewed its data last month and found the hospital’s rating had slipped by two stars.

CMS gives providers several weeks to check data and request reviews before it is published. The disclosure could serve as reminder to all providers to verify their publicly available data.

Skilled nursing facility provider preview reports for six data points from late 2016 through the end of 2017 are available through June 30. After the preview session, they will be posted on Nursing Home Compare.

Last week, CMS delayed the latest release of hospital star ratings until July, saying it was addressing “stakeholder concerns.” Modern Healthcare suggested Rush’s findings, shared exclusively with it, prompted the postponement.