President Barack Obama has signed legislation permanently changing how Medicare pays doctors, a rare