FormalPara Key Summary Points

Why carry out this study?

Persistent postsurgical pain and opioid use are common complications after total hip or knee arthroplasty, and although pre- and postoperative risks factors for these outcomes have been identified, the evolution of these factors remains unknown from before to after surgery.

We hypothesized that time-varying longitudinal measures of postoperative psychological distress, as well as pre- and postoperative use of opioids would be the most significant risk factors for delayed postoperative opioid and pain cessation.

What was learned from the study?

Preoperative opioid use and increased postoperative pain intensity at any time after surgery were independently associated with delayed postoperative opioid cessation.

Postoperative elevated depressive symptoms, pain catastrophizing, and opioid use at any time after surgery were independently associated with delayed postoperative pain resolution.

Repeated risk stratification before and after surgery is necessary to identify patients most likely to develop delayed pain and opioid cessation after total joint arthroplasty, and interventions targeting the identified perioperative risk factors from this study may reduce prolonged postoperative pain and opioid use.

Introduction

Balancing optimal pain management and conservative opioid prescribing are particularly challenging after surgery. Surgical patients are vulnerable to opioid overprescribing, which may precipitate persistent postsurgical opioid use (PPOU) [1]. PPOU is associated with a significantly increased risk of developing opioid use disorder or experiencing an overdose [2]. With this link between PPOU and serious opioid-related adverse events, there is a need for greater precision in perioperative risk stratification from before to after surgery.

Although definitions of PPOU vary, it remains a common outcome [3], and the risk is greater for patients who are taking opioids prior to surgery [3,4,5]. Among patients undergoing total hip or knee arthroplasty, 16–21% of patients continue opioid therapy 12 months after surgery [4]. In comparison, 27–44% of patients report persistent post-surgical pain (PPSP) after total hip or knee arthroplasty [6]. When comparing postoperative pain and opioid use trajectories in the same surgical patient, pain resolution is usually reported long after opioid cessation after a variety of surgical operations including total joint arthroplasty [7, 8]. Thus, prevention of PPSP and PPOU should be considered in tandem. As disparate preoperative risk factors for PPSP and PPOU have been identified [7], discrete risk stratification for each outcome should be considered.

To date, major preoperative risk factors for PPOU include use of opioids, tobacco, and cocaine [3]; anxiety, depression, and other mood disorders [3]; psychological distress [7, 9]; and antidepressant or benzodiazepine use before total hip and knee arthroplasty [10]. Pain conditions including back pain and fibromyalgia heighten the risk of PPOU [3]. Risks factors for PPSP after total joint arthroplasty include younger age, preoperative pain, female sex, non-white race, and preoperative pain catastrophizing [11]. Much remains unknown regarding the relative evolution of pre vs. postoperative patient-specific risk factors in the development of delayed postoperative opioid cessation and pain resolution, and these details have the potential to inform the optimal timing for delivery of evidence-based interventions to curb these outcomes.

After surgery, the link between opioid over-prescribing and the development of PPOU is equivocal [12]. Among patients undergoing total hip or knee arthroplasty, opioid consumption in the first 24 h is not associated with postoperative opioid consumption prior to discharge, and additional subacute factors associated with remote outcomes must be identified to inform the development of interventions to curb persistent PPOU [13]. Subacute pain intensity on postoperative day 10 is a significant risk factor for prolonged opioid use, pain, and delayed surgical recovery among patients undergoing a variety of operations under general or local anesthesia, including total hip or knee arthroplasty [14, 15]. Further research is needed to examine comprehensive perioperative risk stratification models accounting for both preoperative patient risk factors and postoperative changes as patients recover from surgery.

The aims of our prospective, longitudinal, cohort study were to elucidate the shared and distinct risk factors for delayed postoperative opioid cessation and pain resolution after total hip and knee arthroplasty, and to identify preoperative versus perioperative factors associated with delayed pain and opioid cessation including longitudinal changes in psychological distress with time-varying covariates. We hypothesized that time-varying measures of psychological distress, as well as preoperative and postoperative use of opioids would be the most significant risk factors.

