Researchers from Johns Hopkins University have been working on a new solution for sepsis, a complication of infection that affects more than a million people in the U.S. each year and kills between 20 and 40% of them.

But this tool for treating sepsis isn’t strictly a medical intervention — it’s a computer code.

The Hopkins team has developed a model that, thus far, has been very accurate in predicting patients at high risk of sepsis so that they can be treated before the damage becomes severe.

That’s been an elusive goal up until this time. Sepsis consists of chemicals released into the bloodstream to fight infection, leading to whole-body inflammation and preventing blood and oxygen flow; that, in turn, causes organs to fail. It’s an incredibly difficult condition to predict, diagnose, and treat.

The team was able to use various factors routinely recorded in patients’ electronic health records, such as blood pressure and heart rate, to calculate what they dubbed a “targeted real-time early warning score,” or TREWScore. When compared against six years’ worth of data from Boston’s Beth Israel Deaconess Medical Center, this TREWScore was able to predict sepsis 85% of the time. In two-thirds of those cases, the TREWScore was able to detect sepsis before the patient was damaged by it.

In a real-world scenario, that could mean a notice of potential sepsis being delivered a full 24 hours before health professionals would normally be able to identify it. That could save numerous lives. According to Peter J. Pronovost, one of the leaders of the team and senior vice president for patient safety and quality at Johns Hopkins Medicine, each hour that sepsis goes untreated increases a patient’s risk of death by around 8%.

The code will be tested in a pilot initiative at Howard County General Hospital (starting sometime in the next year); if effective, it could rapidly be deployed to any medical facility with EHRs. And since the federal government has been using its power of Medicare and Medicaid reimbursement to urge healthcare providers to start adopting electronic record systems, that’s a fair share of American hospitals and clinics. As of 2013 (the most recent year for which this kind of data is available), 69% of physicians reported that they were already participating or intended to participate in Medicare or Medicaid EHR Incentive Programs, meaning they would have to have EHR systems meeting certain criteria.

The Hopkins project is one of many taking advantage of the massive data sets afforded by EHRs with the goal of improving health or health policies. Another model presented this month at a conference in Sydney, for example, gleans data from patient records in order to predict overall risk of mortality and set off a warning alerting clinicians of a patient’s risk.

The Hopkins model is detailed in “A targeted real-time early warning score (TREWScore) for septic shock,” published this month in the journal Science Translational Medicine.