On the Republican campaign trail, the healthcare debate has focused on the mandatory coverage that Mitt Romney signed into law as governor in 2006. But back in Massachusetts the conversation has moved on, and lawmakers are now confronting the problem that Mr. Romney left unaddressed: the state's spiraling healthcare costs. After three years of study, the state's legislative leaders appear close to producing bills that would make Massachusetts the first state — again — to radically revamp the way doctors, hospitals and other health providers are paid. Although important details remain to be negotiated, the legislative leaders and Gov. Deval Patrick, all Democrats, are working toward a plan that would encourage flat "global payments" to networks of providers for keeping patients well, replacing the fee-for-service system that creates incentives for excessive care by paying for each visit and procedure. "We have shown the nation how to extend care to everybody," Mr. Patrick said in an interview, "and we'll be the place to crack the code on costs."