Paying attention to one's own personal hygiene and being selective in where you eat and drink will allow you to avoid most common ailments. Standard guidebooks will offer additional tips. Here are some web resources you may find useful.
SARS is a dangerous disease, but this year has not posed a significant threat. There are a handful of confirmed cases in China, but all are linked to a lab error in Beijing. As of this writing, there are no reported cases in the Shanghai area. Still, you may want to read more on the disease: