Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Adaptive Trials #647

Draft
wants to merge 40 commits into
base: dev
Choose a base branch
from
Draft

feat: Adaptive Trials #647

wants to merge 40 commits into from

Conversation

johannesvedder
Copy link
Contributor

@johannesvedder johannesvedder commented Jun 26, 2024

Adaptive Trials

Screenshots

image

image

Todo

Moved to trello

@johannesvedder johannesvedder marked this pull request as draft June 27, 2024 18:24
@ibrahimozkn ibrahimozkn self-assigned this Jun 27, 2024
# Conflicts:
#	.gitignore
#	app/lib/screens/study/dashboard/task_overview_tab/task_overview.dart
#	app/lib/screens/study/onboarding/journey_overview.dart
#	app/lib/screens/study/onboarding/study_overview.dart
#	app/lib/screens/study/tasks/observation/questionnaire_task_widget.dart
#	app/lib/screens/study/tasks/task_screen.dart
#	app/lib/widgets/intervention_card.dart
#	app/lib/widgets/questionnaire/question_container.dart
#	app/lib/widgets/questionnaire/questionnaire_widget.dart
#	app/lib/widgets/questionnaire/scale_question_widget.dart
#	app/macos/Runner.xcodeproj/project.pbxproj
#	app/pubspec.lock
#	app/pubspec.yaml
#	core/lib/src/models/questionnaire/answer.dart
#	core/lib/src/models/tables/study.dart
#	core/lib/src/models/tables/study_subject.dart
#	core/pubspec.lock
#	core/pubspec.yaml
#	designer_v2/ios/Flutter/AppFrameworkInfo.plist
#	designer_v2/ios/Podfile
#	designer_v2/ios/Runner.xcodeproj/project.pbxproj
#	designer_v2/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
#	designer_v2/ios/Runner/Info.plist
#	designer_v2/lib/features/design/interventions/interventions_form_data.dart
#	designer_v2/lib/features/design/interventions/mp23_interventions_form_controller.dart
#	designer_v2/lib/features/design/interventions/mp23_interventions_form_view.dart
#	designer_v2/lib/features/design/interventions/study_schedule_form_controller_mixin.dart
#	designer_v2/lib/features/design/interventions/study_schedule_form_data.dart
#	designer_v2/lib/features/design/interventions/study_schedule_form_view.dart
#	designer_v2/lib/features/design/shared/questionnaire/question/question_form_data.dart
#	designer_v2/lib/features/design/study_form_controller.dart
#	designer_v2/lib/features/design/study_form_providers.dart
#	designer_v2/lib/features/forms/form_view_model.dart
#	designer_v2/lib/routing/router_config.dart
#	designer_v2/macos/Runner.xcworkspace/contents.xcworkspacedata
#	designer_v2/pubspec.lock
#	designer_v2/pubspec.yaml
#	docs/uml/app/lib/screens/study/dashboard/task_overview_tab/uml.svg
#	docs/uml/app/lib/screens/study/dashboard/uml.svg
#	docs/uml/app/lib/screens/study/onboarding/uml.svg
#	docs/uml/app/lib/screens/study/uml.svg
#	docs/uml/app/lib/screens/uml.svg
#	docs/uml/app/lib/uml.svg
#	docs/uml/app/lib/util/uml.svg
#	docs/uml/app/lib/widgets/questionnaire/uml.svg
#	docs/uml/app/lib/widgets/uml.svg
#	docs/uml/core/lib/src/models/questionnaire/uml.svg
#	docs/uml/core/lib/src/models/study_schedule/uml.svg
#	docs/uml/designer_v2/lib/features/design/interventions/uml.svg
#	docs/uml/designer_v2/lib/features/design/shared/questionnaire/question/uml.svg
#	docs/uml/designer_v2/lib/features/design/shared/questionnaire/uml.svg
#	docs/uml/designer_v2/lib/features/design/shared/uml.svg
#	docs/uml/designer_v2/lib/features/design/uml.svg
#	docs/uml/designer_v2/lib/features/forms/uml.svg
#	docs/uml/designer_v2/lib/features/uml.svg
#	docs/uml/designer_v2/lib/routing/uml.svg
#	docs/uml/designer_v2/lib/uml.svg
#	flutter_common/pubspec.lock
#	flutter_common/pubspec.yaml
#	melos.yaml
#	studyu
@github-actions github-actions bot added dependencies Pull requests that update a dependency file app core flutter_common designer_v2 labels Jun 28, 2024
Copy link

github-actions bot commented Jun 28, 2024

