**2. Methods**

## *2.1. Data Sources*

National Veterans Affairs (VA) administrative data from the VA Corporate Data Warehouse were used for this study. The presence of mental health and other medical comorbidities were determined using international classification of disease (ICD) codes from inpatient and outpatient encounters. Drug exposure was assessed using outpatient pharmacy dispensing data. The current study is an operations-supported quality improvement project determined not to constitute human subjects research by the local Institutional Review Board.

#### *2.2. Patients*

Veterans with PTSD were identified using ICD-9 and ICD-10 codes (309.81 and F43.1X) from inpatient and outpatient encounters. Patients were required to have at least one inpatient hospitalization coded for PTSD during 2020, or at least one PTSD-coded outpatient encounter during 2020 and a second PTSD-coded encounter within the past 730 days [23,24].

## *2.3. Outcomes*

Exposure to two groups of medications was assessed. First, medications with CNS activity were identified using VA drug classification, as defined by Collett and colleagues [17,19]. Second, a subset of these medications typically used for psychiatric indications was examined, and was limited to antidepressants, antipsychotics, anticonvulsants, benzodiazepines, z-drug hypnotics, stimulants, and lithium (Supplemental Table S1). Three specific medications from these classes, gabapentin, topiramate, and duloxetine, were not considered in the psychiatric medication subset, as these agents are commonly used for the management of pain.

Drug exposure was assessed during the calendar year 2021, the year following patient selection, to ensure that diagnoses of PTSD and chronic pain preceded the outcome. The outcome measure for Aim 1 was the number of changes in psychiatric medication during the observation year. This was assessed by determining which psychiatric medications were active on the first day of the observation year, which were active on the last day of the observation year, and other psychiatric medications dispensed throughout the observation year. Medications present in the baseline regimen, but not in the follow-up regimen, were considered discontinued and counted as one change. Conversely, medications present at follow-up but not at baseline were considered new medications and counted as one change. Medications dispensed during the year, but not present in either regimen, were considered to have been started and then stopped and counted as two changes. The outcome measure for Aim 2 was the maximum number of CNS-active medications received concurrently at any point during the observation year, using previously established methodology [17]. Both outcome measures relied on longitudinal prescription histories, where medications were considered active on any given day during this period based on cabinet supply methodology [17,25]. Briefly, this approach estimates the day's supply on hand for each calendar day during a specified time interval, with adjustments for carrying forward oversupply for early refills and allowable nonadherence.

#### *2.4. Analysis*

The focus of the analysis was to determine whether the presence or absence of chronic pain was associated with two clinically relevant measures of drug exposure including (1) the number of psychiatric medication changes and (2) the maximum number of concurrent CNS-active medications over a one-year observation period. As both outcome measures were discrete counts with low frequencies and not expected to be normally distributed, bivariate associations with chronic pain were examined using the nonparametric Wilcoxon rank sum test. Chronic pain was identified using Tian's criteria [26], modified to include ICD-10 codes [27]. To meet criteria for chronic pain, patients were required to meet one of the following 3 criteria: 2 outpatient encounters separated by ≥30 days with a diagnosis code likely indicating chronic pain; at least 1 encounter coded with a diagnosis likely indicating chronic pain and at least 2 numeric pain rating scales ≥4; or long-term opioid use (>90 days) [26–28].

Negative binomial regression was then used to adjust the relationship between chronic pain and the outcome for potential confounders, including demographics, medical comorbidity using the Charlson index [29], a dichotomous indicator for any inpatient hospitalization during 2020, and psychiatric comorbidities [30]. Regression models involving the count of psychiatric medication changes were further adjusted for the number of psychiatric medications at baseline and whether an opioid or other pain medication was present at baseline. These variables were not included in models involving the number of concurrent CNS-active medications as they are intrinsically part of the outcome measure. A sensitivity analysis was conducted using the same patient selection criteria and outcome definitions but applied to Veterans with PTSD during the calendar year 2012. The purpose of the sensitivity analysis was to determine whether any relationships observed in the primary analysis were stable over time or had changed along with known changes in VA prescription patterns over this period, such as decreases in opioid and benzodiazepine prescription [31,32].
