There's actually a field called hospital epidemiology. Much of their work is in infection control (preventing nosocomial infections, tracing outbreaks, including using molecular techniques to see if a patient caught the bug in the hospital or if they acquired it in the community). There's also other hospital outcomes and quality control issues that can be worked on (like hospital injuries for patients and staff, quality of care - are guidelines being met, and what impact does that have on patient outcomes, appropriate / inappropriate medication use, etc).