Introduction

Gastrointestinal bleeding (GIB) presents as a common medical emergency stemming from various causes, including peptic ulcers, esophageal varices, Mallory-Weiss tears, and malignancies, bearing significant mortality and morbidity1. Timely detection and efficient management are imperative to improve patient mortality. Nevertheless, forecasting mortality for GIB patients remains daunting. Conventional prognostic factors like age, comorbidities, and bleeding severity may not reliably predict patient mortality prognosis2. Therefore, pinpointing precise mortality prognosticators for acute GIB patients assumes paramount importance.

Although GIB is typically treatable, it imposes a significant economic burden on society and has profound adverse effects on patients. These include vomiting, hemodynamic instability, and gastric discomfort, all of which can impede disease recovery. Besides, in critically ill patients, clinically significant GIB has been associated with a seven-fold increase in the risk of mortality3. A recent study has developed a distinctive nomogram model to forecast the 30-day all-cause mortality in sepsis patients complicated with GIB4. Another study based on the Medical Information Mart for Intensive Care IV (MIMIC-IV) database found a positive correlation between the anion gap (AG) and the overall mortality rate during intensive care unit (ICU) hospitalization in COPD patients5. After adjusting for other confounding variables, each unit increase in the AG was associated with a 6% increase in the overall mortality rate during ICU hospitalization in COPD patients.

The prognostic significance of AG as a predictor of outcomes in acute GIB has gathered increased attention in recent years. AG represents the disparity between unmeasured cations and anions in the bloodstream, encompassing organic acids, phosphate, serum albumin, and sulfate6. AG is a commonly used indicator in clinical biochemical tests, and changes in the AG reflect alterations in the body’s acid-base balance, which holds significant clinical significance.

Recent studies have shown that elevated levels of AG are associated with increased mortality rates in ICU patients. In terms of cardiovascular diseases, this includes aortic aneurysm and cardiogenic shock7,8. In urological diseases, it includes acute kidney injury (AKI) requiring continuous renal replacement therapy (CRRT)9. In gastrointestinal diseases, it contains acute pancreatitis10. Additionally, elevated levels of AG have also been found to be associated with increased mortality rates in patients with hip fractures, sepsis, and other diseases11,12.

AG, as a readily available biochemical marker, may hold promising potential for clinical application in the prognostic assessment of patients with GIB. However, limited research has investigated the correlation between AG and all-cause mortality among critically ill patients with GIB. Thus, our objective was to undertake an extensive retrospective cohort investigation utilizing the MIMIC IV database to explore the link between AG and ICU all-cause mortality and 90-day all-cause mortality among critically ill patients with GIB within this cohort.

Methods

Data source and study population

MIMIC IV database is a large database containing information on over 50,000 patients who were hospitalized in the ICU of Beth Israel Deaconess Medical Center in Boston, MA, from 2008 to 201913. This database is freely accessible and open to researchers who wish to use it for medical research purposes. It is important to note that the use of this database was approved by the Massachusetts Institute of Technology (MIT) and Beth Israel Deaconess Medical Center (BIDMC). One author (Jianwei Liu) completed the Collaborative Institutional Training Initiative (CITI) examination, received authorization to enter the MIMIC IV database, and obtained certification (ID: 13416183). The entire study was performed in accordance with the relevant guidelines and regulations.

We recruited participants aged 18 years or older admitted to the ICU and all the ICU consecutive adult patients who had a diagnosis of GIB using International Classification of Diseases (ICD)−9 and ICD-10 codes in the MIMIC IV database were selected in the present study. We excluded patients who lacked AG data on the first day of admission (n = 31). Detailed criteria for that row are shown in Fig. 1.

Fig. 1
figure 1

Flowchart of the study.

The study enrolled a cohort of 2,333 patients who were categorized into 4 groups based on the quartiles of AG on the first day of ICU admission: Q1 (< 12 mmol/L), Q2 (12–14 mmol/L), Q3 (14–16.5 mmol/L), Q4 (> 16.5 mmol/L).

Data collection