Methods

Study Design and Patients

We conducted this prospective, observational study at Stanford Hospital. Patients scheduled for total knee arthroplasty (TKA) or total hip arthroplasty (THA) were considered for inclusion. Additional inclusion criteria included age 18 years or older; English-speaking, and willingness to complete longitudinal assessments. Exclusion criteria were inability to complete longitudinal assessments (e.g., cognitive ability, mental status, medical status), suicidality as assessed by an answer of 2 or greater on question 9 of the Beck Depression Inventory-II [16]; and pregnancy. The study protocol was approved by the Stanford University IRB (#26,234). All patients provided written, informed consent. The study was performed in accordance with the Helsinki Declaration of 1964, and its later amendments. All work has been reported in line with the STROCSS criteria.

Assessments

Before surgery, participants completed an online questionnaire assessing pain and opioid use with a modified Brief Pain Inventory (BPI) [17]. Subjects completed the BPI twice, first referencing pain at the upcoming surgical site and second referencing pain elsewhere. In addition, six mood assessments were administered at baseline, and longitudinally after surgery (Supplementary Table 1). We assessed three NIH Patient-Reported Outcomes Measurement Information System (PROMIS) measures of emotional distress (depression, anxiety, anger) before surgery via computerized adaptive testing [18]. NIH PROMIS measures are reported as T-scores calibrated to a mean score of 50 and standard deviation of 10, representing the average healthy population. Version 1.0 of all PROMIS measures were administered. The PROMIS depression item bank demonstrates strong convergent validity with legacy self-report instruments and responsiveness to change when characterizing the severity of depressive symptoms over time [19]. Further, PROMIS depression exhibits greater reliability, a more normalized distribution, and more conservative effect sizes compared to legacy measures in prospective, observational studies [19]. Across clinically diverse patient samples, including patients with major depressive disorder and back pain, these PROMIS emotional distress measures demonstrate expected longitudinal changes in response to treatment [20].

The Beck Depression Inventory-II[16] (BDI-II) is a 21-item self-report measure of depression symptom severity. These depressive symptoms are measured on a four-point scale, with a score range of 0–63 (0–13 indicating minimal depression, 14–19 indicating mild depression, 20–28 indicating moderate depression, and 29–63 indicating severe depression). The BDI-II demonstrates both internal consistency and high retest reliability [21], and an elevated preoperative BDI-II score is reportedly associated with delayed postoperative opioid cessation [7]. The Positive and Negative Affect Schedule (PANAS) consists of 20 items measuring positive affect and negative affect on five-point scales [22,23,24,25,26] (score range, 10–50, with higher scores for either positive or negative affect representing higher levels of positive or negative affect respectively). PANAS demonstrates moderate to high internal consistency [27], validity, and reliability [28]. The Pain Catastrophizing Scale (PCS) measures maladaptive cognitive and emotional processing of pain and consists of 13 items rated on a five-point scale, with a score range of 0–52. Higher scores indicate greater catastrophic thinking and emotional responses to pain [29]. Good internal reliability and test–retest reliability scores have been reported for the PCS total score [30].

After surgery, the modified BPI was administered over the phone to assess pain related to the surgical site, pain medication use, and pain interference. We assessed the modified BPI daily for 3 months, weekly thereafter up to 6 months, and monthly thereafter up to 1 year after surgery. For trajectories of pain and opioid use, calls continued until patients had 5 consecutive days of no opioid use and 5 consecutive days of 0 out of 10 average pain at their surgical site. The NIH PROMIS measures (depression, anxiety, and anger), BDI-II, PANAS, and PCS were administered via weekly web-based surveys up to 6 months, then monthly thereafter up to 1 year after surgery.

Primary Outcomes

The primary outcome was defined as time to opioid cessation. This was defined as the first of five days of zero opioid use per prior research [7, 8, 14]. The secondary outcome was time to pain cessation, defined as the first of 5 consecutive days of 0 out of 10 average pain [7, 8, 14].

Statistical Analyses

A sample size estimation was performed in 2013. Assuming a baseline hazard rate of 1.47 from prior research [31], and accounting for stratification by operation type, a final sample size of 177 participants was calculated to achieve 80% statistical power to detect a hazard ratio (HR) for time to opioid cessation of 0.53 (assuming proportional hazards), at a significance level of 0.05.

We determined baseline characteristics for the entire cohort. We presented preoperative categorical variables as numbers (percentages). Continuous variables were presented as mean (standard deviation) or median (interquartile range).

To assess the association of pre- and postoperative variables with time to opioid and pain cessation events, we constructed Cox regression models with time-varying covariates (a [start, stop] counting process model) to estimate hazard ratios (HR) and 95% confidence intervals (95% CI) and to adjust for potential confounders (see https://cran.r-project.org/web/packages/survival/vignettes/timedep.pdf).

As postoperative assessments were not collected with the same frequency (e.g., postoperative daily modified BPI vs. weekly NIH PROMIS measures), the date of actual assessment completion was used to determine the time interval for the assessment since the date of the operation for each time-varying covariate. For imputation limited to postoperative time-varying covariates: NIH PROMIS measures, BDI-II, PANAS, and PCS, scores were only carried forward to the next survey date, if assessed in the preceding 30 days.

The model selection procedure occurred in two steps. First, to examine preoperative covariates previously reported to influence the dependent outcomes, and second to add the novel time-varying covariates to examine all perioperative covariates. The final p values presented from these analyses do not adjust for the multiple models examined during this stepwise modeling process. Thus, we considered these analyses exploratory as a first look to identify significant baseline and time-varying longitudinal postoperative factors associated with the outcomes. We stratified all regression models by type of operation. For the multivariable model building process first examining preoperative determinants of opioid cessation, candidates included age, gender, race, ethnicity, income, baseline average pain at the future surgical site, preoperative daily OME use, and preoperative psychological assessments (BDI-II score, PROMIS depression, anger, and anxiety scores, PANAS scores, and PSC score). Inclusion in the final multivariable model was determined with the use of the Akaike information criterion (AIC) to quantify overall model fit. AIC is a measure of goodness of fit of an estimated statistical model [32]. Operationally, AIC is a statistical measure for comparative evaluation among time series models balancing the complexity of the estimated model against how well the model fit the data [32]. The model with the minimum AIC value was chosen to assure the balance of goodness of fit and complexity [33]. Sensitivity analyses were conducted to rule out the influence of the model selection process. Automated forward, backward, and stepwise model building algorithms were assessed via AIC scores for optimal model fit. In the second step, to construct the multivariable model examining pre-and postoperative determinants of opioid cessation, candidates included those previously identified in the first step: preoperative daily OME use, gender, and preoperative PROMIS anxiety and depression scores. Additional candidates included postoperative time-varying: NIH PROMIS measures (depression, anxiety, and anger), BDI-II, PANAS scores, PCS, and postoperative average pain score. Inclusion in the final multivariable model was similarly determined with the use of AIC to quantify overall model fit with sensitivity analyses conducted to rule out the influence of the model selection process. As additional sensitivity analyses, this second step analysis was conducted in the subgroup of preoperative opioid naïve participants. Similarly, for the multivariable model building process first examining preoperative determinants of pain cessation, candidates included: age, gender, race, ethnicity, income, baseline average pain at the future surgical site, preoperative daily OME use, and preoperative psychological assessments (BDI-II score, PROMIS depression, anger, and anxiety scores, PANAS scores, and PSC score). For the second step, to construct the multivariable model examining pre- and postoperative determinants of pain cessation, candidates included those previously identified in the first step: age, gender, income, preoperative PROMIS anxiety score, preoperative PCS score, and preoperative daily OME use. Additional candidates included postoperative time-varying: NIH PROMIS measures (depression, anxiety, and anger), BDI-II, PANAS scores, PCS, and postoperative daily OME use. The proportional hazards assumption, and confirmation of non-violation, was tested by linear regression testing the association of Schoenfeld residuals with time. Relevant covariates in the final models were examined with time interaction terms. Linearity assumptions of continuous covariates in the final multivariable models were tested by examining the plot of martingale residuals and cumulative sums of martingale residuals as a function of each continuous covariate, and the supremum test. All analyses were conducted using R version 4. A two-sided p value < 0.05 was considered statistically significant.

Results

We screened 444 patients for eligibility between April 25, 2014 and May 1, 2018 (Fig. 1). Of the 68 participants who did not meet enrollment criteria, the majority were already enrolled in other clinical trials precluding study participation. Of the 303 participants who enrolled in the study, we excluded 84 participants from postoperative follow-up. Most of these excluded participants did not complete the preoperative assessments for several reasons, including canceled or rescheduled operations. Of the 219 participants eligible for postoperative follow-up, we withdrew 31 participants for not completing postoperative assessments.

Fig. 1
figure 1

Flow of study participation. Abbreviations: BDI-II, Beck Depression Inventory-II

Of the 188 patients included in the analysis, mean (SD) age was 64.2 (9.5) years; 98 (52.1%) were women and 90 (47.9%) were men. 101 (53.7%) participants underwent total knee arthroplasty and 87 (46.3%) underwent total hip arthroplasty. Preoperative characteristics are shown in Table 1. Participants reported moderate preoperative pain at the planned surgical site. Mean (SD) of average pain on the Numeric Rating Scale of Pain (NRS) was 4.2 (2.2). While the majority of participants were not taking opioids before surgery, preoperative daily oral morphine equivalent (OME) use of over 200 mg was reported by a few participants. BDI-II and NIH PROMIS Depression scores were concordant, with minimal preoperative depressive symptoms reported. Participants reported slightly higher levels of anxiety and lower levels of anger before surgery. Similarly, patients reported relatively higher levels of positive compared to negative affect. Although patients reported moderate levels of preoperative pain, levels of pain catastrophizing were minimal.

Table 1 Preoperative clinical characteristics of surgical cohort (N = 188)

One hundred and twenty-seven (67.5%) of patients reached postoperative opioid cessation. Of the remaining 61 patients who did not reach postoperative opioid cessation, 14 (23.0%) were censored after 1 year of postoperative follow-up, 11 (18.0%) were censored due to a second surgery, and 3 (4.9%) were censored after experiencing a fracture from a fall. Supplementary Fig. 1 depicts the number of patients continuing opioid use at any given time after surgery. 97 (51.6%) of patients reached postoperative pain cessation. Of the remaining 91 patients who did not reach postoperative pain cessation, 34 (37.4%) were censored after 1 year of postoperative follow-up, 15 (16.5%) were censored due to a second surgery, 3 (3.3%) were censored after experiencing a fracture from a fall, and 1(1.1%) was censored due to a postoperative blood clot. Supplementary Fig. 2 depicts the number of patients continuing to report pain at any given time after surgery. Out of a total of 1780 postoperative time-varying covariate assessments, the number of missing assessments ranged from 3 (0.2%) to 25 (1.4%), see Supplementary Table 2.

The median time to opioid cessation was 54 days (95% CI 43–67 days). The median time to pain cessation was much more prolonged at 152 days (95% CI 118–271 days). In the preoperative multivariable model for time to opioid cessation (Table 2), every 1-mg increase in preoperative total daily oral morphine equivalent (OME) use was associated with a 1% reduction in the rate of opioid cessation (p value = 0.02). Female gender was associated with a 51% increased rate of postoperative opioid cessation (p value -0.04). No other psychosocial factors were associated with the outcome. In contrast, when simultaneously examining both preoperative factors and time-varying postoperative factors of time to opioid cessation, only preoperative total daily OME use remained a preoperative risk factor for delayed postoperative opioid cessation (Table 3). Every 1-mg increase in preoperative total daily OME use was associated with a 3% reduction in the rate of opioid cessation (p value < 0.0001). For reference, a 15-mg increase in total daily OME use (the difference between the 75th and 25th percentile in our cohort) would be associated with a 45% reduction in the rate of opioid cessation. In addition, on any given day, every one-point increase in the time-varying postoperative average pain score was associated with an 18% reduction in the rate of opioid cessation (p value-0.002). The final model was adjusted for time-varying depression scores, but postoperative depressive symptoms were not independently associated with postoperative opioid cessation.

Table 2 Preoperative determinants of opioid cessation
Table 3 Pre- and postoperative determinants of opioid cessation

We conducted additional subgroup analysis to examine the time to opioid cessation among those who were opioid naïve prior to surgery. Among the preoperative opioid naïve patients (Supplementary Table 3), on any given day, every one-point increase in the time-varying postoperative average pain score was similarly associated with a 25% reduction in the rate of opioid cessation (p value < 0.001). Post hoc we conducted additional analyses to determine the effect of any postoperative long-acting opioid on outcomes, and did not find a significant association (See Supplement).

In the preoperative multivariable model for time to pain cessation (Table 4), every one-point increase in the NIH PROMIS anxiety T-score was associated with a 5% reduction in the rate of postoperative pain cessation (p value = 0.003). Female sex was associated with a 77% increased rate of pain cessation (p value = 0.03). Every one-point increase in the preoperative PCS score was associated with a 3% increase in the rate of pain cessation (p value = 0.04). Subsequent analysis examining both preoperative factors and time-varying postoperative factors (Table 5) demonstrated the significance of time-varying postoperative factors. Every one-point increase in the weekly postoperative NIH PROMIS depression T-score was associated with an 8% reduction in the rate of pain cessation (p value = 0.01). Every one-point increase in the weekly postoperative PCS score was associated with a 15% reduction in the rate of pain cessation (p value = 0.02). Daily postoperative opioid use, measured as OME, was significantly associated with a reduction in the rate of pain cessation. Every 1-mg increase in the daily OME use was associated with a 3% reduction in the rate of pain cessation (p value = 0.03). The final multivariable model was adjusted for postoperative time-varying NIH PROMIS anger and anxiety scores as well as preoperative daily oral morphine equivalent use and PCS score.

Table 4 Preoperative determinants of pain cessation
Table 5 Pre- and postoperative determinants of pain cessation

Discussion

In this prospective, single-center study, we identified preoperative patient characteristics and postoperative changes in psychological distress as risk factors for persistent opioid use and pain after total joint replacement.

Preoperative opioid use was a significantly associated with continued opioid use after surgery. This finding aligns with prior research reporting risk factors for PPOU [5, 34,35,36,37,38]. We extend these findings by simultaneously examining prospective, longitudinal postoperative pain, opioid use, and mood assessments. As patients with preoperative opioid use undergoing total joint arthroplasty are also at increased risk for surgical revision [39], adverse events, and emergency department visits after surgery, they represent a particularly vulnerable subgroup [40, 41]. Our findings emphasize the importance of screening for preoperative opioid use to identify the patients at highest risk for delayed postoperative opioid cessation.

Elevated postoperative pain was also an independent risk factor for delayed opioid cessation. At any time after surgery, a three-point increase in the average pain score was associated with a 54% reduction in the rate of postoperative opioid cessation. Pain scores can be quickly assessed during postoperative phone calls, and timely interventions to influence opioid use trajectories could be implemented after such simple screening. Pain intensity over the first seven postoperative days is predictive of pain 1 year after total knee arthroplasty [42]. The correlation between the acute pain trajectory (i.e., over the first seven postoperative days) and acute OME use during the first postoperative week has also been reported [43], as well as the association of pain intensity on postoperative day 10 with time to opioid cessation [7]. We now extend these findings by characterizing increased risk of delayed postoperative opioid cessation independently associated with elevated pain intensity at any time after surgery. Thus, screening may be further simplified by incorporating pain assessments into existing clinical workflows at any time after surgery.

In the preoperative models, female gender was surprisingly associated with a reduced time to opioid and pain cessation. Prior research highlights gender disparities in opioid prescribing after total joint arthroplasty. In a retrospective population-based study, women had a higher odds of receiving longer term opioid prescriptions than men, yet men were prescribed more opioids at discharge after total joint arthroplasty [44]. Our findings highlight possible discrepancies between opioid prescribing and actual opioid consumption. As our study assessed daily OME use every 24 h and every 7 days, we were able to capture changes in opioid consumption more accurately. Future prospective research comparing outcomes based on patient report and opioid prescribing is needed to determine comparability in assessments, which may have important implications in identifying risk factors for delayed opioid cessation. Another possibility is that males in our study may have received higher discharge opioid prescriptions which delayed opioid cessation. In a meta-analysis of observational studies examining predictors of PPSP following TKA, the authors determined there was moderate certainty evidence of female sex as a risk factor with a 7% absolute risk increase [11]. However, in the same study, higher certainty evidence demonstrated moderate-to-severe acute postoperative pain (defined as ≥ 4/10 on a ten-point scale) as a risk factor for PPSP with a 30% absolute risk increase [11]. We similarly demonstrate that time-varying postoperative average pain is a significant risk factor in the perioperative model of delayed pain resolution. It is important to point out that our study examined the rate of postoperative pain cessation while this meta-analysis defined PPSP as a binary continuation of pain at ≥ 3 months after surgery, which may have led to a discrepancy in research findings [11]. Future research is needed to understand the impact of gender on the risk of delayed postoperative opioid and pain cessation.

In addition, we characterized risk factors associated with postoperative pain resolution. When limited to examination of preoperative patient characteristics, elevated anxiety symptoms were associated with an increased risk of delayed postoperative pain resolution. Among patients undergoing total joint arthroplasty, untreated preoperative generalized anxiety disorder and anxiety symptoms are associated with worse postoperative pain [45, 46]. Our concordant findings emphasize the importance of preoperative mood assessment in risk stratification for delayed postoperative pain cessation.

Contrary to past research [47], we found that elevation in preoperative PCS score was associated with an increased rate of postoperative pain resolution during preoperative risk stratification. Given that the baseline degree of pain catastrophizing was minimal in our surgical cohort, and much lower than previously reported [48], this association may be capturing transient, minimal, elevations in pain catastrophizing that rapidly resolve in response to surgery. Much higher mean levels of preoperative pain catastrophizing (e.g., ≥ 30 vs. 10.6 in our cohort) have been associated with chronic postoperative pain.[47]

With the addition of time-varying postoperative factors, our findings demonstrated that postoperative elevation in pain catastrophizing at any time is independently associated with delayed pain resolution. Prior research demonstrates rapidly remitting pain catastrophizing symptoms in the first postoperative month to 6 weeks after surgery are associated with faster reductions in pain intensity [49, 50]. Our research further includes patients with preoperative opioid use and concurrently longitudinally examines depression, anxiety, and anger symptoms in addition to pain catastrophizing. These findings emphasize the need for ongoing postoperative screening for pain catastrophizing as risk profiles are likely to evolve in response to surgery.

Postoperative elevation in depressive symptoms at any time was also independently associated with delayed pain resolution. A minimally important T-score increase of three points [51] for the NIH PROMIS depression score at any time after surgery was associated with a 24% reduction in the rate of postoperative pain cessation. Although prior research has reported the association of preoperative depression with persistent pain after surgery [52, 53], preoperative depressive symptoms in our cohort were not associated with delayed postoperative pain resolution. Similar to our findings, both preoperative anxiety and depression had no significant direct effects on chronic pain 6 months after surgery in other cohorts [54]. Our surgical cohort presented with reduced depressive symptoms compared to the general population, which may have influenced our findings. In a cohort of 254 patients, preoperative depressive symptoms and trajectories were not associated with postoperative pain over a 3-year period [55]. Contrary to our findings, the authors reported stable pre to postoperative depressive symptoms that were essentially unchanged in response to surgery [55]. However, this difference in findings is likely secondary to the granularity in our assessments in the subacute phase. While Riddle et al. conducted yearly postoperative depression assessments, we conducted weekly depressive assessments to allow intimate characterization of the association between postoperative depressive symptoms and pain. Research has reported dynamic postoperative improvements in depressive symptoms after total joint arthroplasty in the first 6 months. Thus, patients with elevated depressive symptoms after surgery may represent a subgroup vulnerable to the development of persistent postoperative pain [52]. We have expanded upon these findings by characterizing the extended association of elevations in depressed mood at any time after surgery with delayed postoperative pain resolution.

Increased postoperative opioid use at any time was associated with delayed pain resolution in our cohort indicating postoperative opioid use was concordant with the prescribed purpose. A recent systematic review highlights that only 1% (four of 324 studies including randomized trials, case–control studies, and prospective cohort studies) of patients undergoing TKA for osteoarthritis in the past 15 years reported any measure related to prescription opioid use before or after surgery [56]. Given the paucity of data, the authors were unable to determine the prevalence of chronic opioid use or duration of opioid use after surgery. Our study adds important insight into the duration of postoperative opioid use after TKA or THA. We previously reported a trial of patients undergoing TKA or THA randomized to motivational interviewing and guided opioid tapering support vs. usual care [8]. The median time to opioid cessation among patients receiving usual care in the trial was 34 days rather than 52 days as reported in our cohort. This difference may relate to the higher percentage of preoperative opioid users in our cohort (37.8 vs. 23.6%) compared to the prior trial [8]. Nonetheless, consistent with prior research [7], a higher percentage of patients reach definitive opioid cessation compared to pain resolution, and opioid cessation occurs much sooner than pain resolution. Thus, optimizing perioperative pain management and preventing PPSP remains a priority and clinical challenge.

The strengths of our study include the prospective, repeated, data collection of covariates and outcomes. Evaluation of time-varying changes in postoperative factors allowed for more detailed characterization of the associations between variables and outcomes during postoperative recovery, which has not been previously reported. Simultaneous examination of postoperative pain and opioid use further delineates distinct factors associated with each outcome, which can inform the development of future interventions to curb these outcomes.

Our study has several limitations. Before surgery, our cohort reported less emotional distress and minimal pain catastrophizing compared to other orthopedic surgery cohorts, which may limit our study findings' generalizability. Given the observational design, causality between time-varying covariates and outcomes cannot be established. Due to stepwise regression, findings should be interpreted carefully, and the p values may not have the same valence as those reported in confirmatory analyses [57]. However, we identified new trends underscoring the relative importance of time-varying postoperative factors in developing persistent postsurgical pain and opioid use warranting replication in larger surgical cohorts. Future research is needed to replicate these findings with additional prespecified subgroup analyses to determine the interaction of these factors with gender and preoperative opioid use.

Conclusions

Overall, preoperative opioid use was independently associated with persistent opioid use after surgery along with increased postoperative pain intensity at any time, in patients undergoing total joint replacement. In contrast, elevations in postoperative pain catastrophizing and depressive symptoms, and increased postoperative opioid consumption at any time were independently associated with delayed postoperative pain resolution. Repeated risk stratification before and after surgery is necessary to identify patients most likely to develop delayed pain and opioid cessation after total joint arthroplasty. Our findings provide a rationale for the development of targeted interventions pre-surgery to curb persistent opioid use, and post-surgery psychotherapeutic interventions to curb the development of persistent postoperative pain.