Introduction

A hip fracture is a fracture occurring between the neck of the femur and the trochanter of the femur. It is a common and serious health condition affecting the elderly patients, and frequently requires surgical intervention and postoperative restricted activity1. Notably, the occurrence of postoperative new-onset constipation is often triggered by changes in traditional defecation habits, comorbid with previous various cardiovascular and cerebrovascular diseases. Postoperative constipation may lead to multiple complications2, such as abdominal distension, intestinal obstruction, postoperative infections and pneumonia. Moreover, prolonged stool retention can lead to fecal impaction, fermentation, and endotoxins, inducing psychological and physiological dysfunction. The difficulty in defecation may induce various adverse cardiovascular and cerebrovascular events3. In addition, family caregivers often face emotional stress and financial strain associated with the need for medical consultations, treatments, and potential lifestyle adjustments. Furthermore, constipation-related medical interventions together with the decreased individual productivity impose a significant economic burden on the society. Generally, constipation imposes a significant suffering on individuals, family burden, and financial stress of the health cost.

Currently, postoperative constipation is primarily treated through consumption of fiber and fluids intake, participation in more physical activities, and seeking medical interventions to soften stools and facilitate bowel movements4. Although these interventions can alleviate postoperative constipation, there is no tool that facilitates the prediction and prevention of postoperative constipation after hip fracture surgery in elder patients. Thus, it prompt us to further investigate risk factors, develop predictive models, and implement early interventions to prevent postoperative constipation. Recent research has identified behavioral barriers and the lack of privacy for defecation in hospital settings as significant risk factors contributing to postoperative constipation following hip fracture surgery5. Another study has been reported that female, elder age, unemployed, pain intensity, opioid intake, and previous constipation are associated with a higher risk of constipation in orthopedic patients6. However, these studies were limited by small sample sizes, comprising only 140 and 150 patients, respectively. In addition, neither study developed a predictive calculator tool to assess the risk of postoperative constipation, highlighting a critical gap in the current research landscape. These limitations underscore the need for larger-scale studies and the development of practical tools to enhance clinical prediction and intervention strategies. Several nomograms have been constructed, enhancing the prevention of perioperative adverse events7,8,9. Currently, there are no effective predictive tools for early identification of high-risk patients, which limit early implementation of medical interventions for postoperative new-onset constipation. To identify risk factors and develop a predictive tool for postoperative new-onset constipation, we designed our research accordingly.

Methods

This study was conducted following the Declaration of Helsinki and its subsequent revisions, and was approved by the Ethics Committee at Xiangyang Central Hospital, affiliated with Hubei University of Arts and Science. This study was conducted in Xiangyang Central Hospital and was registered at www.chictr.org.cn (ChiCTR2400085204). Given the retrospective nature of the study, the need of informed consent was waived.

The inclusion criteria were: Patients, aged > 65 years with low-energy femoral neck or intertrochanteric fractures, undergoing open or closed reduction and internal fixation, total hip arthroplasty or hemiarthroplasty, in our hospital from January 2021 to December 2023 were eligible for the study. Exclusion criteria included patients with pathological fractures and multiple site fractures or injuries.

