Introduction

Magnesium is an essential ion for many physiological and biochemical mechanisms necessary for the continuation of life. It is a cofactor of hundreds of enzymes (such as adenylate cyclase and sodium–potassium-adenosine triphosphatase). It also takes place in the rate-limiting step of some enzymatic reactions (such as DNA ligase 1-dependent DNA replication and repair) [1, 2]. Therefore, body magnesium must be in a certain balance.

Magnesium disturbances (especially hypomagnesemia) are electrolyte disorders frequently encountered in hospitalized patients. Deteriorations in magnesium levels can cause morbidity and mortality by causing considerable damage to different body systems. These changes in magnesium levels may manifest themselves more clearly. In addition, changes in magnesium levels are associated with chronic diseases such as cardiovascular diseases, hypertension, chronic kidney failure, DM, osteoporosis, depression, migraine, and cancer.

Hypermagnesemia can be seen in tumor lysis syndrome, renal failure patients with insufficient excretion or excess magnesium intake, sepsis, laxative or antacid intake, lithium therapy, Addison's disease, and hypothyroidism [3]. Depending on hypermagnesemia, neuromuscular findings like paralysis, cardiac arrhythmias that may result in death (such as complete heart block and bradycardia), and deterioration in platelet functions may be observed. The neuromuscular effects of hypermagnesemia are manifested by decreased presynaptic acetylcholine secretion and cardiac effects by disruptions in prostacyclin-mediated pathways. Apart from these, disruption in many different pathways causes the side effects of hypermagnesemia [4, 5]. Some studies show that hypermagnesemia is associated with increased mortality, especially in critically ill patients, and can even be used as a predictor for mortality risk [6,7,8,9,10].

Our study aimed to evaluate the frequency prognosis of magnesium imbalances and the association between hypermagnesemia and clinical course in hospitalized patients.

Materials and methods

Study participants

This retrospective cohort study was conducted at the University of Health Sciences Istanbul Haseki Health Training and Research Hospital. The study protocol was reviewed and approved by the Institutional Ethics Committee at the University of Health Sciences, Haseki Health Training and Research Hospital (Ref No./Date: 16–2022/09.02.2022). The ethics committee anonymized and approved the database information with no need for consent. Three thousand eight hundred fifty patients hospitalized in the Internal Medicine Clinic for any reason between 01.01.2019 and 31.12.2019 were evaluated with their clinical and laboratory data. Data for the study analyses were derived from the electronic hospital management system dispensing records and profile database of the hospital, which include demographic information, medical history, diagnostic blood tests, and diagnosis at admission. Patients under 18, with missing data or recurrent hospitalizations, who were taking medications that affect serum magnesium levels (such as diuretics, laxatives, and antacids), those with excessive alcohol intake, and those taking regular dialysis treatment were excluded. After all, 2130 patients were eligible for the study (Fig. 1).

Fig. 1
figure 1

Flow diagram of participants

Laboratory analysis

Serum biochemical parameters and electrolyte levels were analyzed in the blood samples taken after at least 12 h of fasting and up to 24 h after hospitalization. Comorbidities (hypertension, coronary artery disease (CAD), chronic kidney disease (CKD), diabetes mellitus (DM), solid malignancies, hematological cancers) of the patients were noted. The patients were recorded as being discharged from the hospital, referred to the intensive care unit (ICU), and died. GFR (glomerular filtration rate) values were calculated using the data of patients with CKD, and staging was performed according to these values. Patients with no diagnosis of acute kidney injury and with low GFR were classified as stage 3, 4, and 5 chronic kidney disease. Our study was retrospective; therefore, patients with kidney damage and calculated GFR over 60 mL/min/1.73 m2 (stage 1 and stage 2 CKD) could not be determined clearly. In addition, the length of hospitalization and in-hospital mortality data were recorded. Patients who were discharged from the hospital with no poor clinic status were settled in Group A. Patients who needed ICU follow-up or developed mortality during hospitalization as a worsening clinical course were settled in Group B. Patients were divided into four quartiles according to the magnesium levels measured in the first 24 h after hospitalization. Magnesium quartiles were arranged considering the official laboratory value range of our hospital. The second and third quartile ranges were determined by taking the median magnesium value in patients whose magnesium was within the normal range. The reason for including patients with normal magnesium values is to provide a more accurate comparison between patients with abnormal and normal magnesium values. The quartiles were defined as:

  • 1st quartile (%25): Mg ≤ 1.7 mg/dl,

  • 2nd quartile (%26 -50): 1,7 mg/dl < Mg ≤ 1.9 mg/dl,

  • 3rd quartile (%51 -75): 1.9 mg/dl < Mg ≤ 2.1 mg/dl,

  • 4th quartile (%76–100): Mg > 2.1 mg/dl.

