Here is the design of a clinical trial:

Official Title: ED to EPI: Using SMS (Text) Messaging to Improve the Transition from the Emergency Department to Early Psychosis Intervention for Young People with Psychosis

Included conditions:
- First Episode Psychosis
- Psychosis
- Psychotic Episode
- Psychoses, Affective
- Bipolar Disorder
- Depressive Psychosis
- Schizoaffective Disorder
- Schizophreniform Disorders
- Schizophrenia
- Schizophrenia Spectrum and Other Psychotic Disorders
- Substance Induced Psychoses

Study Armgroups:
- {'label': 'Active SMS Intervention', 'type': 'EXPERIMENTAL', 'description': 'Participants assigned to the experimental arm will receive the active SMS intervention. Participants in the active intervention group who consent to participate will be asked to complete a web-based survey. Based on survey findings, purposive sampling will be used to select a subsample of 12 to 20 participants for qualitative interviews.', 'interventionNames': ['Behavioral: Active SMS Intervention']}
- {'label': 'Sham SMS', 'type': 'SHAM_COMPARATOR', 'description': 'Participants assigned to the sham comparator will receive the sham SMS intervention. They will not be re-contacted.', 'interventionNames': ['Behavioral: Sham SMS']}

Interventions:
- {'type': 'BEHAVIORAL', 'name': 'Active SMS Intervention', 'description': "Welcome message letting participant know they will be contacted to book an appointment, followed by appointment reminders and other clinic information, psychoeducational materials, and a distress check-in with two-way feedback to their care team, all sent by SMS/text message at the participant's preferred time of day. If they indicate that they are in high distress, or they request, their care provider will be notified and asked to reach out to them. They will also receive crisis resources.The intervention will continue until the patient attends the first consultation appointment, or for up to 30 days if the patient does not attend, which reflects the program's practice of closing referrals for non-attending patients.", 'armGroupLabels': ['Active SMS Intervention']}
- {'type': 'BEHAVIORAL', 'name': 'Sham SMS', 'description': 'Single welcome message letting participant know they will be contacted to book an appointment.', 'armGroupLabels': ['Sham SMS']}

Primary Outcomes:
- {'measure': 'Attendance at the first early psychosis intervention (EPI) consultation appointment', 'description': 'Attendance at the outpatient EPI consultation appointment will be assessed through chart reviews and categorized as: Yes - attended at original appointment time, Yes - attended at later date within 30 days, No - did not attend appointment within 30 days.', 'timeFrame': '30 days'}

Please estimate the sample size based on the assumption: 
The study is designed to have >80% power with a significance level of alpha <0.05. Non-compliance and loss to follow-up are not a concern as they are counted as non-attendance.
Sample size
        Our sample size calculations are based on the primary outcome of rate of attendance at the EPI programme consultation appointment. The current rate of attendance at the first consultation appointment for patients referred from the ED and Bridging Clinic is 50%; we have powered our study to detect the treatment effect with an anticipated rate of attendance of 70%, which is the average for all referral sources other than the ED and Bridging Clinic. A total of 186 participants (93 per group) will provide >80% power to detect a change in attendance from 50% to 70% at alpha <0.05. Non-compliance and loss to follow-up are not a concern for our primary outcome since these are counted in the outcome as non-attendance at the consultation. Adjusting analyses for covariates expected to affect attendance (eg, age, sex) is expected to further increase power.