Recruitment of endometriosis patients took place during March 2013–March 2017, and February 2022–March 2023 at the Department of Gynecology at Skåne University Hospital, Malmö, Sweden. Exclusion criteria were multiple or severe somatic or psychiatric comorbidities, and current pregnancy. During the first inclusion period, patients were identified in medical records using the International Classification of Diseases and Related Health Problems, ICD-10, N80, according to previously described criteria with laparoscopic-verified endometriosis [22]. Between 2013 and 2017, 605 patients were identified. Of those, 307 declined to participate, 72 had moved from the region, 32 had significant comorbidity, 18 had an uncertain diagnosis, and four denied the diagnosis, leaving 172 women included [18]. For this study, 32 women were excluded because of having a diagnosis of IBS, leaving 140 women analyzed for clinical data.

During the second inclusion period, the method for diagnosis was changed due to updated guidelines [8]. Patients were systematically examined by experienced endometriosis ultrasound examiners according to recommendations from the International deep endometriosis analysis (IDEA) group [23]. Those who received a diagnosis of endometriosis confirmed by transvaginal ultrasonography were asked to participate in the study. Between 2022 and 2023, 96 patients fulfilled the inclusion criteria and were asked to participate in the study. Of those, 15 declined to participate. Seven women were excluded because of having a diagnosis of IBS, leaving 74 women to be included and analyzed for clinical data. Altogether, 214 patients with endometriosis were included (Fig. 1).

Fig. 1figure 1

Flow chart of the inclusion and exclusion of patients with endometriosis. IBS, irritable bowel syndrome

Localization of endometriosis lesions were divided into isolated ovarian lesions, or involvement of one or more of bowel, peritoneum, pouch of Douglas, rectovaginal septum, sacrouterine ligaments, urine bladder, or vesicouterine pouch.

IBS patients

Recruitment of IBS patients took place during 2018–2019 and 2022–2023 from primary care centers, the Department of Gastroenterology at Skåne University Hospital, Malmö, and by advertisements on social media. The patients were recruited to participate in a dietary trial. Patients were identified from health care centers using the ICD-10, K58.0, K58.1, K58.2, K58.3, K58.8, and K58.9 and were contacted by email and telephone. During the first inclusion period, 697 patients were contacted. Of them, 145 were willing to participate. Later, 22 did not meet the inclusion criteria and 18 declined to participate, leaving 105 included. All men (n = 23) and one patient having a diagnosis of endometriosis were excluded from this study, leaving 81 women finally included [24].

During the second inclusion period, 744 patients from the health care centers were contacted. Of them, 58 were willing to participate. From social media, 218 who had received an IBS diagnosis signed up for participation. Later, 6 did not meet the inclusion criteria and 66 declined to participate. All men (n = 21) and one patient having a diagnosis of endometriosis were excluded. Only patients included before August 2023 are covered in this study, leaving 118 finally included [25]. Altogether, 199 women with IBS were finally included in the analysis (Fig. 2). Celiac disease was excluded in all IBS patients by analysis of transglutaminase antibodies.

Fig. 2figure 2

Flow chart of the inclusion and exclusion of patients with irritable bowel syndrome (IBS)

Study questionnaires

All patients answered a previously developed questionnaire addressing sociodemographic factors, lifestyle habits, medical history, pharmacological treatments, and issues related to their diagnoses [18].

Visual analog scale for irritable bowel disease

GI symptoms were estimated using the validated VAS-IBS, measuring abdominal pain, diarrhea, constipation, bloating and flatulence, vomiting and nausea, psychological well-being, and intestinal symptoms’ influence on daily life on scales from 0 to 100 mm, where 0 represents no symptoms and 100 represents severe symptoms. The item psychological well-being has been used together with the established questionnaires Experiences in Close Relationships (ECR-36), Rosenberg Self-Esteem Scale (RSES), and the Sense of Coherence (SOC-13), and the item was found to strongly correlate to positive and negative aspects of psychological well-being, anxiety in close relations, self-esteem, and coping skills [26]. The scales were inverted from the original format [21]. Reference values are available from healthy women [27].

Rome IV questionnaire

All patients with IBS answered the Rome IV questionnaire, developed to diagnose DGBI [28]. Questions 40–48 in the Swedish version were used to diagnose and classify the IBS patients. License was obtained from the Rome Foundation, Inc. (Raleigh, NC, USA).

Data categorization

BMI was categorized into 2 according to the World Health Organization (WHO) standard [29]. Education level was grouped into primary school, secondary school, or at least one year of university studies. Occupation was categorized into working, sick leave, retired, unemployed, and studying. Marital status was divided into living alone, married/partners living together, and other e.g., partners not living together or living with others than partner. Smoking was categorized into never smokers, former smokers, present irregular smokers, and regular smokers. Alcohol intake was divided into 10 standard glasses per week. Physical activity per week rendering breathlessness was categorized into never, 120 min.

Statistical analyses

The SPSS for Windows (version 28.0; IBM) statistical software package was used for statistical analyses. Fisher´s exact test was used to compare dichotomous variables in endometriosis and IBS. Binary logistic regression was used with endometriosis or IBS as dependent variable to estimate odds ratios (OR) and 95% confidence intervals (CI) for the independent variables age, BMI, education, occupation, marital status, smoking, alcohol, and physical activity. Adjusted ORs were calculated with all variables included. GI symptoms between groups were compared using generalized linear model, adjusted for age and occupation, since these parameters differed between groups in the adjusted logistic regression model. Data is presented as numbers (%), median (interquartile range [IQR]), and β or OR (95% CI). Missing data were excluded from analyses. P