We extracted demographic parameters (age, gender), vital signs, laboratory tests, comorbidity diseases, mortality, the length of hospital and ICU stay, and scoring systems from the first 24 h after patient ICU admission. Vital signs include weight, systolic blood pressure (SBP), diastolic blood pressure (DBP), and mean blood pressure (MBP). The following laboratory parameters were also extracted: the anion gap (AG), white blood cell (WBC), red blood cell (RBC), red blood cell distribution width (RDW), partial thromboplastin time (PTT), platelets, hematocrit, sodium, potassium, calcium, glucose, creatinine, blood urea nitrogen (BUN), and phosphate. The comorbidities included heart failure, chronic kidney disease (CKD), hypertension, diabetes, stroke, and chronic obstructive pulmonary disease (COPD). Therapeutic measures include: mechanical ventilation (MV), enteral nutrition, blood transfusion, vasopressor, proton pump inhibitor, and anticoagulant. We also calculated sequential organ failure assessment (SOFA), acute physiology score III (APS III), simplified acute physiology (SAPS II), oxford acute severity of illness score (OASIS), and systemic inflammatory response syndrome (SIRS) for each patient.

We removed variables with missing values above 20%, and for variables with missing values below 20%, we applied missforest for interpolation.

Expose variable and clinical outcome

The exposure variable in this study was AG, calculated as \(\:\text{A}\text{G}\:=\:({\text{N}\text{a}}^{+}+\:{\text{K}}^{+})\:-\:({\text{C}\text{l}}^{-}\:+\:{\text{H}\text{C}\text{O}}_{3}^{-})\). The endpoint of our study was all-cause mortality in ICU and 90-day.

Statistical analysis

Patients were classified into four groups based on the quartile distribution of serum AG. Continuous variables were expressed as mean ± standard deviation (SD), while categorical variables were presented as numbers (percentage). The two-sample t-test was used for inter-group comparisons of continuous variables, while the chi-squared test was used for categorical variables.

We performed survival analysis using standardized Kaplan-Meier curves. Then, COX regression analysis models were used to determine the hazard ratios (HRs) and 95% confidence intervals (CIs) for the association between serum AG levels/quartiles and the risk of mortality with GIB. The lowest quartile of serum AG was used as the reference group. Model 1 adjusted for none. Model 2 adjusted for age, gender, weight, hypertension, diabetes, and heart failure. Model 3 adjusted for age, gender, weight, WBC, RBC, platelet, RDW, calcium, glucose, PTT, urea nitrogen, creatinine, phosphate, hypertension, diabetes, heart failure, CKD, COPD, MV, SOFA, OASIS, APS III, SBP, DBP, anticoagulant, blood transfusion, vasopressor drug, and enteral nutrition. The association between AG and mortality was then examined by restricted cubic spline (RCS) models, which were used to explore the non-linear relationship between AG and mortality in GIB patients. Finally, we conducted a subgroup analysis, including age, gender, BMI, diabetes, heart failure, hypertension, and CKD.

R version 4.3.2 (R Foundation for Statistical Computing, Vienna, Austria) was used for all statistical analysis. Statistical significance was defined as a two-sided P-value < 0.05.

Ethics declarations

MIT and BIDMC approved the MIMIC-IV database, and consent was obtained for original data collection, waiving the need for ethical approval and informed consent for this study.

Results

Baseline characteristics

In our study, a total of 2,333 patients were included in the final analysis (Fig. 1), with 61.38% male and 38.62% female with a median age of 67.4 years. Among the included patients, the all-cause mortality during ICU hospitalization was 9.17%. Table 1 presents the baseline characteristics of all participants. Specifically, participants with the highest AG tended to have higher WBC, RBC, RDW, calcium, glucose, PTT, urea nitrogen, creatinine, and phosphate; lower sodium; higher scores in SOFA, APS III, SAPS II, OASIS, SIRS; a lower prevalence of hypertension; a higher prevalence of diabetes, heart failure, CKD, MV, anticoagulant, blood transfusion, and vasopressor drug compared to the lower group (P < 0.05). As the AG increased, the length of hospital stays and length of ICU stays increased gradually.

Table 1 Characteristics and outcomes of participants categorized by AG quartiles. Continuous variables were expressed as mean ± standard deviation (SD) and were compared between groups using the two-sample t-test. Categorical variables were presented as numbers (percentages) and were compared between groups using the chi-squared test.

Baseline characteristics grouped according to 90 days survivors and non-survivors are shown in Table 2. Patients with survivor tended to have lower age, WBC, RDW, potassium, glucose, PTT, urea nitrogen, and creatinine; higher RBC, platelet, sodium, and phosphate; lower scores in SOFA, APS III, SAPS II, OASIS; a lower prevalence of diabetes, heart failure, CKD, COPD, MV, enteral nutrition; a higher prevalence of hypertension, blood transfusion, and vasopressor drug compared to the non-survivor group (P < 0.05).

