Introduction

Community-acquired pneumonia (CAP) continues to be a common indication for hospital admission, especially among adults with underlying clinical risk conditions, and because of the increasing number of comorbidities in an ageing population1,2. Different severity indexes have proven their clinical usefulness, as they allow a prompt risk stratification at the emergency room3. Regrettably, these indexes have been reported to have limitations4. Indeed, clinical practice is dynamic and has consequently changed since the publication of these scores. For instance, non-invasive ventilation is now more routinely applied out of the intensive care environment5.

The onset of arrhythmias during hospital admission for CAP is a well-known complication and has been reported to be around 4–9%6,7. Recent research work has raised that number to an astonishing 10% in the case of Streptococcus pneumoniae infection and has additionally shown an association between new-onset atrial fibrillation and in-hospital mortality (IHM)8. Older research had formerly found an association between incident atrial fibrillation and IHM, as well9,10. In the paper by Ruiz et al., an association was also found between atrial fibrillation present at hospital admission that persisted during the hospital stay and IHM8. Nonetheless, previous reports had failed to show an association between chronic atrial fibrillation and IHM in people admitted for CAP7.

Furthermore, sex may influence the outcomes of CAP11. Although cultural, behavioural, and socio-economic differences may be important determinants to explain the effect exerted by gender on the clinical management and outcomes of pneumonia12, a sex gap due to biological differences cannot be ruled out13. The interplay between sex, pneumonia and prevalent or incident atrial fibrillation is therefore complex, and few studies with large population sizes have focused on atrial fibrillation as a specific condition in separate analyses for men and women admitted for pneumonia.

Here we aimed to compare the clinical characteristics and in-hospital outcomes for women and men with CAP needing admission to the hospital during the extended period 2016–2019 in Spain according to the presence of atrial fibrillation prior to hospital admission, and new onset atrial fibrillation during hospital admission. We used propensity score matching (PSM) with the purpose of attenuating baseline differences for the comparisons. We finally sought the variables associated with IHM for patients admitted for CAP with atrial fibrillation prior to hospital admission or new onset atrial fibrillation during hospital admission according to sex.

Results

Clinical characteristics and in-hospital outcomes for the overall population according to atrial fibrillation prior to hospital admission status

A total of 519,750 cases of CAP in people ≥ 18 years were admitted to Spanish hospitals during the study period (Table 1), out of which 213,631 cases corresponded to women (41.1%). Overall, people coded for atrial fibrillation prior to hospital admission represented 23.75% (N = 123,440) of the population. Women constituted 41.71% of the population with prior history of atrial fibrillation, whereas the proportion of women in the population with no prior history of atrial fibrillation was 40.91%.

Table 1 Clinical characteristics, and in-hospital outcomes of patients hospitalized with community-acquired pneumonia in Spain from 2016 to 2019 according to atrial fibrillation prior to hospital admission, and to atrial fibrillation diagnosed during hospital admission.

People with atrial fibrillation prior to hospital admission were older than people without atrial fibrillation (82.14 ± 8.95 vs. 71.99 ± 16.46 years; p < 0.001) and with more comorbidities (p < 0.001). They had more commonly suffered from cardiovascular conditions, dementia, chronic obstructive pulmonary disease, type 2 diabetes mellitus, renal disease, and rheumatoid disease, and were reported to have a higher percentage of oxygen use at home as well (all p values < 0.001) (Table 1). People with atrial fibrillation prior to hospital admission less often underwent bronchial fibroscopy, chest computed tomography and invasive lung ventilation during the hospitalization period than people without atrial fibrillation (all p values < 0.001) but had a higher probability of receiving non-invasive ventilation (p < 0.001) (Table 1). Length of hospital stay was similar between both groups (8 ± 7 vs. 7 ± 7 days), yet crude IHM was significantly higher in people with atrial fibrillation prior to hospital admission (15.24% vs. 11.40%; p < 0.001).

Clinical characteristics and in-hospital outcomes for the overall population according to atrial fibrillation diagnosed during hospital admission status

People with new onset of atrial fibrillation during hospital admission represented 0.60% (N = 3154) of the total population. The proportion of women with atrial fibrillation diagnosed during hospital admission was 38.05%, vs. 41.12% in the population without this condition.

