Eighty percent of Massachusetts' hospitals were in the black last year, although their finances declined slightly compared to 2014, according to a new report (.pdf) issued by the state's Center for Health Information and Analysis.

The report noted that 52 of the state's 65 acute care hospitals reported total positive profit margins in 2015. The median total margin was 3.7 percent last year, compared to 4.2 percent in 2014. Winchester Hospital had the highest margin, at 15.9 percent. Statewide operating margin was was 3 percent last year, an improvement from 2.4 percent in 2014.

Liquidity was also mostly unchanged. The median days in accounts receivable was 38 days last year, down from 41 in 2014.

Teaching hospitals remained in the black, but have been hit hard in the past year. Their median total margin was 4.2 percent, slightly higher than the statewide average but far below the median of 8.2 percent in 2014. Cash flow to debt ratio was 21.1 percent, down from 31 percent in 2014.

Nationwide, non-profit hospitals were among the most profitable in the nation, with seven of the 10 most profitable being not-for-profit enterprises. And while the bottom lines of many non-profit hospitals suffered during the Great Recession, most have rebounded nicely in recent years.

But some hospitals and healthcare systems that posted relatively robust numbers still were facing financial issues. Baystate Medical Center in Springfield had a profit margin of 6.7 percent last year. But its parent network, Baystate Health, is facing a $75 million budget gap, Masslive.com reported.

“When you look at these hospitals, you really have to look at the entire system,” Baystate Chief Financial Officer Dennis W. Chalke told MassLive.com. “We look at the total, that is what is important at the end of the day.”