The prescription drug underneath that childproof cap is often the culmination of myriad complex chemical reactions choreographed in huge industrial facilities on several continents, across many months of time. The future, however, could look very different.

Patients could, one day, potentially obtain pills from a machine that is able to take raw materials and synthesize them into drugs in a matter of hours. What’s more, the products would not be one size fits all but a drug dose calibrated to each person’s needs based on factors like age, body weight and genetic variations that affect how one metabolizes and clears the drug as well as takes into account potential interactions with other medicines.

Now a team of chemical engineers at Massachusetts Institute of Technology has worked out production methods in one continuously flowing process from start to finish rather than the stops and starts of producing chemical components in batches, often at differrent locations. They hacked off the shelf equipment and developed new pumps, motors, heating elements and ultrasound to move particles around, creating a drug-producing process that is not only faster but also more precise, more efficient and cheaper than production methods now in use. Their work is detailed in this week’s Science.

 View of system from the synthesis side. This material relates to a paper that appeared in the April 1, 2016, issue of Science, published by AAAS. The paper, by A. Adamo at Massachusetts Institute of Technology in Cambridge, MA, and colleagues was titled, ‘On-demand continuous-flow production of pharmaceuticals in a compact, reconfigurable system.’
Credit: MIT

The current version is a modular system where various elements of raw materials and sets of specialized reactors and processors can be plugged in to different sections of the assembly. “This theme of reconfigurable unit operations is a real landmark,” says Tyler McQuade, program manager with the Defense Advanced Research Projects Agency (DARPA), the Pentagon’s chief sponsor of technological wizardry and innovation, which funded the development. Similarly, John Lewin, a pharmacist at Johns Hopkins University and a consultant to DARPA who was not involved with the study but reviewed the work calls it simply, “A paradigm shift in the way pharmaceuticals are made.”

Even at this early stage of development the synthesizer is able to produce four very different classes of drugs: generic versions of the antihistamine Benadryl, antianxiety drug Valium, antidepressant Prozac and lidocaine, a local anesthetic. At this point, the system is more than a proof-of-concept demonstration but not quite a prototype that is ready to go into production; there is still some tinkering to be done to expand its capacity to crank out different classes of drugs and wring out more efficiencies in the processes. “In many cases there was no precedent for doing the chemistry in a continuous system, we had to develop new chemistry to accomplish that,” says Timothy Jamison, one of the senior scientists on the M.I.T. project. They devised ways for more rapid and efficient heat transfer, a critical aspect of chemical reactions, “so you have much more precise temperature control in a reaction” than with traditional processes.

The researchers were able to draw on their experiences with fluid dynamics and microreactors on biochips, but those systems often operate on a nanoscale and the volume needed to produce drugs is several orders of magnitude greater. They found that sometimes the same processes worked on the larger scale, sometimes they did not and the scientists had to make adaptations to the hardware or processes. It was a starting point but there often was not a direct one for one translation between the two scales. This difference in scale could result in a different series of dynamics in the chemical reactions, explains his M.I.T. colleague, materials scientist Klavs Jensen.

The current iteration of the synthesizer produces drugs in a liquid suspension, but they hope within a year to have a version tied to a 3-D printer up and running so that it can also produce a pill form of the drugs, says Allan Myerson, a chemical engineer and the third member of the M.I.T. research leadership. Pills are often a preferred form for pharmaceuticals because they are more stable and have a longer shelf life. Those factors, however, might not matter with the capacity to produce drugs on demand.

The original vision that launched this enterprise, back in 2006, was something closer to Dr. McCoy’s tricorder on Star Trek, only instead of curing with light and sound effects, the handheld device would spit out a medicine that a medic could give to a soldier in the field, McQuade says. He does not expect to see that small a device soon but he does anticipate that it will not be too many years before the first commercial drug synthesizers are installed in hospitals and other large institutions that use pharmaceuticals.

One reason to install the device is to assure the continued availability of generic drugs at an affordable price. Some workhorse oncology drugs are now in short supply because manufacturers have decided they can make more money with other products or that it isn’t worthwhile for them to make required upgrades to their facilities. Then there is price gouging as practiced by the likes of “pharma bro” Martin Shkreli who purchased rights to produce the generic drug Daraprim. The compound is used to treat the rare parasite infection Toxoplasma gondii, which endangers patients with compromised immune systems. Shkreli promptly increased the price of a single pill from $13.50 to $750, simply because he could. The ability to produce drugs on site might counter such behavior.

Lewin believes the synthesizer will find early use in the drug development process as an effective way to produce intermediate quantities of drugs for clinical trials necessary to gain U.S. Food and Drug Administration approval. Myerson says traditional pharmaceutical companies will likely increasingly adapt continuous flow methods into segments of their batched processes and even for the entire production of certain drugs. But, “you have to remember,” he adds, “right now it takes six to nine months to make drugs” then stock inventory and fill a supply chain. Drugs have to be properly stored and can expire before they are used. He says, “A tremendous amount of money [is] tied up in there,” so industry has an incentive to reduce those costs by shifting to continuous manufacturing.

A future iteration of the synthesizer might also integrate a patient’s electronic medical records, noting factors that might affect drug metabolism and adjusting the dose to achieve an optimal effect. Your doctor would simply send the order to your pharmacy and you would pick up a personalized prescription. Rainer Martin, a medical chemist with the pharmaceutical company Roche in Switzerland who wrote an accompanying article in Science, compares the process with ink cartridges in a printer and the capsules used in a Nespresso coffee machine. He says it “really opens up new avenues, new opportunities for personalized medicine.”