During a recent evening on call in the hospital, I was asked to see an elderly woman with a failing kidney. She’d come in feeling weak and short of breath and had been admitted to the cardiology service because it seemed her heart wasn’t working right. Among other tests, she had been scheduled for a heart-imaging procedure the following morning; her doctors were worried that the vessels in her heart might be dangerously narrowed. But then they discovered that one of her kidneys wasn’t working, either. The ureter, a tube that drains urine from the kidney to the bladder, was blocked, and relieving the blockage would require minor surgery. This presented a dilemma. Her planned heart-imaging test would require contrast dye, which could only be given if her kidney function was restored—but surgery with a damaged heart was risky.

I went to the patient’s room, where I found her sitting alone in a reclining chair by the window, hands folded in her lap under a blanket. She smiled faintly when I walked in, but the creasing of her face was the only movement I detected. She didn’t look like someone who could bounce back from even a small misstep in care. The risks of surgery, and by extension the timing of it, would need to be considered carefully.

I called the anesthesiologist in charge of the operating room schedule to ask about availability. If the cardiology department cleared her for surgery, he said, he could fit her in the following morning. I then called the on-call cardiologist to ask whether it would be safe to proceed. He hesitated. “I’m just covering,” he said. “I don’t know her well enough to say one way or the other.” He offered to pass on the question to her regular cardiologist.

A while later, he called back: The regular cardiologist had given her blessing. After some more calls, the preparations were made. My work was done, I thought. But then the phone rang: It was the anesthesiologist, apologetic. “The computer system,” he said. “It’s not letting me book the surgery.” Her appointment for heart imaging, which had been made before her kidney problems were discovered, was still slated for the following morning; the system wouldn’t allow another procedure at the same time. So I called the cardiologist yet again, this time asking him to reschedule the heart study. But doctors weren’t allowed to change the schedule, he told me, and the administrators with access to it wouldn’t be reachable until morning.

I felt deflated. For hours, my attention had been consumed by challenges of coordination rather than actual patient care. And still the patient was at risk of experiencing delays for both of the things she needed—not for any medical reason, but simply because of an inflexible computer system and a poor workflow.

Situations like this are not rare, and they are vexing in part because they expose the widening gap between the ideal and reality of medicine. Doctors become doctors because they want to take care of patients. Their decade-long training focuses almost entirely on the substance of medicine—on diagnosing and treating illness. In practice, though, many of their challenges relate to the operations of medicine—managing a growing number of patients, coordinating care across multiple providers, documenting it all. Regulations governing the use of electronic medical records (EMRs), first introduced in the Health Information Technology for Economic and Clinical Health (HITECH) Act in 2009, have gotten more and more demanding, while expanded insurance coverage from the Affordable Care Act may have contributed to an uptrend in patient volume at many health centers. These changes are taking a toll on physicians: There’s some evidence that the administrative burden of medicine—and with it, the proportion of burned-out doctors—is on the rise. A study published last year in Health Affairs reported that from 2011 to 2014, physicians spent progressively more time on “desktop medicine” and less on face-to-face patient care. Another study found that the percentage of physicians reporting burnout increased over the same period; by 2014, more than half said they were affected.

To understand how burnout arises, imagine a young chef. At the restaurant where she works, Bistro Med, older chefs are retiring faster than new ones can be trained, and the customer base is growing, which means she has to cook more food in less time without compromising quality. This tall order is made taller by various ancillary tasks on her plate: bussing tables, washing dishes, coordinating with other chefs so orders aren’t missed, even calling the credit-card company when cards get declined.

Then the owners announce that to get paid for her work, this chef must document everything she cooks in an electronic record. The requirement sounds reasonable at first but proves to be a hassle of bewildering proportions. She can practically make eggs Benedict in her sleep, but enter “egg” into the computer system? Good luck. There are separate entries for white and brown eggs; egg whites, yolks, or both; cage-free and non-cage-free; small, medium, large, and jumbo. To log every ingredient, she ends up spending more time documenting her preparation than actually preparing the dish. And all the while, the owners are pressuring her to produce more and produce faster.

It wouldn’t be surprising if, at some point, the chef decided to quit. Or maybe she doesn’t quit—after all, she spent all those years in training—but her declining morale inevitably affects the quality of her work.

