A pilot project by Medicare that links hospital payments to the quality of care has helped prevent infections in pneumonia patients and cut death rates in heart-attack patients, according to data. In the project, hospitals compete for cash incentives from Medicare, the government insurance program for the elderly and disabled. Medicare officials are expected to announce that 225 hospitals will divide $12 million in bonuses; three poor performers will be penalized.