People with atrial fibrillation diagnosed during hospital admission were older than people without atrial fibrillation (76.55 ± 11.69 vs. 74.39 ± 15.65 years; p < 0.001) and had more comorbidities (p < 0.001). They had more commonly suffered from cardiovascular conditions (all p values < 0.001, except for cerebrovascular disease (p = 0.034)), chronic obstructive pulmonary disease (p = 0.036), type 2 diabetes mellitus (p = 0.002), liver disease (p = 0.007), renal disease (p = 0.001), and cancer (p = 0.001) (Table 1). People with atrial fibrillation diagnosed during hospital admission more often underwent bronchial fibroscopy, chest computed tomography, dialysis, and both non-invasive and invasive lung ventilation than people without atrial fibrillation (all p values < 0.001) (Table 1). Both length of hospital stay (12 ± 12 vs. 7 ± 7 days), and crude IHM (23.84% vs. 12.24%; p < 0.001) were higher in people with atrial fibrillation diagnosed during hospital admission than in people without atrial fibrillation.

Clinical characteristics and in-hospital outcomes for women and men by atrial fibrillation prior to hospital admission status after propensity score matching

After PSM, women with atrial fibrillation prior to hospital admission had more often suffered from heart failure (p = 0.003), peripheral vascular disease (p = 0.028), cerebrovascular disease (p < 0.001), and more frequently used oxygen at home (p = 0.001) (Table 2). Despite they more commonly received both non-invasive and invasive lung ventilation (both p < 0.001), their IHM did not differ from IHM in women with no atrial fibrillation (15.72% vs. 15.52%; p = 0.425).

Table 2 Clinical characteristics, and in-hospital outcomes of women hospitalized with community-acquired pneumonia in Spain from 2016 to 2019 according to atrial fibrillation prior to hospital admission, before and after propensity score matching.

After PSM, men with atrial fibrillation prior to hospital admission had more often suffered from heart failure (p < 0.001), cerebrovascular disease (p < 0.001), and more frequently used oxygen at home (p = 0.025), but less often had type 2 diabetes mellitus (p = 0.003) (Table 3). Despite they more commonly received both non-invasive and invasive lung ventilation (both p < 0.001), their IHM did not differ from IHM in men with no atrial fibrillation (14.90% vs. 14.99%; p = 0.631).

Table 3 Clinical characteristics, and in-hospital outcomes of men hospitalized with community-acquired pneumonia in Spain from 2016 to 2019 according to atrial fibrillation prior to hospital admission, before and after propensity score matching.

Clinical characteristics and in-hospital outcomes for women and men by atrial fibrillation diagnosed during hospital admission status after propensity score matching

After PSM, women with atrial fibrillation diagnosed during hospital admission had more often had a myocardial infarction (p < 0.001) (Table 4). During hospital admission, they more commonly underwent surgery, dialysis, and received both non-invasive and invasive lung ventilation (all p values < 0.001). Their IHM was higher than IHM in women with no atrial fibrillation during hospital admission (24.37% vs. 13.36%; p < 0.001).

Table 4 Clinical characteristics, and in-hospital outcomes of women hospitalized with community-acquired pneumonia in Spain from 2016 to 2019 according to atrial fibrillation diagnosed during hospital admission, before and after propensity score matching.

After PSM, men with atrial fibrillation diagnosed during hospital admission had more often had a myocardial infarction (p < 0.001) (Table 5). During hospital admission, they more commonly underwent surgery, bronchial fibroscopy, dialysis, and received both non-invasive and invasive lung ventilation (all p values < 0.001). Their IHM was higher than IHM in men with no atrial fibrillation during hospital admission (23.94% vs. 14.04%; p < 0.001).

Table 5 Clinical characteristics, and in-hospital outcomes of men hospitalized with community-acquired pneumonia in Spain from 2016 to 2019 according to atrial fibrillation diagnosed during hospital admission, before and after propensity score matching.

Multivariable analysis of factors associated with in-hospital mortality during admission for CAP among patients with atrial fibrillation prior to hospital admission

The risk of dying during hospital admission for CAP among patients with atrial fibrillation prior to hospital admission increased with age and most comorbidities, but chronic obstructive pulmonary disease (OR 0.77; 95% CI 0.74–0.80) and type 2 diabetes mellitus (OR 0.90; 95% CI 0.87–0.93) were associated with a lower IHM (Table 6). Whilst undergoing chest computed tomography was associated with a lower IHM (OR 0.70; 95% CI 0.65–0.77), dialysis (OR 2.17; 95% CI 1.91–2.47), non-invasive lung ventilation (OR 2.65; 95% CI 2.45–2.85) and invasive lung ventilation (OR 6.75; 95% CI 6.16–7.40) were associated with a higher IHM (ORs and 95% CIs are for the overall population). Male sex was associated with a higher IHM (OR 1.06; 95% CI 1.02–1.10).

