Analysis of the association between atrial fibrillation with in-hospital mortality in people admitted for community-acquired pneumonia through an observational, nation-wide, sex-stratified study

We aimed to analyze the influence of atrial fibrillation (AF) prior to hospital admission (“prevalent”) and AF diagnosed during hospital admission (“incident”) on in-hospital mortality (IHM) in women and men admitted for community-acquired pneumonia (CAP) in Spain (2016–2019). We used the Spanish Register of Specialized Care‐Basic Minimum Database. We analyzed 519,750 cases of CAP in people ≥ 18 years (213,631 women (41.1%)), out of which people with prevalent AF represented 23.75% (N = 123,440), whereas people with incident AF constituted 0.60% (N = 3154). Versus no AF, crude IHM was significantly higher for prevalent AF (15.24% vs. 11.40%, p < 0.001) and for incident AF (23.84% vs. 12.24%, p < 0.001). After propensity score marching, IHM in women and men with prevalent AF neared IHM in women and men with no AF (15.72% vs. 15.52%, p = 0.425; and 14.90% vs. 14.99%, p = 0.631, respectively), but IHM in women and men with incident AF was higher than IHM in women and men with no AF (24.37% vs. 13.36%, p < 0.001; and 23.94% vs. 14.04%, p < 0.001, respectively). Male sex was associated with a higher IHM in people with prevalent AF (OR 1.06; 95% CI 1.02–1–10), but not in people with incident AF (OR 0.93; 95% CI 0.77–1–13). AF diagnosed during hospital admission was associated with a higher IHM, irrespectively of sex.

www.nature.com/scientificreports/ 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 well 9,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 IHM 8 . Nonetheless, previous reports had failed to show an association between chronic atrial fibrillation and IHM in people admitted for CAP 7 . Furthermore, sex may influence the outcomes of CAP 11 . 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 pneumonia 12 , a sex gap due to biological differences cannot be ruled out 13 . 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%.
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.
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).
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).
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 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.

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 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. www.nature.com/scientificreports/ 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 reports 14 .
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 reports 15, 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 significantly 17 . 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 arrhythmia 18 . 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. www.nature.com/scientificreports/ Both meteorological conditions and the high altitude may have some influence on the occurrence of paroxysms of atrial fibrillation 19,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 arrhythmias 19 ; besides, long-term high-altitude exposure does not seem to increase the incidence of atrial fibrillation, at least that associated with organic heart diseases 21 . 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 population 22 .
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 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. www.nature.com/scientificreports/ 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 Legislation 24 . Atrial fibrillation may contribute to hemodynamic instability during an acute infection probably signaling adrenergic overstimulation 25 . 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 authors 26,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 population 13 , but we do not figure out why 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. www.nature.com/scientificreports/ www.nature.com/scientificreports/ 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 fraction 28 . 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 CAP 29 . 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 country 30 . 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 reports 31,32 .
Also the lower mortality of patients with COPD after CAP has been described in previous investigations 30,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 used 34 . 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 subjects [35][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 period 38,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 pneumonia 38,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 online 40 . 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 research 38 .

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 comorbidites 41 . 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 trials 42 . 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 www.nature.com/scientificreports/ 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 PSM 42 .
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 request 44 . 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.