Here is the design of a clinical trial:

Official Title: Smartphone-based Ecological Momentary Intervention for Secondary Prevention of Suicidal Thoughts and Behavior: a Randomised Clinical Trial

Included conditions:
- Suicide

Study Armgroups:
- {'label': 'Control group', 'type': 'NO_INTERVENTION', 'description': 'The control group will be monitored using smartphone-based active and passive Ecological Momentary Assessment through the MEmind and eB2 mobile applications, and will receive treatment as usual, which will consist of psychiatric follow-up (scheduled appointments with their psychiatrist) in an outpatient Secondary Suicide Prevention Programme, with predetermined clinical reviews according to the Brief Intervention Contact recommendations (1, 2, 4, 7 and 11 weeks, and 4, 6, 9 and 12 months)'}
- {'label': 'Intervention group', 'type': 'EXPERIMENTAL', 'description': 'The intervention group will receive an Ecological Momentary Intervention called SmartSafe, will be monitored using smartphone-based active and passive Ecological Momentary Assessment through the MEmind and eB2 mobile applications, and their treatment as usual, which will consist of psychiatric follow-up (scheduled appointments with their psychiatrist) in an outpatient Secondary Suicide Prevention Programme, with predetermined clinical reviews according to the Brief Intervention Contact recommendations (1, 2, 4, 7 and 11 weeks, and 4, 6, 9 and 12 months)', 'interventionNames': ['Device: SmartSafe']}

Interventions:
- {'type': 'DEVICE', 'name': 'SmartSafe', 'description': 'The SmartSafe Ecological Momentary Intervention is contained in the MEmind smartphone application and consists of a Safety plan, an Enhanced contact via app (app-EC) intervention, and a "mental toolbox". The Safety plan is a set of personalized coping strategies that the patient can use in a suicidal crisis. Our safety plan was adapted to a digital environment, including the possibility to activate pre-recorded messages, lead to websites with health resources, or put the patient in contact with the emergency services. The Enhanced contact via app (app-EC) intervention is inspired by the SIAM project and consists in messages that will be sent via the MEmind app inquiring patients about their mental well-being and informing them of the means to request preferential or urgent care. The mental toolbox contains videos relaxation techniques videos and behavioral activation and mentalization exercises.', 'armGroupLabels': ['Intervention group'], 'otherNames': ['The SmartSafe Ecological Momentary Intervention']}

Primary Outcomes:
- {'measure': 'Reduction of suicidal ideation', 'description': 'Our primary outcome will be reduction of suicidal ideation, measured at follow-up using the Columbia Suicide Severity Rating Scale', 'timeFrame': '6 months'}
- {'measure': 'Reduction of suicidal ideation', 'description': 'Our primary outcome will be reduction of suicidal ideation, measured at follow-up using the Columbia Suicide Severity Rating Scale', 'timeFrame': '1 year'}

Please estimate the sample size based on the assumption: 
Alpha error set at 5%, power at 80%, dropout rate of 20%, and randomisation imbalance of 10%
Sample size calculation
        Sample size calculation was performed using G*Power software, V.3.1. Based on previous clinical trials exploring the ability of interventions to reduce SI in the mid-term,36 we estimated a target sample size enough to have 80% power to detect between-group differences of 6â7 points on the SI subscale of the CSSRS35 (25% decrease in the intensity of SI in the intervention group). The alpha error was set at 5% and the power at 80%. We assumed a dropout rate of 20% and a randomisation imbalance of 10%. With these settings, we estimated that we needed a total of 220 participants, 110 in each arm.