San Francisco-based medical records startup Practice Fusion allegedly developed software for pharmaceutical companies to help increase the number of prescriptions doctors wrote for pain medications, according to a settlement with the US Department of Justice, Bloomberg reports. The company, which supplied its software to tens of thousands of doctors offices nationwide, admitted doing so as part of a $145 million federal settlement this week to resolve civil and criminal penalties, including $113 million to be paid to the federal government and more than $5 million to states.

Here’s how the software worked: When a health care provider accessed a patient’s electronic health records (EHR) on Fusion’s software, a pop-up window would appear with a question about a patient’s pain level. A drop-down menu then provided a list of treatment options, including a possible prescription for an opioid painkiller. The DOJ alleges that Practice Fusion took kickbacks from the drug companies — which are not named in the settlement — and let the drugmakers help draft the language in the so-called “clinical decision support” (CDS) alerts.

“Between 2014 and 2019, health care providers using Practice Fusion’s EHR software wrote numerous prescriptions after receiving CDS alerts that pharmaceutical companies participated in designing,” the Justice Department’s announcement states. More than 230 million CDS alerts occurred between 2014 and 2019, according to Bloomberg.

“Practice Fusion’s conduct is abhorrent. During the height of the opioid crisis, the company took a million-dollar kickback to allow an opioid company to inject itself in the sacred doctor-patient relationship so that it could peddle even more of its highly addictive and dangerous opioids,” Christina E. Nolan, a US attorney for the District of Vermont, said in a statement. “The companies illegally conspired to allow the drug company to have its thumb on the scale at precisely the moment a doctor was making incredibly intimate, personal, and important decisions about a patient’s medical care, including the need for pain medication and prescription amounts.”

Founded in 2005, Practice Fusion’s funding has included some $150 million from prominent venture firms like Kleiner Perkins, Artis Ventures, and Founders Fund, according to TechCrunch. It initially offered the records software to physicians’ offices for free, in exchange for showing the user-targeted pharmaceutical ads. Practice Fusion was acquired by competing electronic medical records company AllScripts for $100 million in 2018, in a deal that left some longtime employees with worthless stock options, CNBC reported.