Patients in the first quartile were evaluated as having hypomagnesemia. In contrast, those in the second and third quartiles were considered normomagnesemic, and those in the fourth were considered hypermagnesemic.

Statistics

Statistical analysis was performed using SPSS 26.0 for Windows. Numeric values were expressed as the mean ± standard deviation. Kolmogorov–Smirnov Z test was used to determine the distributions of variables. Regular variances were assessed using a t-test, and irregular variables were evaluated using the Mann–Whitney U test. Comparisons of numerical variables in more than two groups were made using the One-Way ANOVA test if there was a normal distribution or the Kruskal–Wallis test if there was no normal distribution. Subgroup analyses were interpreted according to Bonferroni correction. Categorical variables were evaluated with the chi-square test. In the Cox regression model, which was formed from the variables found to be significantly different in univariant analyses, the effects of age, presence of DM, presence of CAD, presence of solid cancer, presence of CKD and Mg levels on poor prognosis (mortality and ICU admission) were evaluated according to the Backward Stepwise method. A p-value ≤ 0.05 and a 95% confidential interval were considered statistically significant.

Results

A statistically significant difference was found between the ages of the patients who survived (Group A) and those with poor clinical course (Group B). The mean age of group B patients was higher than that of group A patients (p < 0.001). There was no statistically significant difference in terms of gender between the two groups (p > 0.05). In group B patients, urea, creatinine, glomerular filtration rate (GFR), uric acid, procalcitonin, c-reactive protein (CRP), ferritin, lactate dehydrogenase (LDH) values were found to be statistically significantly higher (p < 0.001, p < 0.001, p < 0.001, p < 0.001, p = 0.007, p < 0.001, p < 0.001, p < 0.001, respectively). It was observed that in patients with a poor prognosis, magnesium levels were higher as compared to those with a better prognosis, when all patients were evaluated (p < 0.001). When hypomagnesemia was present, the magnesium levels in patients with poor prognosis were higher, though not statistically significant (p:0.103). On the other hand, in hypermagnesemic patients, magnesium levels were significantly higher in those with poor prognosis (p:0.010). When comorbidities between the patients of the two groups were examined, coronary artery disease, CKD, and solid malignancies were found to be statistically significantly more common in patients with poor prognoses (p: 0.036, p < 0.001, p < 0.001, respectively). There was no statistically significant difference between the two groups in the frequency of DM, hypertension, and hematological cancers (p > 0.05) (Table 1).

Table 1 Factors affecting the clinical course

When all patients were evaluated, 542 had magnesium levels in the first quartile, 571 in the second quartile, 533 in the third quartile, and 484 in the fourth quartile. The incidences of DM, HT, CAD, CKD, and solid cancers in all patients were found to be statistically significantly different when Mg quartiles were compared. A statistically significant difference in the frequency of hematological cancers between Mg quartiles was not found (p > 0.05). There was DM in 284 (52.4%) patients who were found to be hypomagnesemic (1st quartile) and HT in 322 (59.4%) patients. Of the hypermagnesemic (4th quartile) patients, 158 (32.6%) were diagnosed with DM and 236 (48.8%) with HT (p < 0.001, p < 0.001, respectively). In the first quartile, 168 (31.0%) patients had CAD, and 245 (45.3%) had CKD. In the 4th quarter patients, 147 (30.4%) had CAD, and 258 (53.3%) had CKD (p: 0.001, p: 0.003, respectively). While 76 (14.0%) of the patients in the first quartile had solid malignancy, 52 (10.7%) of the patients in the fourth quartile had a diagnosis of solid malignancy (p: 0.043) (Table 2).

Table 2 The association between magnesium quartiles and clinical conditions

Chronic kidney disease patients were categorized based on their GFR levels, and their distribution across different magnesium quartiles was analyzed. In the first quartile, 132 patients were identified with stage 3, 69 with stage 4, and 44 with stage 5 CKD. The number of patients in the second quartile was 91 with stage 3, 31 with stage 4, and 41 with stage 5 CKD. In the third quartile, there were 86 patients with stage 3, 56 with stage 4, and 44 with stage 5 CKD. Finally, in the fourth quartile, 99 patients had stage 3, 85 had stage 4, and 88 had stage 5 CKD. The results indicated a significant difference across the quartiles (p < 0.001).

It was observed that 42 (7%) of 542 patients in the first quartile and 61 (12%) of 484 patients in the fourth quartile had a poor prognosis. The relationship between magnesium quartiles and the prognosis was statistically significant (p: 0.002) (Fig. 2).

Fig. 2
figure 2

Mg quartiles and prognosis

