When Danielle Brooks, 23, was diagnosed with narcolepsy at age 15, her peers taunted her with the nickname Bobblehead — how she looked nodding off. But since receiving her service dog, Rollo, in 2014, she can hold her head high.

“He wakes me up to take my medication,” Brooks, who is in her first year of grad school at Georgia State, tells The Post. “He pulls me along when walking to reduce fatigue, he picks things up for me when my muscles feel weak, and he can even open doors. His favorite thing to do is push the handicap touch button on doors with his paws.”

Brooks and Rollo’s bond is one of the medical relationships explored in the new book “Doctor Dogs: How Our Best Friends Are Becoming Our Best Medicine” (Dutton; out Tuesday), by Maria Goodavage, a journalist and the author of numerous books on dogs with jobs, including the bestseller “Secret Service Dogs: The Heroes Who Protect the President of the United States.”

“If it has a smell, a dog can detect it,” Goodavage tells The Post.

Goodavage had been writing about how service dogs use their noses to “catch the bad guys” for years. But after hearing about dogs in Japan and Pennsylvania being trained to sniff out cancer, she spent two years traveling the world looking for the best “doctor dog” stories.

These ultraproductive pups are not your traditional emotional-support, guide or therapy dogs. Some are trained to “mitigate specific medical problems,” while others “work in a research setting,” says Goodavage. “They are trained based on a smell and reward system.”

Some, like Rollo, work with humans in their homes, while others work in medical labs or alongside doctors in hospitals — such as Angus, an English springer spaniel in Vancouver who’s trained to find the superbug Clostridium difficile (known as C. diff, a bacterium that causes diarrhea and colitis).

He has “every dog’s dream job,” Goodavage writes: “He gets to sniff poop for a living.”

Pups can even sniff out feelings. “Skin swabs and saliva samples are being collected from people who are experiencing anxiety and fear,” says Goodavage. “They’re training dogs to smell emotions to further mental health research. It’s amazing.”

Scientists are still figuring out what exactly dogs are smelling when they sniff out disease — but it’s clear that they’re getting a whiff of something we can’t. Pups in Japan are working to recognize the scent of stomach cancer in urine samples, while canines in Croatia can sense seizures with their snouts. At Penn Vet Working Dogs Center at the University of Pennsylvania, researchers identified blood plasma chemicals associated with ovarian cancer so dogs could be trained to identify the smell.

“I was nervous to meet [ovarian-sniffing dogs] because my mom passed in 2003 of ovarian cancer,” says Goodavage, adding that these canines are trained to smell samples in lab settings, not to sniff out disease on humans. “But that was silly . . . One came out and rolled over and I gave her a belly rub.” As far as Goodavage knows, she’s cancer free.

One important note from Goodavage: The eventual goal of studying dogs isn’t to install a fluffy disease detector in every house. Instead, she says, scientists hope to eventually “mimic” dogs’ sense of smell via “e-noses,” which doctors and researchers can use to diagnose diseases simply by scent.

Until then, we’ll rely on good boys like Rollo, to whom Brooks credits her college years, travels abroad and independence.

“Before Rollo, I would have a handful of bad falls a month. Now I’ve only had a handful of falls in five years,” she says. “I’m able to live on my own because of him.”