Table 6 Multivariable analysis of factors associated with in-hospital mortality during admission for community-acquired pneumonia among patients with atrial fibrillation prior to hospital admission, according to sex.

Multivariable analysis of factors associated with in-hospital mortality during admission for CAP among patients with atrial fibrillation diagnosed during hospital admission

The risk of dying during hospital admission for CAP among patients with atrial fibrillation diagnosed prior to hospital admission increased with age and most comorbidities (Table 7). Whilst undergoing chest computed tomography was associated with a lower IHM (OR 0.67; 95% CI 0.48–0.93), dialysis (OR 3.01; 95% CI 2.14–4.25), non-invasive lung ventilation (OR 1.79; 95% CI 1.39–2.31) and invasive lung ventilation (OR 3.21; 95% CI 2.50–4.11) were associated with a higher IHM (ORs and 95% CIs are for the overall population). Male sex was not associated with a higher IHM (OR 0.93; 95% CI 0.77–1.13).

Table 7 Multivariable analysis of factors associated with in-hospital mortality during admission for community-acquired pneumonia among patients with atrial fibrillation diagnosed during hospital admission, according to sex.

Discussion

Here we found that almost one quarter of the people older than 17 years admitted to the hospital for CAP had atrial fibrillation prior to hospital admission, but less than one percent had new onset atrial fibrillation during hospital admission. Versus no atrial fibrillation, IHM was significantly higher in people with atrial fibrillation prior to hospital admission, and length of hospital stay and IHM were higher in people with atrial fibrillation diagnosed during hospital admission. After PSM, women and men with atrial fibrillation prior to hospital admission received both non-invasive and invasive lung ventilation more often than women and men with no atrial fibrillation, but their IHM did not differ (around 15% for each group). Women and men with atrial fibrillation diagnosed during hospital admission more commonly underwent surgery, dialysis, and received both non-invasive and invasive lung ventilation, yet their IHM was much higher than IHM in women and men with no atrial fibrillation. The risk of dying during hospital admission for CAP among patients with both atrial fibrillation prior to hospital admission or diagnosed during hospital admission increased with age, comorbidities, and interventional procedures. Age, comorbidities and invasive lung ventilation were the strongest predictive factors of IHM, in line with previous reports14.

Male sex was associated with a higher IHM in patients with atrial fibrillation prior to hospital admission, but sex did not modify IHM in patients with atrial fibrillation diagnosed during hospital admission.

Almost one quarter of the population admitted for CAP had prevalent atrial fibrillation in our study. This figure is higher than previous reports15,16 and we believe that it basically depends on the age of the population included, the quality of the coding process and the qualification of “present on admission” even for patients with clinical history of paroxysmal atrial fibrillation. Contrarily, we found a remarkably low rate of coding for atrial fibrillation diagnosed during hospital admission (less than 1%), and again it probably reflects our definition for the variable: atrial fibrillation onset during hospital admission and “not present on admission”. This definition essentially rules out patients who presented at the ED with sinus rhythm but had previously had atrial fibrillation in its paroxysmal form but were coded as “present on admission”. Not surprisingly, these are the patients who present episodes of atrial fibrillation during admission for CAP more frequently.7 In previously published research, this number also depended on the baseline characteristics of the population studied, since in patients admitted to the intensive care unit for CAP this number raised significantly17. Several mechanisms for new onset of atrial fibrillation have been proposed, like hypoxia, heart scarring or rises in cytosolic calcium, which affects endothelial cadherin junctions thus inducing apoptosis that leads to cardiac injury and arrhythmia18.

Both meteorological conditions and the high altitude may have some influence on the occurrence of paroxysms of atrial fibrillation19,20. We could not adjust for specific meteorological conditions because in order to guarantee the confidentiality and privacy of the information the Spanish Register of Specialized Care-Basic Minimum Database (RAE-CMBD) does not include geographic information about the hospital or the place of residence of the patients. However, this circumstance would not probably affect atrial fibrillation developed during hospitalization. Only extreme altitude has been reported to exert some effect on the onset of arrhythmias19; besides, long-term high-altitude exposure does not seem to increase the incidence of atrial fibrillation, at least that associated with organic heart diseases21. Anyway, it is estimated that less than 50,000 people in Spain live over 1500 m above the sea level, that is, less than 0.1% of the population22.

