If we had paid closer attention to The Simpsons 18 years ago, the election of Donald Trump might not have come as such a shock. And if German neurologist Jens Dreier had just binged enough Star Trek: The Next Generation, he could have already known the outcome of his groundbreaking research, which the sci-fi series predicted 30 years ago.

Dreier works at the Charité Hospital in Berlin, one of Germany's leading university hospitals. In February, the 52-year-old and his colleague, Jed Hartings, published a study that details what happens to our brain at the point of death. It describes how the brain's neurons transmit electrical signals with full force one last time before they completely die off. Though this phenomenon, popularly known in the medical community as a "brain tsunami," had previously only been seen in animals, Dreier and Hartings were able to show it in humans as they died. Their work goes on to suggest that in certain circumstances, the process could be stopped entirely, theorizing that it could be done if enough oxygen is supplied to the brain before the cells are destroyed.

Soon after their discovery, the two researchers also found out that a 1988 episode of Star Trek: The Next Generation shows chief physician Beverly Crusher trying to revive Lieutenant Tasha Yar, while clearly describing the exact processes the neurologists have been trying to understand for years. I spoke to Dreier about their discovery and how it feels to be beaten by a TV show by three decades.

VICE: How do you study the brain of a dying patient? Jens: We specifically monitor the brain of patients who are in intensive care to check if they're at risk of having a stroke. By using modern neuro-monitoring, which can record brain activity with great precision, we can see exactly what happens to the brain at the point of death for those patients who sadly don't make it.

What happens exactly? About 30 seconds after we go into cardiac arrest, our bodies sort of switch into an energy saving mode by shutting down all of our nerve cells. But once we become almost entirely nonfunctional, our cells come out of their inhibited state and release all their stored energy, which ripples throughout the brain.

And that leads to the brain tsunami? Yes. That initial wave of sudden electromagnetic energy eventually causes the cells in the brain to break down. Since we began studying this phenomenon in 1993, our ultimate goal has been to either prevent it from happening or slow it down enough so the patient can continue to be treated. But, unfortunately, there are always complications that make it very difficult to work fast enough.

So how did you find out that an episode of Star Trek had predicted your findings 30 years ago? My colleague, Jed Hartings, brought it to my attention after watching the scene and noticing how similar it is to our work. My best guess is that the creators of Star Trek must have found research at the time that detailed a similar process in animals. The first person to research these sort of brain waves was a Brazilian neurophysiologist who conducted studies on rabbits in the 1940s. All we've done is show it in humans, which has taken this long because medical research in general is an incredibly slow process.

WATCH: The UK's Fake Xanax Epidemic

Did it bother you that Star Trek: The Next Generation seemed to get there before you?No. The process in Star Trek doesn't go into much detail but does lay out the general principle really well. Our research is important because we're not only showing that the process happens, but also how we might be able to stop it.

Can you use your research to explain near-death experiences? It's quite possible that the increased brain activity could lead to people seeing a bright light or experiencing tunnel vision. If that person is then brought back before the cells are destroyed, it's entirely possible that they could remember what they saw. But I don't think any of us will ever know until we experience it ourselves.

Are you fascinated by death? The more I've studied it, the more I've realized that, as a society, we don't talk about it enough. Often when people lose someone close to them, they’re not very well prepared for it. It's a basic part of the process of life, and may even end up being a positive experience.