CVS is working to become a major health care provider as the pharmacy chain adds doctors to its payroll, following a trend among pharmacies like Walgreens integrating more primary health care services.