Massachusetts Gov. Deval Patrick has signed into law one of the nation's strictest limits on gifts given to medical professionals by drug salespeople, the most contentious measure contained in a broad package intended to improve healthcare safety and curb skyrocketing costs. The new law also provides $25 million to promote electronic medical record-keeping, requires the state university to graduate more primary care doctors, and gives regulators the power to hold hearings when health insurers want to raise premiums.