In our study, patients with either atrial fibrillation prior to hospital admission or diagnosed during hospital admission received both non-invasive and invasive lung ventilation more often than patients with no atrial fibrillation. In our investigation after the multivariate analysis, invasive mechanical ventilation turns to be the strongest predictive factor of mortality with an adjusted OR of 6.80 (95% CI 6.09–7.58) for males and 6.68 (95% CI 5.66–7.89) for females with atrial fibrillation prior to hospital. The results of Espinoza et al. who analyzed 802 patients admitted to ICUs with a diagnosis of CAP showed an adjusted OR for mechanical ventilation of 5.07 (95% CI 5.54–7.27)23.

Given the important association of invasive ventilation with IHM is surprising that in prevalent AF patients, after PSM no IHM differences were found for males of females even if these patients needed more ventilation. In our opinion, probably, the increased IHM risk associated with more frequent invasive mechanical ventilation among women with prevalent atrial fibrillation is counterbalanced by a higher prevalence of dementia, cancer and any surgery among women without prevalent atrial fibrillation. The increased IHM risk associated with more frequent invasive mechanical ventilation among men with prevalent atrial fibrillation is probably counterbalanced by a higher prevalence of prior renal disease, cancer and AIDS among men without prevalent atrial fibrillation.

The Preventive Medicine Department at each hospital is responsible for ensuring the adherence to the strict protocols established for the reutilization of sanitary material and to prevent nosocomial infections, according to European and Spanish Legislation24. Atrial fibrillation may contribute to hemodynamic instability during an acute infection probably signaling adrenergic overstimulation25. It seems that a worse clinical situation during admission prompted the indication of a higher number of procedures in a population with an a priori higher probability of death during the hospital stay.

Versus no atrial fibrillation, we detected no differences in IHM in people with atrial fibrillation prior to hospital admission, but a higher IHM in patients with new onset atrial fibrillation during hospital admission for CAP. The association between new onset atrial fibrillation and mortality in severely ill patients has been described by many authors26,27. Whether new onset of atrial fibrillation is a marker of higher clinical severity, of distinct pathophysiologic mechanisms, or deleterious by itself or by the therapeutic measures that its incidence calls for cannot be clarified with the design of our study. IHM was as high as ≈ 24% in people who developed atrial fibrillation during hospital admission. We had no access to information on end of life decisions, but surely a policy of palliative care was followed in many cases. This highlights the need to develop skills beyond technical knowledge to talk with the patients and their relatives, understand their psychological needs and prepare them for the possibility of a clinical course that does not fulfill the expectations.

In this study we could see that male sex was associated with a higher IHM in patients with atrial fibrillation prior to hospital admission, but not in patients with atrial fibrillation diagnosed during hospital admission. We have previously reported higher IHM in males for CAP in the Spanish population13, but we do not figure out why we are only seeing this gender gap in the case of atrial fibrillation prior to hospital admission. We were able to adjust for baseline clinical congestive heart failure, but we could not account for chronic left ventricular ejection fraction. We might hypothesize that lower baseline values of this parameter in men could have a negative impact on mortality even in patients with no previous clinical decompensation of heart failure to explain this heterogeneous effect associated with gender. Notwithstanding this argument, the incidence of mortality due to CAP in heart failure patients seems to be higher with preserved left ventricular ejection fraction28. Another explanation is that a potentially higher IHM in male is counterbalanced by the higher rate of use of both non-invasive and invasive mechanical ventilation in men in the case of atrial fibrillation diagnosed during hospital admission that we are reporting here, whereas rates of use of mechanical ventilation among men and women with atrial fibrillation prior to hospital admission were quite similar in our population. When non-invasive mechanical ventilation is used and works since the outset, it is accepted that it confers a survival advantage in CAP29.

An unexpected result of our investigation was the protective odds of diabetes and COPD in the IHM after CAP among patients with atrial fibrillation prior to hospital admission.

However, diabetes has been associated with a lower IHM in previous studies of CAP conducted in our country30. Suggested explanations for this association are that patients with diabetes are hospitalized with a less severe disease or that the presence of obesity, a condition very frequent in people with diabetes, could explain this lower mortality. The existence of a ‘obesity survival paradox’ for pneumonia has been reported in meta-analysis and observational reports31,32.

Also the lower mortality of patients with COPD after CAP has been described in previous investigations30,33. The selection bias, previously commented for patients with diabetes, could result in those patients with COPD being more likely to be hospitalized with less severe pneumonia. Other possible reasons are that, given the overlap in symptoms/clinical findings between COPD exacerbations and pneumonia, exacerbations could be mistakenly coded as CAP. This misclassification has been suggested by other authors when ICD10 codes are used34. Finally, this could also be due to a protective anti-inflammatory effect of inhaled corticosteroids and different immune responses secondary to an altered microbiome in COPD subjects35,36,37.

