Here is the design of a clinical trial:

Official Title: Enhanced Recovery After Surgery (ERAS) Pathway for Primary Hip and Knee Arthroplasty: a Prospective, Controlled, Randomized Clinical Trial

Included conditions:
- Arthroplasty, Replacement, Hip, Knee

Study Armgroups:
- {'label': 'The ERAS group', 'type': 'EXPERIMENTAL', 'description': 'Patients will be treated with the ERAS pathway', 'interventionNames': ['Procedure: The ERAS group']}
- {'label': 'The non-ERAS group', 'type': 'OTHER', 'description': 'Patients undergoing THA or TKA will receive conventional care.', 'interventionNames': ['Procedure: The non-ERAS group']}

Interventions:
- {'type': 'PROCEDURE', 'name': 'The ERAS group', 'description': 'ERAS pathway for orthopedic surgeons:\n\n1. Shortened preoperative fasting from intake.\n2. Preoperative tranexamic acid administration.\n3. No indwelling catheters.\n4. No tourniquet used for TKA.\n5. No drainage tube.\n6. Application of the low molecular heparin 6 hours after the operation.\n\nERAS pathway for anesthesiologist:\n\n1. Intravenous 20 mg of dexamethasone before anesthetic induction.\n2. Anesthesia will be induced with small dose of long-acting opioids such as sulfentanil, or without long-acting opioids at all.\n3. Laryngeal mask for airway.\n4. Anesthesia will be maintained with short-acting anesthetic agents such as desflurane, sevoflurane, or propofol, with continuous remifentanil , and BIS value will be kept between 40 to 60 during procedure.\n5. Incision infiltration with 40-50ml of 0.2% ropivacaine, and no patient controlled intravenous analgesia devices will be applied.', 'armGroupLabels': ['The ERAS group']}
- {'type': 'PROCEDURE', 'name': 'The non-ERAS group', 'description': "Patients undergoing THA or TKA will receive conventional care according to different participating center, and there's no standard protocol for pre-operative management, anesthetic technique or medication choice, postoperative analgesia or food intake, or catheters indwelling.", 'armGroupLabels': ['The non-ERAS group']}

Primary Outcomes:
- {'measure': 'Length of stay (LOS) in hospital', 'description': 'Time from the day on arrival at hospital to discharge from the hospital (unit: days).', 'timeFrame': '30 days'}

Please estimate the sample size based on the assumption: 
A 5% significance level, a power of 0.90, and a 20% dropout rate.
Sample size calculation
        Our primary hypothesis is that the application of the ERAS pathway would reduce the LOS in hospital when compared to the current non-ERAS practice in total joint arthroplasty (TJA). According to retrospective analysis of LOS of in hospital of TJA in 2014 (when the ERAS pathway was just proposed) and 2016 (when the ERAS pathway was applied in about 50% of patients) in the Department of Orthopedics, West China Hospital of Sichuan University, the mean LOS of THA was 10âÂ±â1.5âdays in 2014 and 8.6âÂ±â1.1âdays in 2016; the mean LOS of TKA was 12.1âÂ±â2.1âdays in 2014 and 8.9âÂ±â1.5âdays in 2017. For THA, assuming the difference between the two groups was a 5% significance level and a power of 0.90, 17 patients in each group are required; for TKA, assuming the difference between two groups was a 5% significance level and a power of 0.90, only seven patients in each group are required for a comparison within the group. Considering an estimated 20% dropout rate, there should be 42 patients in each group for THA and 20 patients in each group for TKA; a total of 62 patients are required for this study [10]. For a better application of the ERAS pathway for orthopedic surgeons and anesthesiologists, we increased the sample size to 160 individuals in each group for THA and TKA, and a total of 640 individuals will be included. We plan to enroll 320 patients undergoing TKA to participate in this trial in the first stage and enroll 320 patients undergoing THA after completion. A primary comparison will be performed separately for TKA and THA.