Technology can be a double-edged sword. New advancements have the power to improve our quality of life, while simultaneously putting us out of a job.

This process has been going on for thousands of years. I presume that the introduction of the wheel was greeted with a great deal of consternation from workers in the “carry heavy things around” guild. Factory outputs that once required thousands of workers are now sometimes achieved with less than a hundred. Dial-up modem designers have been financially ruined by faster internet connections.

The point is, technology is replacing people in the workforce. It’s extremely unlikely that the trend will be broken anytime soon, given how many robotics, programming, and artificial intelligence breakthroughs have been made in recent years, with more coming every day.

On the surface, the medical field seems like it might be immune from advances in automation. After all, I’ve yet to see a cyborg nurse prep someone for surgery, or a computer that knows how to treat diabetes. It’s actually true that, compared to some other fields, health care is a relatively safe field.

Automation most easily displaces workers who perform simple tasks, and most of what happens in the medical field is anything but. Whether administering care or approving insurance claims, healthcare jobs are often anything but simple.

With that said, it’s almost a certainty that some medical jobs are going to go away in the next few decades. Automated systems are becoming remarkably successful at tasks that once would have been considered impossible for anything other than an experienced and skilled human professional. For example, there are already prototype surgical robots that have the potential to replace trained surgeons in certain tasks, and as time goes on, they’ll only get more capable.

The key to staying ahead of automation is to have the kinds of skills that computers aren’t good at. For example, a delicate, but relatively straightforward surgery like an appendectomy might greatly benefit from a steady-handed machine, but I’d much rather give feedback to a living doctor poking around in my head if I was undergoing brain surgery. I have no faith that a computer would understand that “when you cut there, the world tastes like jazz” means please stop.

Recently, I was sitting in the waiting room at a VA medical center and watched a machine that was essentially a self-propelled cabinet drive through the halls. At some point, it would have been an orderly or some other hospital employee who delivered supplies or sheets to patients and doctors.

All it took was a couple of wheels and a basic navigation capability and there was one less job on the market. Labor-intensive medical jobs like these re-prime candidates for replacement. A hospital won’t pay a human $30,000 per year for a job that they can give to a $5,000 robot that works around the clock.

When looking for jobs that are likely to still be there in 20 or 30 years, consider not just the types of tasks that computers can’t do, but also the kinds of jobs that we don’t want them to do.

It’s pretty easy to see that a large chunk of a doctor’s job could be replaced by an advanced computer program like “Deep Blue” (which famously defeated chess Grand Master Garry Kasparov), which could be programmed to correlate a constellation of symptoms and prescribing the drug that is most likely to help.

On the other hand, very few people are going to want to find out potentially devastating medical news from a computer printout. There, we’re going to probably want to have the bedside manner of an actual human doctor, and I can’t see that changing anytime soon.

Another skill area where humans still have a distinct advantage is in jobs that require flexibility.

I can see a situation where EMTs and paramedics are provided with advanced robotic and computerized tools, but emergency rescue is far from predictable. For the foreseeable future, it’s going to be a lot more effective to employ a human with flexible judgment who can respond to unexpected circumstances than to put a robot on the job and hope for the best.

Other jobs where decision-making skills are likely to remain crucial important include medical research, medical ethics, and heavily patient-centric therapy positions. It’s going to be a long time before your psychiatrist is going to be replaced with a T-1000.

There’s simply no way to predict exactly how automation will affect the medical field, even five to 10 years in the future. If you look back at science fiction of 50 years ago, we were all supposed to have atomic-powered cars and jetpacks, but nobody saw Angry Birds on the phone coming.

It’s a virtual certainty that certain technologies will advance faster than expected, and others slower. Rather than rely on an ironclad prediction, it’s important to consider the kinds of jobs that are likely to endure in some form and try to stay away from those that are obviously slated for history’s employment trash heap.

READ NEXT: 6 Healthcare Careers for Squeamish People