For both, diabetes and COPD patients, another possible explanation would be an earlier diagnosis or treatment initiation in these patients. However, future studies, with more detailed clinical information, are required to clarify these associations.

Our investigation has strengths and limitations that must be considered. The external validity is the most relevant strength as we cover almost all hospital discharges for an entire country with a constant methodology over a four-year period38,39.

Regarding limitations, as in most hospital based administrative discharge databases, we lack information on laboratory results, radiological images, treatments with antibiotic, anticoagulants or anti-platelet therapy prior or within the hospital, lifestyles (smoking, obesity, physical exercise) and severity scales for pneumonia38,39. Secondly, the presence of residual confounding cannot be ruled out even if the PSM may have helped to reduce it. Third, we don’t have data on the after hospital discharge mortality. It is possible that if a patient is transferred from one hospital to another with the same diagnosis would be counted twice, however due to the severity of CAP we think this is extremely infrequent and would not affect our results. Finally, to our knowledge, no external validation has been performed to assess the validity of the identified predictive factors and diagnosis codes using an external dataset.

In conclusion, our study shows an association between atrial fibrillation diagnosed during hospital admission and IHM in people admitted for CAP, but not for atrial fibrillation prior to hospital admission. Whether new onset of atrial fibrillation is a marker of higher clinical severity or deleterious by itself needs to be elucidated.

Methods

Study population

We included in the study every episode of hospital admission for CAP in Spanish people older than 17 years. We used data for the period January 1st, 2016-December 31st, 2019, from the RAE-CMBD. Additional details on the RAE-CMBD can be found online40. The International Classification of Disease, Tenth Revision (ICD-10) guided the codification of discharge diagnoses and therapeutic procedures. The codes used to identify patients hospitalized with CAP are defined in Supplementary Table S1. The study population was stratified according to sex, in a similar fashion to previous research38.

Study variables

We sought atrial fibrillation codes (ICD10-codes 148.xx) among people admitted for CAP. The “Present on Admission (POA)” indicator enabled us to discriminate between patients who had been diagnosed with atrial fibrillation before the index hospitalization and patients who developed atrial fibrillation during the hospitalization period.

For those patients admitted more than once over the study period only the first episode was analyzed and the rest of hospital admissions discarded.

The main outcomes study variable was the IHM.

As proposed by Sundararajan et al. the Charlson Comorbidity Index (CCI) was used to assess the comorbidites41. Other covariates included diagnostic and therapeutic procedures like use of oxygen prior to hospitalization, any surgical procedure during the hospital admission, bronchial fibroscopy, dialysis or computerized axial tomography. (Supplementary Table S1).

Propensity score matching method

We used a PSM method to reduce potential residual confounding implicit to research work out of randomized clinical trials42. We matched each woman who had a code for atrial fibrillation prior to hospital admission with another woman of the same age and baseline clinical conditions with no atrial fibrillation, and we proceeded in a similar way for atrial fibrillation diagnosed during hospital admission. We adhered to the same criteria for the matching process among men. Multivariable logistic regression was used to estimate the PS for each patient that was then matched to the patient with the closest PS value in the corresponding non-atrial fibrillation subpopulation The matching variables were age and the comorbid conditions present at admission.

Statistical analysis

Absolute frequencies and proportions are reported for categorical variables and means or medians, with standard deviations (SDs) and interquartile ranges (IQRs) respectively, for continuous variables.

To assess significant differences between study subgroups we used chi-square, t test or the Mann–Whitney test before PSM and McNemar’s test and a paired t test after PSM42.

Variables independently associated with IHM were identified constructing multivariable logistic regression models replicating the steps proposed by Hosmer et al.43. We constructed models separately for men and women Finally, we analyzed the effect of sex in two models: 1. Patients with atrial fibrillation prior to hospital admission; and 2. Patients with atrial fibrillation diagnosed during hospital admission. The results were expressed as odds ratios (ORs) with their 95% confidence intervals (CIs).

Stata version 14 (Stata, College Station, Texas, USA) was the software used for all statistical analysis.

Ethics

The RAE-CMBD is owned by the Spanish Ministry of Health and can be accessed upon request44. This registry is anonymized and under public access, which means that according to Spanish legislation, approval by an ethics committee can be waived. As the RAE-CMBD is an administrative database the information of all the patients hospitalized is mandatory by law so there is no need to ask patients for informed consent, since it is assumed that if the patient agrees to be hospitalized, they are implicitly giving their consent for their data to be included in anonymized administrative databases.