Table 2 Baseline characteristics of the 90-day survivors and Non-survivors groups. Continuous variables were expressed as mean ± standard deviation (SD) and were compared between groups using the two-sample t-test. Categorical variables were presented as numbers (percentages) and were compared between groups using the chi-squared test.

The relationship between AG and ICU and 90-day all-cause mortality

Kaplan-Meier survival analysis curves plotted according to quartiles of anion gap levels show survival probabilities for the different groups (Fig. 2). Higher AG was significantly associated with increased all-cause mortality in the ICU, as evidenced by a significantly lower probability of survival in critically ill GIB patients in the highest quartile of AG compared to those in the lowest quartile (log-rank P < 0.001). Similar results were observed in the 90-day all-cause mortality study (log-rank P < 0.001).

Fig. 2
figure 2

Kaplan-Meier survival analysis curves for mortality according to groups at ICU (A), and 90-day (B).

In Table 3, the association between AG and ICU all-cause mortality was calculated in multivariate COX regression analysis. In the unadjusted model 1, the association between AG and ICU all-cause mortality was positive (HR = 1.12, 95% CI: 1.09–1.16, P-value < 0.001). In the fully adjusted model (model 3), the association between AG and ICU all-cause mortality remained positive (HR = 1.07, 95% CI: 1.03–1.12, P-value < 0.001). After grouping critically ill patients with GIB by AG quartile, a significantly increased risk of mortality was found in the highest quartile (Q4) after adjusting for all potential confounders, with an HR of 2.00 (95% CI: 1.16–3.43, P-value = 0.012).

Table 3 Association between AG and ICU all-cause mortality of critically ill patients with GIB. Model 1: no adjustment. Model 2: adjusted for age, gender, weight, hypertension, diabetes, and heart failure. Model3: adjusted for age, gender, weight, WBC, RBC, platelet, RDW, calcium, glucose, PTT, Urea nitrogen, creatinine, phosphate, hypertension, diabetes, heart failure, CKD, COPD, MV, SOFA, OASIS, APS III, SBP, DBP, anticoagulant, blood transfusion, vasopressor drug, and enteral nutrition.

Similarly in Table 4, the association between AG and 90-day all-cause mortality was positive (HR = 1.06, 95%CI: 1.04–1.09, P-value < 0.001). Critically ill patients with GIB in the highest quartile (Q4) had a 74% increased risk of all-cause mortality compared with patients in the lowest quartile (HR = 1.74, 95%CI: 1.31–2.31, P-value < 0.001).

Table 4 Association between AG and 90-day all-cause mortality of critically ill patients with GIB. Model 1: no adjustment. Model 2: adjusted for age, gender, weight, hypertension, diabetes, and heart failure. Model3: adjusted for age, gender, weight, WBC, RBC, platelet, RDW, calcium, glucose, PTT, Urea nitrogen, creatinine, phosphate, hypertension, diabetes, heart failure, CKD, COPD, MV, SOFA, OASIS, APS III, SBP, DBP, anticoagulant, blood transfusion, vasopressor drug, and enteral nutrition.

Linear association between AG and all-cause mortality

In Fig. 3, we used the RCS to assess possible non-linear associations between AG and ICU and 90-day all-cause mortality. In the study of the association between AG and ICU all-cause mortality, the association was found to be linear rather than non-linear (P for non-linearity = 0.980). Similarly, we noted that in critically ill patients with GIB, the association between AG and 90-day all-cause mortality was also linear (P for non-linearity = 0.878).

Fig. 3
figure 3

Restricted cubic spline curve for the AG hazard ratio. Heavy central lines represent the estimated adjusted hazard ratios, with shaded ribbons denoting 95% confidence intervals. The horizontal dotted lines represent the hazard ratio of 1.0. (A: ICU mortality; B: 90-day mortality).

Subgroup analysis

To further examine the robustness of the relationship between AG levels and all-cause mortality, we conducted a subgroup analysis based on age, gender, BMI, diabetes, heart failure, hypertension, and CKD, which is shown in the forest plot in Fig. 4. The results indicated that the association between serum AG and all-cause mortality was consistent across patients of different ages, genders, weights, and comorbidities. Furthermore, interaction analysis revealed that weight and heart failure had an impact on the association between AG and ICU and 90-day all-cause mortality in GIB critically ill patients (P for interaction < 0.05).

Fig. 4
figure 4