In medicine, burned-out doctors are more likely to make medical errors, work less efficiently, and refer their patients to other providers, increasing the overall complexity (and with it, the cost) of care. They’re also at high risk of attrition: A survey of nearly 7,000 U.S. physicians, published last year in the Mayo Clinic Proceedings, reported that one in 50 planned to leave medicine altogether in the next two years, while one in five planned to reduce clinical hours over the next year. Physicians who self-identified as burned out were more likely to follow through on their plans to quit.

What makes the burnout crisis especially serious is that it is hitting us right as the gap between the supply and demand for health care is widening: A quarter of U.S. physicians are expected to retire over the next decade, while the number of older Americans, who tend to need more health care, is expected to double by 2040. While it might be tempting to point to the historically competitive rates of medical-school admissions as proof that the talent pipeline for physicians won’t run dry, there is no guarantee. Last year, for the first time in at least a decade, the volume of medical school applications dropped—by nearly 14,000, according to data from the Association of American Medical Colleges. By the association’s projections, we may be short 100,000 physicians or more by 2030.

Some are trying to address the projected deficiency by increasing the number of practicing doctors. The Resident Physician Shortage Reduction Act, legislation introduced last year in Congress, would add 15,000 residency spots over a five-year period. Certain medical schools have reduced their duration, and some residency programs are offering opportunities for earlier specialization, effectively putting trainees to work sooner. But these efforts are unlikely to be sufficient. A second strategy becomes vital: namely, improving the workflow of medicine so that physicians are empowered to do their job well and derive satisfaction from it.

Just as chefs are most valuable when cooking, doctors are most valuable when doing what they were trained to do—treating patients. Likewise, non-physicians are better suited to accomplish many of the tasks that currently fall upon physicians. The use of medical scribes during clinic visits, for instance, not only frees doctors to talk with their patients but also potentially yields better documentation. A study published last month in the World Journal of Urology reported that the introduction of scribes in a urology practice significantly increased physician efficiency, work satisfaction, and revenue.

Meanwhile, there’s evidence that patients are more satisfied with their care when nurse practitioners or physician assistants provide some of it. This may be because these non-physicians spend more time than doctors on counseling patients and answering questions. In a perfectly efficient division of labor, physicians might focus on formulating diagnoses and treatment plans, with non-physicians overseeing routine health maintenance, discussing lifestyle changes, and educating patients on their medical conditions and treatment needs. Fortunately, over the next decade, employment of nurse practitioners and physician assistants in the United States is expected to grow by more than 30 percent; that compares with overall expected job growth of just 7 percent.

Yet the solution to health care’s labor problem isn’t simply to hire more staff; if not done right, that could make coordination even more cumbersome. A health-care organization’s success, in the years ahead, will depend on its success at delegating responsibilities among physicians and non-physicians, training the non-physicians to do their work independently, and empowering everyone—not just doctors—to shape a patient’s care and be accountable for the results.

Technology can make doctors’ lives easier, but also a lot harder. Consider the internet: It’s made information infinitely more attainable, but it takes time to find what one needs and to filter the accurate material from the inaccurate. The same goes for medicine. Technologies such as telemedicine, which allows for online doctor visits, can make health care more accessible and effective. But the use of EMRs, which is now federally mandated, is frequently cited as one of the main contributors to burnout. EMRs are often designed with billing rather than patient care in mind, and they can be frustrating and time-consuming to navigate. One attending doctor I know, tired of wading through a morass of irrelevant information, writes notes in the electronic chart but in parallel keeps summaries of his patients’ medical histories on hand-written index cards.

One can imagine a better EMR system, built around what health-care providers need. Today, in the absence of more effective tools, medical colleagues rely on email to coordinate patient care—or phone, as in the case of my kidney patient. But email chains can get buried in an inbox, and phone calls are rarely practical for coordinating between more than two people at a time. Neither mode of communication gets linked to a patient’s record, which means work is at risk of either getting lost or being replicated. But what if we were to integrate a tool into the electronic record that made clear what a patient’s active medical issues were, assigned responsibility to providers for overseeing those issues, and helped them to coordinate with each other? A dynamic EMR that didn’t just give physicians more information, but also helped them to prioritize, share, and act upon that information, would be far more useful than what currently exists.

As the world changes—as populations grow and technology advances—it is becoming essential that the workflow of medicine change alongside it. Fortunately for the patient with the failing kidney, the anesthesiologist was willing to get creative. Despite being unable to book the surgery, he unofficially reserved a slot for her and made the rest of his staff aware. The patient underwent the procedure the next morning, followed by her previously planned heart study. Everything worked out in the end. But I couldn’t help thinking: It shouldn’t be this hard to do the right thing.