The deal follows months of negotiations and a brief breakup between the longtime medical partners.