With a per capita income almost twice as high as that in the rest of China, Shanghai—the country’s largest city—offers its 23.8 million residents a health care system that is the most advanced in China. But challenges remain.