A U-shaped association was observed between magnesium levels and length of hospitalization (LOH). The mean LOH was 9.10 days for patients in the first quartile, 7.89 days for the second quartile, 8.17 days for the third quartile, and 9.24 days for the fourth quartile (p:0.012), (Table 2, and Fig. 3).

Fig. 3
figure 3

Mg quartiles and length of hospitalization

The variables affecting the poor prognosis (age, diabetes mellitus, chronic kidney disease including stages, coronary artery disease, solid malignancies) and comparative magnesium quartiles were examined using the Backward Stepwise Cox regression method to assess their effects on poor prognosis. Age (OR = 1,015, p: 0.002), solid cancers (OR = 2.051, p < 0.001), and presence of hypermagnesemia (Q4) compared to hypomagnesemia (Q1) (OR = 2.074, p: 0.001) were found to be the most influential independent risk factors (Table 3).

Table 3 A backward stepwise cox regression model between poor clinical course and independent variables

Discussion

Our study found that hypomagnesemia was associated with poor prognosis during hospitalization. Considering the etiologies of magnesium disturbances, in many studies, comorbidities of the patients (DM, CAD, HT, CKD) and the relationship of these conditions with magnesium levels were examined. In a study conducted by Pokharel et al. in Nepal between diabetic and non-diabetic patients, there was an inverse correlation between magnesium and Hba1c levels and a positive correlation between hypomagnesemia and decreased GFR in DM patients [11]. The study by D'Erasmo et al. was conducted with 82 malignancy patients (62 were in the terminal stage); hypocalcemia and hypomagnesemia were found more frequently in patients with advanced cancer [12]. In the study conducted by Kieboom et al., 9820 patients were followed for an average of 8.7 years, and the relationship between hypomagnesemia and cardiovascular mortality was examined. The mortality risk in coronary artery patients with low Mg levels was 1.36 times higher than in the patients in the reference group (Mg: 1.94–2.14 mg/dl) [13]. Our study observed that hypomagnesemia was more common in patients with diabetes mellitus, hypertension, coronary artery disease, and solid malignancy. Hypermagnesemia was more common in patients with chronic kidney disease, and as the CKD stage increased, the incidence of hypermagnesemia increased. This situation is thought to be the decrease in magnesium excretion.

While some studies are showing that high magnesium levels may have protective effects on cardiovascular complications and mortality in some patient groups, there are also studies showing that hypermagnesemia is associated with an increase in mortality and complications by causing conditions such as hypotension, cardiac arrhythmias, including bradycardia, neuromuscular disorders and respiratory depression [8, 14]. In a study conducted by Thongprayoon et al. with 39,193 patients hospitalized in a clinic in the USA between 2011–2013, the 1-year mortality was evaluated; both hypomagnesemia and hypermagnesemia (when the optimal value of magnesium is taken as 1.9–2.2 mg/dL) were associated with higher mortality [15]. In a study by Cheungpasitporn et al., in which 65,974 patients were evaluated, the 1-year mortality rate was found to be 19.0% and 25.6%, respectively, in patients with magnesium levels of 2.1–2.2 and ≥ 2.3 mg/dL. Hypermagnesemia was associated with higher mortality than patients with low/normal magnesium levels [16]. Similarly, in our study, hypermagnesemia seems to be an independent risk factor affecting poor prognosis during hospitalization. Also, we found that hypomagnesemia was not among the independent risk factors affecting poor prognosis.

All these results show that taking into account hypermagnesemia in the in-hospital evaluation of patients is very important. Not many studies show a relationship between poor prognosis and magnesium levels in patients who are treated with magnesium and develop hypermagnesemia. Therefore, more studies are needed to establish whether over-treatment with magnesium worsens the condition of patients.

Considering the studies on magnesium disorders, it would be correct to say that hypermagnesemia can be encountered in patients with poor prognoses. Most of these studies were conducted by observing the patient's intensive care unit (ICU) follow-up. Few studies evaluate the in-hospital prognosis of patients hospitalized in clinics other than the ICU. The number of studies assessing the incidence of different magnesium levels with various chronic diseases and considering the prognosis is also limited. Our study is valuable in terms of both the large number of patients and the documentation of the relationship between magnesium levels and different clinical conditions/prognoses.

Conclusions

Magnesium imbalance is prevalent in clinical practice. In the course of chronic diseases, hypomagnesemia and hypermagnesemia may accompany them. Both conditions are electrolyte disturbances that should not be neglected. In our study, hypermagnesemia was statistically significantly associated with poor prognosis. The main point is to detect the magnesium disturbance, reach the causes, and solve them. In addition, excessive magnesium replacement should be avoided in patients with a high risk of developing hypermagnesemia. More studies are needed to evaluate the deterioration in magnesium values regarding etiology, frequency, and mortality.