Identification of patients with a diagnosis of delirium and their matched controls
We identified 7,492 patients with an inpatient delirium diagnosis and 7,492 propensity-score (PS)-matched control patients within the University of California, San Francisco (UCSF) de-identified electronic health record (EHR) database (~ 5 million patients total). Propensity score matching was used to create a matched case-control study as individual covariates may not be well-matched but the “propensity” to be either a case or control is well-matched, as illustrated in prior publications justifying this method 20, 21. Control patients were matched on the following demographic and inpatient visit features: age at admission, patient-identified race, sex, death during admission, length of the inpatient visit of interest in days, years of available EHR data, total number of inpatient visits prior to the visit of interest, total number of comorbidities prior to the visit of interest, and whether the visit of interest was in the ICU setting. The “visit of interest” corresponded to the visit where an inpatient delirium diagnosis was made for the delirium group or a randomly selected inpatient visit for the control group (Fig. 1). Similarly, a separate cohort of 19,417 patients with an inpatient delirium diagnosis and 19,417 PS-matched control cohort were identified from the UC-Wide EHR database (~ 8.6 million patients total, data from UC Davis, UC Los Angeles, UC Irvine, UC San Diego) with an additional matching criterion that included UC location (Fig. 1). These covariates were chosen based on prior EHR-based studies using PS-matched cohort selections with inclusion of additional covariates to control for health status and healthcare utilization frequency using indirect measures such as the total number of inpatient visits and comorbidities prior to the visit of interest and years of available EHR data 17, 22–24. Because patients who develop delirium tend to be at baseline more ill than those who do not develop delirium, we wanted to find a comparable control group that had similar baseline disease burden and identify what specific comorbidities are differentially enriched between patients who are similarly "ill", but one group develops delirium and the other group does not.
Table 1.Demographic information of matched cohorts. Table of demographic information for patient cohorts identified in UCSF (left) and UC-wide (right) data. Chi-squared test used for categorical measures. Student’s t-test used for continuous measures. SMD = standardized mean difference.
Post-matching analysis showed adequate matching of covariates with similar PS distributions between the groups (Extended Data Fig. 1a,c) and absolute standardized mean differences less than 0.1, except for inpatient stay length which had a wide distribution in both databases (Extended Data Fig. 1b,d). Detailed demographic and inpatient visit features for the cohorts generated are shown in Table 1. We defined inpatient delirium broadly using the Observational Medical Outcomes Partnership (OMOP) concept ID 373995 (corresponding to “Delirium”) and excluded diagnoses that had specific causes of delirium in the diagnosis name (such as alcohol-induced delirium or other substance-induced delirium). These exclusion criteria were used to focus on cases where a delirium diagnosis was made but the cause of the delirium was not readily known. Using this definition, we were able to capture 84% and 89% of all delirium-related visits in the UCSF and UC-wide databases, respectively, with delirium prevalence within the wide range of published estimates for patients 65 years and older (9.5% mean, 8.9% SD in UCSF data; 3.5% mean, 1.9% SD in UC-wide data) (Extended Data Fig. 2a,b).
We used the Richmond Agitation Sedation Scale (RASS) rating to corroborate the delirium diagnosis in the UC-wide data. RASS is a 10-point rating scale ranging from − 5 to 5, with negative numbers corresponding to the level of sedation and positive numbers corresponding to the level of agitation. Though RASS is a more general measure of a patient’s level of sedation, validated mostly in the ICU setting, it has also been implemented more widely in the inpatient setting for detection of delirium 25, 26. Less than half of patients had documented RASS ratings during their visit of interest. Of the available ratings, patients with delirium had a statistically significant increase in the mean RASS rating compared to controls (Extended Data Fig. 2c), suggesting patients with a delirium diagnosis are overall more agitated during the visit and also have greater variability in their RASS ratings (data not shown), suggesting a waxing and waning nature to their clinical status.
Patients with delirium are more likely to be diagnosed with diseases of the nervous system, mental health, metabolic disorders, and infections compared to control patients
To understand potential risk factors associated with an inpatient delirium diagnosis, we first collected all first-time diagnoses made during visits prior to the inpatient admission of interest. Low-dimensional Uniform Manifold Approximation and Projection (UMAP) representation of all non-delirium diagnoses (19,590 features, SNOMED concept IDs) shows a statistically significant separation of patients with a delirium diagnosis versus matched controls by two-sided Mann-Whitney U test (UMAP 1, p-value < 2.2 e-16; UMAP 2 p-value 0.0086; Fig. 2a).
Differential association analyses of these comorbidities using Fisher’s exact test showed enrichment of distinct comorbidities for patients with delirium compared to control patients, with 101 diagnoses significantly enriched in patients with delirium versus 108 in controls, out of 19,583 diagnoses tested (Fig. 2b). Control patients had enrichment of diagnoses largely related to pregnancy and other health statuses as well as age-related musculoskeletal diagnoses such as pain in joints and osteoarthritis and skin findings such as melanocytic nevus (Fig. 2b,c, and Supplementary Table 1). Meanwhile, patients with delirium had enrichment of diagnoses related to diseases of the nervous system, including epilepsy and seizures, mental health and behavioral disorders, and acute diagnoses such as metabolic diseases and infections (Fig. 2b,c, and Supplementary Table 1). Similar diagnostic associations were seen in the UC-wide cohort based on a hypergeometric test (p-value 1.2 e-94; Fig. 2d-f, Extended Data Fig. 3, Supplementary Table 2, and Supplementary Table 3). Categorizations of these overlapping diagnoses between the two databases by ICD10 diagnostic blocks showed enrichment of diagnoses related to certain disease categories in patients with delirium versus control patients, including blood-related diseases such as anemia, diseases of the genitourinary system such as urinary tract infections, diseases of the nervous system such as epilepsy, metabolic diseases such as hyponatremia, and mental health-related disorders such as bipolar disorder (Extended Data Fig. 3d and Supplementary Table 3). These findings are largely consistent with previously-identified risk factors for delirium 2.
Differential laboratory findings corroborate differential associations between comorbidities and delirium
We also conducted enrichment analysis for mean laboratory values and vital signs collected before the inpatient admission of interest. Patients with a delirium diagnosis had significantly higher mean values of certain liver function tests, such as alkaline phosphatase and aspartate transferase, compared to controls in both UCSF and UC-wide datasets, suggesting potential liver dysfunction in these patients (Fig. 3a). Elevated mean vital signs included heart rate and respiratory rate (Fig. 3a). Meanwhile, glomerular filtration rate and urine creatinine levels were decreased in patients with delirium compared to controls, consistent with kidney dysfunction (Fig. 3a). Hemoglobin, hematocrit, and erythrocyte counts were also significantly decreased in patients with delirium compared to controls, consistent with the association with an anemia diagnosis in these patients (Fig. 3). The UC-wide dataset also captured certain clinical test scores, including results from the Patient Health Questionnaire (PHQ)-2 and PHQ-9, consistent with the associations with depression in these patients (Supplementary Table 4).
Sex-stratified analysis shows certain infections and dementia subtypes are sex-specific risk factors for delirium
To understand whether any of the comorbidities associated with delirium that we identified are sex-specific, we conducted a sex-stratified association analysis using the same cohort identified above (Extended Data Fig. 4 and Extended Data Fig. 5). We identified several diagnoses that were significantly associated with delirium in only females, only males, or in both female and male patients with delirium compared to controls in both UCSF and UC-wide datasets (Extended Data Fig. 4c-e and Extended Data Fig. 5c-e) as well as sex-specific laboratory results (Extended Data Fig. 4f and Extended Data Fig. 5f).
Diagnoses common to both male and female patients with delirium in both datasets were largely similar to the non-stratified analysis, including symptoms of delirium such as altered mental status, restlessness and agitation, and hallucinations, as well as known organic causes of delirium and altered mental status such as seizures, cognitive disorders and other mental disorders (Fig. 4c). Interestingly, female and male patients diagnosed with delirium had sex-specific associations with distinct infections and diseases of the nervous system that were statistically significant in both datasets. For instance, female patients with delirium had associations with encapsulated bacterial infections due to Streptococcal bacteria (OR UCSF 2.38; UC-wide 1.61), Klebsiella pneumoniae (OR UCSF 2.95, UC-wide 2.14), Escherichia coli (OR UCSF 1.45, UC-wide 1.81), and enterococcal bacteria (OR UCSF 1.53, UC-wide 1.79), while males had associations with Clostridioides difficile infections (OR UCSF 3.89, UC-wide 1.55) (Fig. 4a,b). Sex-specific associations with subtypes of dementia were also seen, where females had significant associations with Alzheimer’s disease (OR UCSF 2.06, UC-wide 3.55) and vascular dementias with behavioral disturbances (OR UCSF 1.89, UC-wide 3.29) while males had associations with Diffuse Lewy Body disease (OR UCSF 1.51, UC-wide 4.22) and diagnoses related to symptoms of the disease such as visual hallucinations, falls, difficulty walking / muscle weakness, dysphagia, insomnia, and constipation (Fig. 4a,b, Supplementary Table 5, and Supplementary Table 6). These sex-specific associations could be because these dementia subtypes are known to have sex-differences in their prevalence already 14 or could point to sex-specific ways in which delirium manifest in different patient populations.
Though there were several sex-specific laboratory results found in the UCSF and UC-wide datasets, none were common between the two datasets. Laboratory findings associated with delirium in both male and female patients as well as between both datasets were similar to the results of the non-sex-stratified analysis, including decreased hemoglobin and hematocrit consistent with an anemia diagnosis, decreased GFR consistent with kidney dysfunction, elevated liver function tests such as alkaline phosphatase, and elevation of heart rate (Fig. 3a, Extended Data Fig. 4f, and Extended Data Fig. 5f).
Longitudinal analysis from diagnosis of a potential risk factor of delirium to an inpatient delirium diagnosis validates comorbidity association study
To further understand several of the comorbidities associated with an inpatient delirium diagnosis identified above, we carried out a longitudinal time-to-event analysis for anemia and bipolar disorder. We chose these diagnoses for analysis given the higher association of blood-related disorders and mental and behavioral disorders in patients with delirium found through our association study (Fig. 2d). Patients with a first-time diagnosis of anemia and no prior diagnosis of delirium and a matched control group with no diagnosis of anemia and no prior diagnosis of delirium were identified. Control patients were matched on the following parameters: age at the visit of interest, patient-identified race, documented sex, years of available EHR data, total number of inpatient visits prior to the visit of interest, and total number of comorbidities prior to the visit of interest (Extended Data Fig. 6). Events were defined as admission for delirium, death, or loss to follow-up. Kaplan-Meier curve visualization of the data showed stratification by anemia diagnosis status, where those with anemia have increased probability of developing first-time inpatient delirium diagnosis (UCSF 3.4%, UC-wide 1.3% of anemia patients) than those without any anemia diagnosis (UCSF 0.3%, UC-wide 0.3% of control patients) over the course of ~ 30 years in the UCSF data and ~ 11 years in the UC-wide data (Fig. 5a and Extended Data Fig. 7a). Cox proportional hazard ratio analysis unadjusted and adjusted for demographics and visit features revealed a significant increased risk of delirium in those with an anemia diagnosis compared to controls (UCSF HR 9.4; 95% CI, 8.1 to 11; UC-wide HR 4.4; 95% CI, 4.1 to 4.7) (Fig. 5b). A similar analysis was done for patients with and without Bipolar I Disorder (BD1) in UCSF patients or bipolar disorder (unspecified type) in UC-wide patients. We found that a diagnosis of BD also increased risk of developing first-time inpatient delirium diagnosis (UCSF 1.9%, UC-wide 0.7% of BD patients) than those without a BD diagnosis (UCSF 0.01%, UC-wide 0.01% of control patients) with a HR of 27 (95% CI, 9.9 to 74.4) for UCSF patients and HR of 7.8 (95% CI, 6.0 to 10.0) for UC-wide patients over the course of ~ 20 years in the UCSF data and ~ 10 years in the UC-wide data (Fig. 5c,d, and Extended Data Fig. 7b).
Our association studies also found that certain diagnoses are more enriched in control patients compared to patients with delirium, including diagnoses under the ICD10-CM neoplasm category such as melanocytic nevus (Fig. 2d and Supplementary Table 3). We did a similar time-to-event analysis of patients with and without this diagnosis and found that, indeed, a prior diagnosis of melanocytic nevus modestly decreased the risk of developing delirium at a HR of 0.3 (95% CI, 0.2 to 0.5) for UCSF patients and HR of 0.76 (95% CI, 0.67 to 0.86) for UC-wide patients (Fig. 5e,f, and Extended Data Fig. 7c).
A single inpatient delirium admission is associated with increased mortality
Previous meta-analyses have documented increased risk of mortality after an inpatient delirium admission 3. To validate these findings in a larger population size while also accounting for more covariates than previously tested, including health status, we used our cohort of patients with delirium and their matched controls to conduct a longitudinal time-to-event analysis, where an event was defined as mortality or loss to follow-up. Kaplan-Meier survival curve visualization of the data showed different probabilities of survival rates between patients with an inpatient delirium admission (median 8.47 years; 95% CI, 7.8 to 9.35 in delirium group) versus control patients (Fig. 6a). Cox proportional hazard ratio analysis unadjusted and adjusted for demographic characteristics (sex, age at admission, race, length of time in EHR, number of inpatient visits prior, total number of comorbidities) and visit features (type of visit, visit length, and length of follow-up time in EHR) revealed a significant increased risk of delirium in those with a delirium diagnosis compared to controls (HR 1.2; 95% CI, 1.16 to 1.29) (Fig. 6b). A similar analysis for the UC-wide patient cohort also showed increased mortality in those with a delirium diagnosis compared to controls with a HR of 1.14 (95% CI, 1.1 to 1.18) (median 8.96 years; 95% CI, 8.16 to 10.1 in control group; median 3.83 years; 95% CI, 3.71 to 4.1 in delirium group) (Fig. 6c,d).