In 1952, Roald Dahl volunteered for a medical experiment being run out of New York’s Presbyterian Hospital. By this point, the 36-year-old had already started to make a name for himself as a writer, with stories published in the New Yorker and Harper’s, but his decision to sign up for a gastroenterology study came from a place of pure curiosity.

Author Roald Dahl with his wife Patricia Neal, who suffered an aneurysm in 1965. His aggressive approach to Neal’s recovery led to a revolution in how strokes are understood and treated. (AP)

“They stuffed the tube up my nose and right down into the stomach and left it there for two hours,” he wrote later to his mother, according to Dahl’s authorized biographer, Donald Sturrock. Parts of the procedure Dahl found “unpleasant,” but mostly he marveled at being able to see the medical world up close. “The machine said there was nothing wrong with my own stomach,” he concluded, “but I’m going again because they find out a lot each time.”

This kind of behavior was no mere one-off for the future author of “Charlie and the Chocolate Factory.” While Dahl is known around the world for his exuberant children’s books, which have sold hundreds of millions of copies and whose neologisms (“golden ticket” and “oompa loompa,” to name two) have recently infiltrated the Oxford English Dictionary, he also held a quieter, parallel fascination with medicine that spanned his entire adult life. That passion not only crept into Dahl’s fiction over the years, but even led to the writer’s making some legitimately groundbreaking contributions to the field.

He led vaccination awareness campaigns and invented a medical device that was implanted in thousands of children. And when his first wife suffered a stroke, Dahl, who would have turned 100 in September, came up with a treatment whose legacy he couldn’t have foreseen. “He’s almost single-handedly revolutionized our approach to stroke rehabilitation,” says Tom Solomon, a British neurologist, “and set in chain a whole new notion about what we should be doing with these patients, which we’re still following today.” Solomon is also the author of “Roald Dahl’s Marvellous Medicine,” a hybrid memoir/science book about his time treating Dahl in the final months of the author’s life. (Dahl died in 1990 at age 74; the centennial of his birth is being celebrated as the Roald Dahl 100.)

“He was definitely a fixer. All during our lives he was a fixer,” says Dahl’s daughter Ophelia. “If there was a problem, he felt you should be able to address it with enough know-how and imagination. That was specifically borne out in medical issues.”

Dahl’s fascination with medicine began at an early age, according to Solomon. At boarding school, he kept careful note of the many ailments that sent students scurrying to the nurse’s office. Dahl took an added interest in bowel movements — which culminated in his buying a book called “The Culture of the Abdomen” while living in Africa in his early 20s, then convincing his roommates to join him in trying to keep themselves regular by performing a daily regimen of complicated exercises inspired by native dance.

Rather than pursue medicine as a career, however, Dahl wound up on the military track, joining the war effort and flying in the Royal Air Force. But he quickly became reacquainted with doctors when his plane crashed in the North African desert in 1940, rendering him temporarily blind and significantly injured. He would have multiple surgeries on his busted spine, and for decades he kept on his writing desk a jar of preserved spinal shavings as a kind of memento.

For some of his early short stories, such as the macabre “William and Mary” — about a man who extends his life by transplanting his brain and one eye into a liquid-filled jar — Dahl interviewed doctors to make sure he had the surgical details just right. “The description that he gave of the operation [in the story] was as good as anyone who was doing the operation,” Solomon says.

Ophelia Dahl remembers her father sitting around the dinner table years later, grilling a surgeon friend about what would happen if a person were to swallow a piece of jewelry — an idea that later turned up in his story “The Surgeon.”

It wasn’t until a series of tragedies struck his family, though, that Dahl became a contributor to the medical field. In 1960, on one of the family’s extended trips from England to the United States, his 4-month-old son’s carriage was struck by a taxi while crossing the street in New York City; baby Theo was launched 40 feet into the air before colliding with the side of a bus.

Dahl walks with his 5-year-old son Theo as they cross a field to go kite flying in 1965. (Leonard McCombe/Life Picture Collection/Getty Images)

Theo’s skull was shattered, but he survived, with the help of a shunt that drained excess fluid from around his brain. But these shunts contained tiny slits that could easily get blocked by bits of debris. Theo’s shunt would malfunction six times over the next nine months, according to Sturrock’s 2010 biography, each requiring a frantic return trip to the hospital and another intense surgery for the child.

