Getting out of bed after a surgery is often a challenge. At Cedars-Sinai Hospital in Los Angeles, the doctors have figured out a new way to motivate patients: Fitbits.

The hospital is giving out Fitbit activity trackers to its patients after knee replacements, hip replacements and other surgeries, to encourage them to start walking short distances.

For healthy people, 10,000 steps a day is a typical goal. But the doctors at Cedars-Sinai found that patients that reach even 1,000 steps are usually discharged sooner than those who don't.

"Patients need to walk after they've had a surgery," said Brennan Spiegel, director of health services research at Cedars-Sinai, in an interview with CNBC. "There's decades of research, so we know that."

Spiegel is among the medical professionals who started working with Fitbit as the company expanded beyond the consumer market and into research and clinical studies. Fitbit told CNBC in September that it's unfazed by rivals like Apple and Samsung, in part due to the company's focus on health and medical applications.