Patients’ information, including demographic data (age, gender, body mass index (BMI), activity of daily living (ADL), alcohol consumption, smoking, American Society of Anesthesiologists (ASA) physical status classification, New York Heart Association (NYHA) functional classification, preoperative waiting time), previous disease (gastrointestinal disease, cerebrovascular disease, cardiovascular disease, neurosurgery, cardiac surgery, lung disease, liver disease, kidney disease, diabetes, hypertension, preoperative deep vein thrombosis, preoperative constipation, preoperative atrial fibrillation, osteoporosis, preoperative pulmonary infection), surgical information (type of surgery, duration of surgery, intraoperative blood loss, anesthesia method, preoperative, intraoperative, and postoperative red blood cell transfusion volume, postoperative characteristics (ICU admission, use of pain pumps, pulmonary infection, urinary tract infection, constipation), and laboratory results (hemoglobin (HB), White blood cell (WBC), total bilirubin (TB), albumin (ALB), platelet (PLT), creatinine (Cr), D-dimer, and ejection fraction (EF)) were collected from the electric database.

Constipation was diagnosed based on the Rome IV criteria10. Mantegazzi introduced three distinct criteria for diagnosing constipation following orthopedic surgery. The first definition relies on the presence of at least one of the following symptoms: absence of stool for three days, presence of hard stools, or experiencing discomfort during bowel movements. The second definition refers to the presence of at least two subjective indicators, such as decreased stool volume, abdominal discomfort, excessive gas, or diminished appetite. The third definition is based on the use of an enema. These three criteria were employed in this study11. Alcohol consumption was defined as more than 500 ml per week (40% concentration) or 30 g per day. Smoking history was defined as continuous or cumulative smoking for more than 6 months. Patient-controlled analgesia (PCA) was administered upon patient’s willingness.

Statistical analysis

Quantitative data are presented as Normally distributed datasets were presented as mean with standard deviation (SD), whereas non-normally distributed datasets were expressed as the median with interquartile range (IQR), and count data were presented as numbers. Statistical analyses were conducted utilizing the t-test or the Mann–Whitney U test for continuous variables, while the χ2 test was applied for categorical data.

Considering the data imbalance between patients with and without postoperative new-onset constipation, a hybrid sampling technique combining overs- and down-sampling was applied using the ROSE package in R to generate a balanced dataset with approximately 1:1 ratio12. This technique helps to mitigate the effect of data imbalance and reduce the risk of model overfitting. To address missing data, imputation with the mean was performed, and the entire dataset was randomly divided into training and testing subsets at a ratio of 70–30%, employing computer-generated random binary numbers “0” and “1”. To identify significant predictors, we conducted both univariate and multivariate logistic regression analyses. Variables with a p-value less than 0.05 in the univariate analysis were included in the multivariate model. Those maintaining a p-value below 0.05 in the multivariate analysis were subsequently used to construct a nomogram.

A nomogram was constructed using R software (version 4.2.1, USA) using significant variables. The performance of the nomogram in differentiating and predicting postoperative constipation was evaluated using the area under the curve (AUC) of the receiver operating characteristic (ROC) curve. Typically, an AUC value ranging from 0.6 to 0.75 is considered acceptable, while values between 0.75 and 0.9 indicate good discrimination. An AUC exceeding 0.9 reflects excellent discriminatory power13. The alignment between the predicted probabilities and the actual probabilities was assessed using a calibration plot13. The range of threshold probabilities and the net benefit of using the model were explored using decision curve analysis (DCA)14.

Results

Demographic characteristics of patients

The flow chart of the trial study is presented in Fig. 1. A total of 1,100 patients were screened in the study. Eight patients were excluded because of missing data for the target variables, and the remaining 1,092 patients were included in the final analysis. Various characteristics were compared between the constipation (N = 460) and non-constipation (N = 632) groups, with results indicating that the constipation group had slightly higher BMI (P = 0.006) and a higher prevalence of hypertension (P = 0.039), and a higher incidence of cerebrovascular and cardiovascular diseases, and preoperative pulmonary infection.

Additionally, the constipation group had a significantly elevated white blood cell count (P = 0.001), and 29.8% of these patients reported preoperative constipation (Table 1). We came across the primary data and the results revealed that 137 patients with preoperative constipation subsequently all showed postoperative constipation, while patients without preoperative constipation has a incidence of 33% to develop postoperative new-onset constipation. The results demonstrated a strong association between preoperative and postoperative constipation. To minimize collinearity and enhance the validity of the predictive model, patients with preoperative constipation were excluded from subsequent analyses. Among the remaining 955 patients without preoperative constipation, those who developed postoperative new-onset constipation (N = 323) were compared with those who did not (N = 632) in terms of baseline characteristics(Supplementary Table 1).

Fig. 1
Fig. 1
Full size image

A flow chart of the trial study.

Table 1 Baseline characteristics of all elderly patients undergoing hip fracture surgery.

Univariate and multivariate logistic regression analyses in the training set

To address this imbalance between the postoperative constipation and non-constipation groups, a combined over- and down-sampling technique was applied using the ROSE package in R software. This approach produced a balanced dataset with 462 patients in the constipation group and 493 in the non-constipation group, allowing for more stable and unbiased model development (Supplementary Table 2).

Univariate logistic regression analysis was performed on the balanced dataset. The results identified that BMI, cerebrovascular disease, cardiovascular disease, heart surgery history, osteoporosis, preoperative pulmonary infection, preoperative lower limb thrombosis, renal disease, NYHA, TB, ALB, surgery type, anesthesia manner, RBC intraoperative, blood loss, PCA, gastrointestinal disease were associated with postoperative new-onset constipation (P < 0.05). These factors were included in the multivariate analysis, and the results demonstrated that BMI, cerebrovascular disease, cardiovascular disease, gastrointestinal disease, blood loss, renal disease, preoperative lower limb thrombosis, heart surgery history, PCA and preoperative pulmonary infection were significantly associated with postoperative constipation (P < 0.05, Table 2). In addition, multicollinearity among the ten variables were analyzed and all the variance inflation factor (VIF) were below 2.0, suggesting absence of multicollinearity of the ten variables (Table 3).

Table 2 Univariate and multivariate logistic regression analysis of risk factors associated with postoperative new-onset constipation in elderly patients undergoing hip fracture surgery.
Table 3 Variance inflation factor (VIF) analysis of predictors included in the nomogram for postoperative new-onset constipation.

Development of a nomogram for predicting postoperative constipation

A prediction calculator for postoperative new-onset constipation was developed using the logistic regression algorithm (Fig. 2). The points range from 0 to 100, used to assign scores to each variable in order to calculate the total score. Those variables, including BMI, cerebrovascular disease, cardiovascular disease, gastrointestinal disease, blood loss, renal disease, preoperative lower limb thrombosis, heart surgery history, PCA and preoperative pulmonary infection were derived from patients’ clinical data. The total point was calculated and the predicted probability are presented in the last line.

The ROC curve was generated based on the predictive nomogram, and the AUC values were 0.730 (95% confidence interval (CI) 0.692–0.768, Fig. 3A), and 0.712 (0.651–0.772, Fig. 3B) for the training and test groups, respectively. The calibration plots for both the training (Fig. 3C) and test (Fig. 3D) groups revealed strong alignment between the predicted and actual probabilities. Hosmer-Lemeshow test revealed a good concordance between predictive probability and actual probability both in the training (Chi-square, 10.18, p = 0.336) and test (Chi-square, 14.52, p = 0.105) sets. The DCA further showed that the model maintained clinical utility across threshold probabilities ranging from 0.2 to 0.9 in the training group (Fig. 3E) and from 0.25 to 0.8 in the test group (Fig. 3F).

Fig. 2
Fig. 2
Full size image

Nomogram for predicting the constipation following hip surgery.

Fig. 3
Fig. 3
Full size image

The AUC of the curve was 0.730 (0.692–0.768) and 0.712 (0.651–0.772) for the (A) training and (B) test groups, respectively. Calibration plot demonstrating good concordance between the predicted probability and actual probability in the (C) training and (D) test sets. DCA results illustrating that the model was clinically useful under the threshold probabilities of 0.2–0.9 and 0.25–0.8 in the training (E) and test (F) group, respectively.

Discussion

This study found that the incidence of postoperative new-onset constipation is significantly high incidence, occurring in nearly 42% of elderly patients undergoing hip surgery. Logistic regression analysis identified ten significant factors influencing postoperative new-onset constipation in these patients were identified. They were BMI, cerebrovascular disease, cardiovascular disease, gastrointestinal disease, blood loss, renal disease, preoperative lower limb thrombosis, heart surgery history, PCA and preoperative pulmonary infection. Subsequently, a nomogram was developed for predicting postoperative constipation. The nomogram showed a good discriminative ability and is expected to guide orthopedic surgeons in making clinical decisions and implement early preventive interventions for postoperative constipation following hip fracture surgery in elderly patients.

In this study, cerebrovascular diseases, heart surgery history and cardiovascular disease were identified as independent risk factors for postoperative new-onset constipation. Patients with cerebrovascular diseases often present with central nervous system injury or impaired autonomic regulation, which may lead to dysfunction of the enteric nervous system and reduced gastrointestinal motility15. Previous studies have reported that the incidence of constipation after stroke can reach 40–60%, and is closely related to the degree of neurological impairment16. Reduced body mobility after surgery may further impair bowel function, compounding the risk of postoperative constipation. In addition, cardiovascular disease also affect intestinal peristalsis by modulating blood circulation and autonomic nervous system function. For patients who have had heart surgery or cardiovascular disease, they often take anticoagulants, antihypertensive drugs, and lipid-lowering drugs. For example, calcium channel blockers are frequently used to block the flow of calcium ions across membranes via voltage-gated L-type channels17. These channels are predominantly located in vascular smooth muscle, as well as in gastrointestinal smooth muscle. Calcium ions blockers may cause motility disorders in the rectosigmoid region, resulting in significant constipation18. This calls for investigation into alternative medications post-hip surgery to mitigate the risk of constipation.

In addition, we identify that BMI is a risk factor for postoperative new-onset constipation. Patients with high BMI may exhibit high intra-abdominal pressure as a result of excessive fat accumulation, which can potentially cause defecating difficulties. Obesity may indirectly induce constipation by altering intestinal hormone secretion, impairing bowel movement, and inflammatory responses19. Moreover, PCA is frequently used after hip fracture surgery in our study and the major drug is opioids. To date, the incidence of opioid-related constipation is estimated at 41%, and it is dependent on the dosage and duration of drug use20. This is because opioid analgesics can inhibit the central nervous system and induce constipation via activating intestinal µ-opioid receptors21. Opioid decrease the sensitivity of the central nervous system to the defecation reflex, inhibit intestinal motility, and enhance the risk of constipation22. For patients undergoing hip surgery, opioids should be minimized, and replaced by intravenous esketamin23,24, alpha7 n acetycholine receptor agonist25, or 5HT3 receptor antagonist26 to reduce the need for postoperative opioid self-administration.

In our study, gastritis was significantly associated with postoperative new-onset constipation, suggesting its potential role in impaired postoperative gastrointestinal recovery. Gastritis may lead to disrupted gastric acid secretion and imbalanced gastrointestinal hormone levels, resulting in delayed gastric emptying and reduced motility. These pathophysiological changes decrease the patient’s tolerance to perioperative stress and medications—such as analgesics and anesthetics—thereby substantially increasing the risk of postoperative new-onset constipation. Surprisingly, blood loss was associated with a reduced risk of postoperative new-onset constipation; however, the reason is unknown.

Furthermore, our study found that patients with preoperative lower limb venous thrombosis, pulmonary infection, and renal disease had a significantly increased risk of developing postoperative new-onset constipation. Lower limb thrombosis often leads to limited postoperative mobility, and the use of analgesics and anticoagulants may further suppress intestinal motility. Patients with pulmonary infections prior to surgery tend to have compromised lung function, prolonged bed rest, and are frequently treated with antibiotics, which can disrupt the intestinal flora and impair gastrointestinal function. For those with renal disease, factors such as electrolyte imbalances, medication effects, autonomic nervous dysfunction, and restricted fluid intake collectively contribute to a higher risk of constipation. These findings suggest that elderly patients with such underlying comorbidities require enhanced postoperative bowel management and early preventive strategies.

In this study, we integrated ten factors to develop a prediction nomogram for predicting the incidence of new-onset constipation following hip surgery. The nomogram developed in this study demonstrated AUC values of 0.730 and 0.712 in the training and testing cohorts, respectively, indicating a good discriminative performance for identifying patients at risk of postoperative new-onset constipation. Previous study has reported that the incidence of postoperative constipation is approximately 77.7% in elderly patients with hip fracture in a prospective study5. However, our results revealed that postoperative new-onset contipation is about 33% in elderly patients after hip fracture surgery. Our study has an advantage of large sample size, which included about one thousand patients. Moreover, the calibration curves for both datasets revealed a strong correlation between the predicted and observed probabilities, suggesting a good concordance. Further, results of the DCAs demonstrated that physicians may benefit from wide threshold probabilities between 0.25 and 0.8, highlighting the model’s strong clinical utility.

In our study, a total of 137 patients with preoperative constipation all had postoperative constipation. This indicated a strong correlation—and likely a direct causal relationship—between preoperative and postoperative constipation. Inclusion of this variable could lead to collinearity and overfitting of the model, and impaired generalizability to broader clinical populations.Therefore, patients with preoperative constipation were excluded from model establishment. Among the remaining patients, approximately one-third developed postoperative new-onset constipation, suggesting data imbalance between groups. We used conbined over- and down-sampling using “ROSE” package to balance class distribution. This process improves the model performance, while avioding overfitting at the same time.

Postoperative constipation in patients undergoing hip fracture surgery is often managed with with a combination of pharmacological and non-pharmacological treatment strategies. Pharmacological interventions may include laxatives, stool softeners, or prokinetic agents, while non-pharmacological strategies comprise activities, such as early mobilization, adequate hydration, and consumption of a fiber-rich diet. Patient education about bowel management and the use of probiotics have shown great potential to prevent and alleviate constipation. To suppress the development of postoperative constipation, the proposed risk assessment model can improve timely identification of high-risk patients. This model uses ten baseline factors to assess the risk of postoperative new-onset constipation. By categorizing patients according to their risk levels, healthcare providers can tailor preventive strategies, enhancing postoperative recovery and minimizing the likelihood of constipation-related complications.

The study has several limitations that should be discussed. Although the precision of the proposed nomogram was tested through internal validation, we did not use external validation datasets from different medical institutions. In addition, some risk factors such as psychological stress, postoperative bed rest time, fluid intake, and antibiotic use, were not included in the analysis. These factors need to be explored in prospective studies to comprehensively determine the risk of constipation in orthopedic surgery patients.

Conclusions

In conclusion, Ten risk factors were identified, which were used to establish a nomogram for predicting postoperative new-onset constipation following hip fracture surgery. The nomogram showed good discriminative ability and is expected to facilitate early intervention to prevent postoperative new-onset constipation.