Data Mining to Stop Sepsis, and for Dad 4


Frozen airmen, 1950’s

An illness call sepsis changed my life, and ended my dad’s.

My dad, Bill Floyd, served in the U.S. Air Force many years before I was born. His military service included long stints in the Arctic and bases all over the country — he was what they now call a Cold War Warrior (literally and figuratively). He suffered lung injuries during his service, causing his pulmonary health to decline rapidly after his early disability retirement from the military. As the youngest of 10 children, I don’t have many memories of him, but remember his time in and out of hospitals. In 1980, his last hospital stay ended with a case of advanced sepsis (septic shock) and his death at age 51. Acute sepsis is the cause of death listed on his death certificate, and my reading of that document years later was the first time I heard of sepsis.

What is sepsis?

Sepsis is a disease characterized by overwhelming infection, and the body’s inflammatory immune response to that infection — it’s warfare on a molecular and cellular scale. First coined in the 1870’s, the word sepsis comes to us from the Greek word ‘sepein’, which means putrefy. In this day of superbugs in hospitals, sepsis — which kills around from 25-40% of the 750,000 affected yearly in the U.S. — is increasing at 9% per year.


Artistic depiction of sepsis

Sepsis and alerts

As a former implementation engineer and data analyst for a surgery-oriented software company, I’ve been in more hospitals, operating rooms, and recovery rooms than I can remember. Recently, at a hospital site, I was reminded again about sepsis when I noticed a Sepsis Alert Dashboard (a Qlikview application that extracted data from the McKesson EMR database) that was available to clinicians and administrators. This dashboard extracts patient vital signs — on a nightly basis — and other data and watches for key signs of sepsis. If a patient’s vitals and labs meet certain sepsis screening guideline criteria, the Sepsis Alert Dashboard sends out emails to the sepsis response team and administrators.

While this is a great idea, many hospitals do not have business intelligence (BI) dashboards that can automatically send email alerts to a quick response team. I set out to find a way to implement the alert in the database itself, so any hospital with an electronic medical record can set up alerts with minimal lines of code. Setting up a sepsis alert system can save lives, time, and money.

How rapid sepsis detection saves lives and money