Visit the preview URL for this PR (updated for commit 0e0290b):

(expires Thu, 11 Jul 2024 14:26:59 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 2149dad49ed83535217e50d5c18c0c8c90da629b

Comment on lines 25 to 67

INSERT INTO public.study (
contact,
title,
description,
icon_name,
status,
registry_published,
questionnaire,
eligibility_criteria,
observations,
interventions,
consent,
schedule,
report_specification,
results,
created_at,
updated_at,
user_id,
participation,
result_sharing,
collaborator_emails
) VALUES(
'{"email":"[email protected]","phone":"0123456789","website":"https://studyu.health","researchers":"StudyU Researcher","organization":"StudyU","institutionalReviewBoard":"This study has not been submitted to the IRB Board. It is for illustration purposes of StudyU only.","institutionalReviewBoardNumber":"N/A"}',
'Public demo study of user1',
'This is a Demo Study. This study helps you find out which treatment is more effective for you.',
'accountHeart',
-- status
'running',
-- registry_published
true,
'[{"id": "recent_back_pain", "type": "boolean", "prompt": "Have you had back pain in the last 12 weeks?", "rationale": ""}, {"id": "f70386c8-f517-4e62-a5fa-ca4badfd4b60", "type": "boolean", "prompt": "Are you pregnant?", "rationale": ""}, {"id": "afeac253-4bfe-47fe-9384-4236ded1bd50", "type": "choice", "prompt": "Does any of the following apply to you and has not been examined by a doctor yet?", "choices": [{"id": "start_of_symptoms_after_spinal_surgery", "text": "Start of symptoms after spinal surgery"}, {"id": "start_of_symptoms_after_diagnosis_of_cancer", "text": "Start of symptoms after diagnosis of cancer"}, {"id": "unexpected_significant_weight_loss", "text": "Unexpected significant weight loss"}, {"id": "start_of_symptoms_after_trauma", "text": "Start of symptoms after trauma"}, {"id": "accompanying_numbness_of_your_legs", "text": "Accompanying numbness of your legs"}], "multiple": true, "rationale": "This question is asked to ensure that you are not suffering from any critical illness."}]','[{"id": "b47d07d8-eb98-4fce-86ab-945bc7c2f2d0", "condition": {"type": "choice", "target": "recent_back_pain", "choices": [true]}}, {"id": "acb368b0-0ca2-496d-98e1-be9fefbe5e89", "condition": {"type": "choice", "target": "f70386c8-f517-4e62-a5fa-ca4badfd4b60", "choices": [false]}}, {"id": "d7c3445e-b5b1-43d1-93a6-5637e0cfd44f", "condition": {"type": "choice", "target": "afeac253-4bfe-47fe-9384-4236ded1bd50", "choices": []}}]','[{"id": "rate_your_day", "type": "questionnaire", "title": "Rate your day", "footer": "", "header": "", "schedule": {"reminders": ["19:00"], "completionPeriods": [{"id": "50d114f3-e692-4283-9610-17e23edf8f70", "lockTime": "20:00", "unlockTime": "8:00"}]}, "questions": [{"id": "pain", "step": 1, "type": "visualAnalogue", "prompt": "Rate your pain.", "initial": 0, "maximum": 10, "minimum": 0, "maximumColor": 4294901760, "minimumColor": 4294967295, "maximumAnnotation": "Well, guess I die now", "minimumAnnotation": "no pain"}, {"id": "painkillers", "type": "boolean", "prompt": "Have you taken any painkillers in the last 24 hours?"}, {"id": "sleep", "step": 1, "type": "visualAnalogue", "prompt": "Rate your sleep.", "initial": 0, "maximum": 10, "minimum": 0, "maximumColor": 4294901760, "minimumColor": 4294967295, "maximumAnnotation": "terrible", "minimumAnnotation": "no problems"}, {"id": "mood", "step": 1, "type": "annotatedScale", "prompt": "Rate your mood.", "initial": 5, "maximum": 10, "minimum": 0, "annotations": [{"value": 0, "annotation": "☠"}, {"value": 5, "annotation": "😐"}, {"value": 10, "annotation": "😀"}]}]}]','[{"id": "willow_bark_tea", "icon": "coffee", "name": "Willow-Bark tea", "tasks": [{"id": "drink_tea", "type": "checkmark", "title": "Drink a cup of Willow-Bark tea twice a day.", "schedule": {"reminders": ["18:00"], "completionPeriods": [{"id": "54d114f3-e692-4283-9610-17e23edf8f70", "lockTime": "20:00", "unlockTime": "6:00"}]}}], "description": "Willow bark contains powerful anti-inflamatory compunds such as flavonoids and salicin that help relieve the pain."}, {"id": "arnika", "icon": "leaf", "name": "Arnika", "tasks": [{"id": "apply_arnika", "type": "checkmark", "title": "Apply a dime sized amount of Arnica gel to your lower back and massage for 10 mins.", "schedule": {"reminders": ["18:00"], "completionPeriods": [{"id": "55d114f3-e692-4283-9610-17e23edf8f70", "lockTime": "20:00", "unlockTime": "6:00"}]}}], "description": "Arnika gel has been proven to soothe muscle soreness, strain and reduce swelling when rubbed on the affected area."}, {"id": "warming_pad", "icon": "car-seat-heater", "name": "Warming Pad", "tasks": [{"id": "use_pad", "type": "checkmark", "title": "Apply warming pad to your lower back for 5 minutes.", "schedule": {"reminders": ["18:00"], "completionPeriods": [{"id": "56d114f3-e692-4283-9610-17e23edf8f70", "lockTime": "20:00", "unlockTime": "6:00"}]}}], "description": "Applying a warming pad is a quick and easy way to soothe sore muscles and joints."}]','[{"id": "Need", "title": "Why Consent Is Needed", "iconName": "featureSearch", "description": "We need your explicit consent because you are going to enroll to a research study. Therefore, we have to provide you all the information that could potentially have an impact on your decision whether or not you take part in the study. This is study-specific so please go through it carefully. Participation is entirely voluntary."}, {"id": "Risk_benefit", "title": "Risks & Benefits", "iconName": "signCaution", "description": "The main risks to you if you choose to participate are allergic reactions to one of the interventions you are going to apply. If you feel uncomfortable, suffer from itching or rash please pause the study until you have seen a doctor. It is important to know that you may not get any benefit from taking part in this research. Others may not benefit either. However, study results may help you to understand if one of the offered interventions has a positive effect on one of the investigated observations for you."}, {"id": "Data", "title": "Data Handling & Use", "iconName": "databaseExport", "description": "By giving your consent you accept that researchers are allowed to process anonymized data collected from you during this study for research purposes. If you stop being in the research study, already transmitted information may not be removed from the research study database because re-identification is not possible. It will continue to be used to complete the research analysis."}, {"id": "Issues", "title": "Issues to Consider", "iconName": "mapClock", "description": "For being able to use your results for research we need you to actively participate for the indicated minimum study duration. After reaching this you will be able to unlock results but we encourage you to take part at least until you reach the recommended level on the progress bar. Otherwise it might be the case that results can indeed be used for research but are not meaningful for you personally. Note that if you decide to take part in this research study you will be responsible for buying the needed aids."}, {"id": "Rights", "title": "Participant Rights", "iconName": "gavel", "description": "You may stop taking part in this research study at any time without any penalty. If you have any questions, concerns, or complaints at any time about this research, or you think the research has harmed you, please contact the office of the research team. You can find the contact details in your personal study dashboard."}, {"id": "Future", "title": "Future Research", "iconName": "binoculars", "description": "The purpose of this research study is to help you find the most effective supporting agent or behavior. The aim is not to treat your symptom causally. In a broader perspective the purpose of this study is also to get insights which group of persons benefits most from which intervention."}]','{"sequence": "alternating", "phaseDuration": 7, "numberOfCycles": 2, "sequenceCustom": "ABAB", "includeBaseline": true}','{"primary": {"id": "average", "type": "average", "title": "Average", "aggregate": "day", "description": "Average", "resultProperty": {"task": "rate_your_day", "property": "pain"}}, "secondary": []}',
'[]',
'2021-04-13 18:19:49.000',
'2023-05-11 12:46:06.018',
-- user_id
user_id,
-- participation ('open', 'invite')
'open',
-- result_sharing ('public', 'organization', 'private')
'public',
'{}'
);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Migrate this

# Conflicts:
#	app/pubspec.yaml
#	core/lib/src/models/tables/study.dart
#	designer_v2/lib/features/design/interventions/study_schedule_form_view.dart
#	designer_v2/lib/features/design/study_form_providers.dart
#	designer_v2/lib/features/forms/form_view_model.dart
#	designer_v2/pubspec.lock
#	supabase/seed.sql
@johannesvedder
Copy link
Contributor Author

image

The predefined schedule is currently hardcoded to Alternating. We might want to embed the new study scheduler here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app core dependencies Pull requests that update a dependency file designer_v2 flutter_common
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants