*2.3. Procedure*

The data used in the present study belong to the EHR of the Information System of the Andalusian Plan on Drugs (SiPASDA). The EHR begins by recording information corresponding to the variables of the Treatment Demand Indicator (TDI) Standard Protocol 3.0 of the European Monitoring Centre for Drugs and Drug Addiction [42]. The TDI provides basic information on sociodemographic variables, drug use history, previous treatments, and infectious diseases at the start of treatment. In addition, clinical data collected during the periodic appointments that patients attend (with physicians, psychologists, nurses, and social workers) are incorporated into the clinical history of each patient. In these appointments, each team member (physicians, psychologists, nurses, and social workers) inputs the relevant patient information into the EHR. This information includes the diagnosis of the patients according to ICD-10 criteria, prescribed pharmacological treatments, psychological evaluation and treatments, results of toxicological tests, social status of the patient, and evolution of treatment. All this information is stored in a centralized database, and therapists can access the information at any time. Previous research conducted with this same data set has shown good reliability values [43].

Due to the pandemic, most of the Andalusian centers used telephones as the main channel for treatment admissions and follow-up. Critically ill patients received face-to-face care from professionals, while telephone services have been maintained for patient followup after the confinement period. The requests are recorded by health professionals in the Electronic Health Record (EHR).

#### *2.4. Ethics and Approvals*

This research has been approved by the Research Ethics Committee of the Andalusian Ministry of Health, who certified compliance with the requirements for the ethical handling of the information.

To access the EHRs, the researchers made a request to the General Secretary of Social Services of the Department of Equality and Social Policies of the Regional Government of Andalusia (Spain). Patients gave their authorization so the information could be registered in the system. The database is fully anonymized for both patients and professionals, so it is not possible to inform the participants about the study. The storage and encoding of this data comply with the General Health Law of 25 April 1986 (Spain) and Law 41/2002 of 14 November on patient autonomy, rights, and obligations regarding clinical information and documentation. It also complies with the Organic Law 3/2018 of 5 December 2018, regarding the protection of personal data and the assurance of digital rights, adapted to European regulations.

#### *2.5. Statistical Analysis*

The three groups were compared using nonparametric analyses, given the differences in sample size between the confinement group and the pre- and post-confinement groups.

The differences between qualitative variables were analyzed using Pearson's chisquare test, and Cramer's V statistic was used to calculate effect sizes. Quantitative variables were analyzed with the Kruskal–Wallis test, using the epsilon-squared test to calculate effect sizes.

Analyses were conducted using IBM SPSS Statistics software version 27 (Chicago, IL, USA).