Forest plot of subgroup analyses. (A: Relationship between AG and ICU mortality in different subgroups; B: Relationship between AG and 90-day mortality in different subgroups).

Discussion

In this retrospective study, we identified a significant positive association between AG and both ICU and 90-day all-cause mortality among GIB critically ill patients in a large-scale cohort study, even after adjusting for confounding factors such as age, gender, BMI, diabetes, heart failure, and hypertension. Furthermore, subgroup analysis further strengthened our results.

Our study’s subgroup analysis revealed that the association between serum AG and mortality persisted and that weight and heart failure had significant interactions with AG in predicting patients with GIB mortality (P for interaction < 0.05, Fig. 4). Heart failure is a serious life-threatening condition worldwide, with an estimated 64.3 million people affected worldwide14. Mortality in HF patients remains high, with an overall five-year mortality of 50%, which is even higher in end-stage HF15. Serum AG is associated with all-cause mortality among critically ill patients with congestive heart failure16,17. Therefore, recognizing an increase in AG levels early is essential to prevent heart failure progression and improve outcomes. However, additional studies are required to investigate the clinical value of AG for heart failure management.

AG serves as a common measurement indicator in assessing acid-base imbalances and analyzing primary metabolic acidosis6. Within the spectrum of metabolic acidosis, high AG metabolic acidosis constitutes a distinct subset, implying that AG could serve as a valuable prognostic indicator for adverse clinical outcomes among ICU patients. GIB may trigger hypoalbuminemia and hyponatremia, consequently leading to fluctuations in AG levels18.

The association between AG and GIB has been a topic of interest in recent literature. Badipatla et al. conducted a retrospective observational study to investigate the predictors of acute GIB in patients with diabetic ketoacidosis (DKA)19. They found that DKA is characterized by elevated blood glucose, the presence of ketones in blood or urine, metabolic acidosis, and AG. This suggests a potential link between anion gap and gastrointestinal bleeding in DKA patients. While some studies have focused on auditing nursing care for patients with upper GIB. Others have evaluated the impact of organizational models, such as the “Hub & Spoke” model, on mortality in acute upper GIB20. According to a recent systematic review and meta-analysis, serum AG has been identified as reliable data for prognostic assessment in critically ill cases, especially in regions with underdeveloped medical resources21. A recent study indicates a significant interest in understanding the risk factors, preventative measures, and outcomes associated with GIB, particularly in critically ill and high-risk patient populations21.

Our study highlights the significant association between AG and mortality in critically ill patients with GIB. While AG is a commonly used marker for acid-base disturbances, it is worth noting that the strong ion gap (SIG) from Stewart’s model offers a more detailed and mechanistic approach to understanding acid-base balance. SIG is derived from Stewart’s model, which considers the strong ion difference (SID) and the contributions of weak acids and volatile acids. SIG is calculated as the difference between the measured SID and the calculated SID, taking into account the contributions of albumin, phosphate, and other unmeasured ions22,23. This approach may offer a more precise assessment of acid-base disturbances, especially in complex clinical settings such as sepsis or multi-organ failure24,25. While our study focused on AG due to its widespread clinical use and availability, future research could explore the comparative utility of AG and SIG in predicting mortality in critically ill patients with GIB. SIG may provide additional insights into the underlying pathophysiology and could potentially enhance prognostic accuracy. However, the complexity of SIG calculations and the need for additional laboratory data (e.g., albumin, phosphate) may limit its widespread clinical application compared to AG.

This study provides evidence that AG is an independent predictor of ICU admission and 90-day mortality in patients with GIB. Nevertheless, we must also recognize its compelling limitations. First, although AG has been extensively studied as an independent variable, albumin- or phosphate-corrected AG is more informative, and future studies should consider it as an exposure variable to explore the relationship between corrected AG and GIB. Second, due to the limitations of retrospective studies, much important information was removed due to excessive missing information (including albumin, PH, PaCO2, lactate, hemoglobin, and whether or not there was concomitant variceal bleeding), as well as a lack of location, volume, or source of gastrointestinal bleeding. Therefore, future prospective studies need to take these important factors into account to further validate our findings.

Conclusions

In conclusion, this is the first study to establish a correlation between the AG and both ICU and 90-day mortality rates within a cohort of individuals with GIB. Our findings indicate that an increased AG acts as an autonomous prognostic indicator for overall mortality in patients with GIB. This relationship remains statistically significant even after accounting for potential confounding factors. Further analyses are advocated to further confirm the association between the AG and ICU and 90-day mortality among critically ill patients with GIB