Dahl was furious that so much pain and suffering could be caused by this one tiny instrument. So he started looking into the mechanics of shunts, and he discussed ways of improving them with one of Theo’s doctors, Kenneth Till. With the help of toymaker/hydraulic engineer Stanley Wade, who lived near Dahl’s home in England, they developed the Wade-Dahl-Till (WDT) valve, which was eventually fitted in 3,000 to 5,000 children around the world. Till published a paper announcing this new technology in the Lancet, and one of the WDT valves is displayed, alongside the author’s books, in the Roald Dahl Museum and Story Center in Great Missenden, about 20 miles outside London.

Just two years later, tragedy struck again. This time, Dahl’s eldest daughter, Olivia, came down with the measles and suddenly died of a rare type of brain inflammation caused by the virus. After a prolonged and intense mourning period, Dahl once again threw himself into activism, this time leading a national awareness campaign to increase vaccination rates among British children. “A pop star has teenage appeal and power,” Dahl told reporters, according to Solomon’s book. “I have great child power. I understand how a child’s mind works — that’s how I can help and influence.”

Dahl’s most significant contribution to medicine, however, came in the world of stroke therapy and rehabilitation.

In 1965, Dahl’s first wife, the American film actress Patricia Neal, suffered an aneurysm while pregnant with the couple’s fifth child. She lay unconscious in the hospital for nearly three weeks, and when she returned home, Neal couldn’t walk and could hardly speak. So Dahl recruited a team of enthusiastic amateurs from around the village of Great Missenden to push Neal back to normalcy with six hours of mental and physical exercise every day.

At the time, such an aggressive approach was seen as risky, but Dahl’s instincts were proven correct: Neal was able to return to acting just three years later, and the system pioneered by Dahl and one of the caretakers, Valerie Eaton Griffith, led to a revolution in how strokes are understood and treated, according to Solomon.

Throughout his wife’s recovery, Dahl kept careful notes of the process for an essay he would later publish in Ladies’ Home Journal. But research compiled by Dominic Cheetham, an English professor at Sophia University in Japan, suggests that Neal’s struggles to relearn how to speak also reinvigorated Dahl’s writing. Cheetham noticed that the first book he wrote following her stroke, “Charlie and the Great Glass Elevator,” contained twice as many new words and repurposings of older ones as any he’d written previously.

It didn’t stop there, as evidenced by “The BFG,” which stars a friendly but perpetually marble-mouthed giant.

“Some of the things the BFG said about how he was struggling with his language could have come straight out of the mouth of Pat [Neal],” Solomon says. Typically, when authors invent words, as Dahl did, they tend to be nouns: a new brand of soda, or a new name for a monster. Dahl, on the other hand, “started coming up with new adjectives, and new verbs, and new expressions,” according to Solomon. By the time he wrote “The BFG,” Dahl’s rate of neologisms spiked to nearly 475 instances in total — six times as high as even the “Charlie” sequel, Cheetham found.

For the rest of his life, Dahl would retain a keen interest in medicine. He continually referred to himself as a “frustrated doctor,” according to Sturrock’s biography, and his second wife, Felicity Crosland, used to tell the story of a plane ride they took where a fellow passenger needed medical attention. A flight attendant asked whether there was a doctor onboard, and Dahl had to be physically restrained from jumping to his feet. His 1981 book “George’s Marvelous Medicine” — about a boy who takes revenge on his curmudgeonly grandmother by replacing her medicine with a concoction of shampoo, horse lozenges and floor polish — is wryly dedicated to “doctors everywhere.”

(Ophelia Dahl credits her father’s fascination with medicine as one of the reasons she has pursued health care as a career, co-founding the global nonprofit Partners in Health.)

But as for taking credit for his contributions to medical care, Dahl was uncharacteristically modest. While researching his book (which will be released in the United States early next year), Solomon discovered that it was Dahl who actually wrote the first draft of the Lancet study announcing the WDT valve. He also wrote the skeleton of Valerie E. Griffith’s landmark manual “A Stroke in the Family,” which popularized the techniques Dahl had used in Neal’s recovery and which are still in use today. Yet in both cases, Dahl left all the credit to others.

“To be honest, it makes no sense to me,” Solomon says. “Because he always wanted to be a doctor. His books were full of heroes who, often against the odds, overcame the authorities and came up with something amazing and fantastic. Maybe he didn’t recognize that in himself.”

Dahl, who called himself a “frustrated doctor,” dedicated “George’s Marvelous Medicine” (Penguin Young Readers Group) to “doctors everywhere.” (Illustration © Quentin Blake)