Sepsis is a huge problem not only in terms of deaths and heartache, but also financially in terms of $17 billion yearly spent to treat sepsis patients. Average costs per patient are about $50,000, because many patients spend time in the ICU and are discharged to nursing homes and rehab centers. Sepsis is one of the biggest causes of death in the U.S. (#10), and causes millions of deaths every year across the globe.

Rapid identification and treatment of septic patients can lead to an average 50% overall length of stay (LOS), and a 66% reduction in LOS for the ICU, as well as a 50% decrease in sepsis-related mortality (Christiana Care Health System study). Christiana Care was catching 85% of sepsis patients in the Emergency Department (ED) and the remaining 15% of sepsis patients were identified during inpatient stay.

The key to beating sepsis is to identify it early. As within an hour of onset, or as close as possible to onset. The Sepsis Alert Dashboard I saw at the hospital I visited is a wonderful tool, but it got me thinking about ways to do the same thing — alerting clinicians when a patient is suspected of sepsis — from the database itself. And that sepsis dashboard is actually quite useless if it’s being updated once a day, overnight. The patient would likely be well on their way to septic shock before anything could be done.  The way to go is a timely, near real-time method that could be modified and adapted to any RDBMS (any database: Oracle, SQL Server, Teradata, and so on).

Clinical signs of sepsis and what to query for

The state of sepsis occurs during a complex battle between the human body and and infection. Clinically, it’s the presence of an infection and a condition known as systemic inflammatory response syndrome (SIRS). SIRS affects the body’s organs from getting enough oxygen, among other things. This oxygen deprivation can shut down organs and cause rapid death during this advanced sepsis, or septic shock.

A patient’s vital signs can be monitored, and these observations can help diagnose sepsis. A patient with SIRS will have at least two of the following:

  • Core temperature below 96.8 degrees F (36 degrees C) or above 100.4 F (38 degrees C)
  • Heart rate greater than 90 bpm
  • Respiratory rate greater than 20 breaths/min or PaCO2 less than 32 mmHg (normal range is 35-45 mmHg)
  • White blood cell count (WBC) less than 4,000 cells/mm3 or greater than 12,000 cells/mm3 (normal range is 4,500-10,500 cells/mm3) or greater than 10% immature neutrophils (normal range, 0% to 3%)

Other documented (non-SIRS) criteria include some of the below (among other things, like organ failure that denotes advanced sepsis):

  • Altered mental status
  • Chills with rigors
  • Sugar 120 mg/dl in absence of diabetes

If any two of the SIRS criteria are present, with an infection, sepsis is suspected and countermeasure treatment can be instituted before organ failure and death.  The risk of death increases 7.6% with every hour that passes for a septic patient. Immediate treatment includes intravenous antibiotics and fluids. Secondary treatments can include corticosteroids, oxygen, vasopressors to increase blood pressure, and kidney dialysis.

The basics of the sepsis query

The basic layout of this sample query architecture is a database job that fires a query at predetermined times (say, every 10 minutes or time interval set by facility standards) that queries as below. Consider a table common to most electronic medical records, OBSERVATIONS, where patient observations are manually recorded or automatically captured (via DataCaptor, iSirona, or other medical device interface). Columns contained in this table are as follows:

obs_type PK, FK2
captured_dt PK
patient_id PK, FK1
module_id PK, FK1
care_event PK, FK1

The table also contains these columns:

captured_value (captured automatically from the devices)
manual_value (manually entered from the nurses)

Here’s a SQL query (ANSI standard, so it should work on most databases) that will query for the components of the SIRS criteria. The query is looking for 2 or more criteria to be satisfied, and will report those patients as SIRS suspects. When one subquery is satisfied, it is assigned a value of 1. If not satisfied, the subquery is assigned a value of 0. The final subquery returns patients where the sum of the assigned values is greater than or equal to 2 (2 or more SIRS criteria satisfied). This query looks at the number of hours set in the time value subquery. In this query, note the following:
  • We’re not looking at the 10% band of neutrophils — just the WBC. You could add that into the query as a substitution using OR.
  • We assume that WBC values are in the OBSERVATIONS table. That may not be the case, but is rectified by a join using patient_id and care_event between a LABS table and the OBSERVATIONS table.
  • I also used temperature in degrees Celsius, which may not be used in certain patient care areas of your hospital (typically I see Celsius in the OR, Fahrenheit in the other areas such as inpatient and PACU areas).
  • I did not use partial pressure of CO2, as that is more uncommon than respiratory rate (which is easily observed and recorded either visually or via ECG leads.
  • Note that for sepsis to be suspected, 2 or more of the SIRS criteria should be present, along with infection. There is no specific query we can do for infection generally (WBC is an indicator, but only one), so that is up to clinical judgement and alternate testing.
Your mileage may vary, and hopefully this will serve as a example that can be expanded upon. Thanks to my friend Anirudh Kala for working on this query with me.

select patient_id, module_id , care_event
(select patient_id , module_id , care_event , sum(case when (obs_type)='Temp' and
(( captured_value > 38 OR captured_value <36) OR  (manual_value > 38 OR manual_value <36))
then 1 else 0 end)as Temp,
sum(case when LTRIM(RTRIM(obs_type))='HR' and (captured_value  >90 OR manual_value >90) then 1 else 0 end)as HR,
sum(case when  LTRIM(RTRIM(obs_type)) ='RR' and (captured_value  >=20 OR manual_value >=20)then 1 else 0 end)as RR,
sum(case when  LTRIM(RTRIM(obs_type))='WBC' and
(( captured_value < 4000 and captured_value >12000) OR  (manual_value < 4000 OR manual_value > 12000))
then 1 else 0 end) as WBC
where to_number(to_char(sysdate,'YYYYMMDDHH24')) - to_number(to_char(captured_date,'YYYYMMDDHH24'))
group by
patient_id , module_id , care_event)
where Temp + HR + RR + WBC >= 2;

From here, one could report using a DBMS_Mail package (Oracle) or something similar in other RDBMS applications. Using SQL Server, one could set up rules within SQL Server Notification Services/StreamInsight. Other database packages can produce SMS messages or even private non-PHI Twitter feeds, but that is sketchy, HIPAA-wise. I will create more posts later about setting up a sepsis reporting tool using other methods: Qlikview, Informatica, and using triggers and jobs in your database. I will also explore using text data mining to search for “altered mental states” and including labs like glucose readings that may be contained in nursing notes. Follow-up lab values that confirm advanced sepsis (such as lactate) aren’t discussed here, but can be placed in the SQL query algorithm.

Note that this method isn’t looking for probabilistic relationships — the probability of a patient having sepsis. No Bayesian theory here, though there is a place for that and you could use a software package like SAS to do it, and I will be working on that as well. The purpose of this query is to alert staff about possible sepsis cases, not to hone probabilities about who really has it. Using SIRS guidelines as the basis of the query is a solid foundation for assisting clinicians in decision support. Developing an all-purpose, mildly hackable algorithm for sepsis that is useful for most clinical environments: that’s what this is all about, and will help identify and heal sepsis patients.

Future posts:

1. Clinical, scheduling, and financial alerts using Qlikview
2. Alerts and data mining using SQL Server Notification Services and the new MS StreamInsight
3. Other methods: Perl sendmail, dbmail
4. Alerts using ETL tools like Informatica

  • Very well written and informative Matt!

  • Paul F.

    good article Matt. The possibilities are huge.

  • I almost died from sepsis after kidney problems. The problems could never be conclusively attributed to weeks in MOP4 chemical gear at high temperatures, but years after I left the Air Force I never felt quite strong again. My condolences for your fathers death. Guess I’ll go call my kids and tell them how much I love them.

  • lizagil4321

    Creative comments . Apropos , if anyone is interested a CIPI: Severe Sepsis Alert , my friend discovered a sample document here


Get every new post delivered to your Inbox

Join other followers: