Republicans and Democrats in both the House and Senate are working on legislation that would force the largest health-care companies in the United States to divest from pharmacies that they own.