From 87f7a6ac6263ee05ef5a1546b5ec3ccb67b7aa0f Mon Sep 17 00:00:00 2001 From: yibeichan Date: Thu, 25 Jan 2024 11:25:44 -0500 Subject: [PATCH 01/16] add print for testing --- reproschema/redcap2reproschema.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reproschema/redcap2reproschema.py b/reproschema/redcap2reproschema.py index f267a2f..c6b7dfd 100644 --- a/reproschema/redcap2reproschema.py +++ b/reproschema/redcap2reproschema.py @@ -371,7 +371,9 @@ def process_csv( with open(csv_file, mode="r", encoding="utf-8") as csvfile: reader = csv.DictReader(csvfile) for row in reader: + print(f"process_csv: {row}") row = clean_header(row) + print(f"process_csv: {row} - after") form_name = row["Form Name"] if form_name not in datas: datas[form_name] = [] From 31627829ffd6c92a7897e82bb6efc243ef1b1b94 Mon Sep 17 00:00:00 2001 From: yibeichan Date: Thu, 25 Jan 2024 11:30:34 -0500 Subject: [PATCH 02/16] update clear_header --- reproschema/redcap2reproschema.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/reproschema/redcap2reproschema.py b/reproschema/redcap2reproschema.py index c6b7dfd..6f9cea4 100644 --- a/reproschema/redcap2reproschema.py +++ b/reproschema/redcap2reproschema.py @@ -10,7 +10,12 @@ def clean_header(header): - return {k.lstrip("\ufeff"): v for k, v in header.items()} + cleaned_header = {} + for k, v in header.items(): + # Strip BOM, whitespace, and enclosing quotation marks if present + cleaned_key = k.lstrip('\ufeff').strip().strip('"') + cleaned_header[cleaned_key] = v + return cleaned_header def normalize_condition(condition_str): From 64521d9e45053f2327b4ca5164d305fe289e2498 Mon Sep 17 00:00:00 2001 From: yibeichan Date: Thu, 25 Jan 2024 12:39:08 -0500 Subject: [PATCH 03/16] remove print --- reproschema/redcap2reproschema.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/reproschema/redcap2reproschema.py b/reproschema/redcap2reproschema.py index 6f9cea4..f8c5fdf 100644 --- a/reproschema/redcap2reproschema.py +++ b/reproschema/redcap2reproschema.py @@ -376,9 +376,7 @@ def process_csv( with open(csv_file, mode="r", encoding="utf-8") as csvfile: reader = csv.DictReader(csvfile) for row in reader: - print(f"process_csv: {row}") row = clean_header(row) - print(f"process_csv: {row} - after") form_name = row["Form Name"] if form_name not in datas: datas[form_name] = [] From 4c1081af6f130505fcfa90132e01927409f08bee Mon Sep 17 00:00:00 2001 From: yibeichan Date: Wed, 7 Feb 2024 11:35:51 -0500 Subject: [PATCH 04/16] fix order and other errors --- reproschema/redcap2reproschema.py | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/reproschema/redcap2reproschema.py b/reproschema/redcap2reproschema.py index f8c5fdf..35b758a 100644 --- a/reproschema/redcap2reproschema.py +++ b/reproschema/redcap2reproschema.py @@ -19,16 +19,24 @@ def clean_header(header): def normalize_condition(condition_str): + # Regular expressions for various pattern replacements re_parentheses = re.compile(r"\(([0-9]*)\)") re_non_gt_lt_equal = re.compile(r"([^>|<])=") re_brackets = re.compile(r"\[([^\]]*)\]") + re_extra_spaces = re.compile(r"\s+") + re_double_quotes = re.compile(r'"') + # Apply regex replacements condition_str = re_parentheses.sub(r"___\1", condition_str) condition_str = re_non_gt_lt_equal.sub(r"\1 ==", condition_str) condition_str = condition_str.replace(" and ", " && ").replace(" or ", " || ") condition_str = re_brackets.sub(r" \1 ", condition_str) - return condition_str + # Trim extra spaces and replace double quotes with single quotes + condition_str = re_extra_spaces.sub(' ', condition_str) # Reduce multiple spaces to a single space + condition_str = re_double_quotes.sub("'", condition_str) # Replace double quotes with single quotes + + return condition_str.strip() def process_visibility(data): condition = data.get("Branching Logic (Show field only if...)") @@ -245,6 +253,7 @@ def process_row( def create_form_schema( abs_folder_path, schema_context_url, + redcap_version, form_name, activity_display_name, activity_description, @@ -264,7 +273,7 @@ def create_form_schema( "prefLabel": activity_display_name, "description": activity_description, "schemaVersion": "1.0.0-rc4", - "version": "0.0.1", + "version": redcap_version, "ui": { "order": unique_order, "addProperties": bl_list, @@ -301,6 +310,7 @@ def process_activities(activity_name, protocol_visibility_obj, protocol_order): def create_protocol_schema( abs_folder_path, schema_context_url, + redcap_version, protocol_name, protocol_display_name, protocol_description, @@ -316,27 +326,27 @@ def create_protocol_schema( "skos:altLabel": f"{protocol_name}_schema", "schema:description": protocol_description, "schema:schemaVersion": "1.0.0-rc4", - "schema:version": "0.0.1", + "schema:version": redcap_version, "ui": { "addProperties": [], - "order": protocol_order, + "order": [], "shuffle": False, }, } # Populate addProperties list for activity in protocol_order: + full_path = f"../activities/{activity_name}/{activity_name}_schema" add_property = { - "isAbout": f"../activities/{activity}/{activity}_schema", + "isAbout": full_path, "variableName": f"{activity}_schema", # Assuming activity name as prefLabel, update as needed "prefLabel": activity.replace("_", " ").title(), + "isVis": protocol_visibility_obj.get(activity, True), # Default to True if not specified } protocol_schema["ui"]["addProperties"].append(add_property) - - # Add visibility if needed - if protocol_visibility_obj: - protocol_schema["ui"]["visibility"] = protocol_visibility_obj + # Add the full path to the order list + protocol_schema["ui"]["order"].append(full_path) protocol_dir = f"{abs_folder_path}/{protocol_name}" schema_file = f"{protocol_name}_schema" @@ -425,6 +435,7 @@ def redcap2reproschema(csv_file, yaml_file, schema_context_url=None): protocol_name = protocol.get("protocol_name") protocol_display_name = protocol.get("protocol_display_name") protocol_description = protocol.get("protocol_description") + redcap_version = protocol.get("redcap_version") if not protocol_name: raise ValueError("Protocol name not specified in the YAML file.") @@ -520,6 +531,7 @@ def redcap2reproschema(csv_file, yaml_file, schema_context_url=None): create_form_schema( abs_folder_path, schema_context_url, + redcap_version, form_name, activity_display_name, activity_description, @@ -535,6 +547,7 @@ def redcap2reproschema(csv_file, yaml_file, schema_context_url=None): create_protocol_schema( abs_folder_path, schema_context_url, + redcap_version, protocol_name, protocol_display_name, protocol_description, From 50fe4ceb234e386876ed1b12ee9ed32896275679 Mon Sep 17 00:00:00 2001 From: yibeichan Date: Wed, 7 Feb 2024 11:41:14 -0500 Subject: [PATCH 05/16] change ui yesno to radio --- reproschema/redcap2reproschema.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/reproschema/redcap2reproschema.py b/reproschema/redcap2reproschema.py index 35b758a..aa0e655 100644 --- a/reproschema/redcap2reproschema.py +++ b/reproschema/redcap2reproschema.py @@ -55,7 +55,11 @@ def process_visibility(data): def parse_field_type_and_value(field, input_type_map): field_type = field.get("Field Type", "") - input_type = input_type_map.get(field_type, field_type) + # Check if field_type is 'yesno' and directly assign 'radio' as the input type + if field_type == "yesno": + input_type = "radio" # Directly set to 'radio' for 'yesno' fields + else: + input_type = input_type_map.get(field_type, field_type) # Original logic # Initialize the default value type as string value_type = "xsd:string" @@ -68,7 +72,8 @@ def parse_field_type_and_value(field, input_type_map): "time_": "xsd:time", "email": "xsd:string", "phone": "xsd:string", - } # todo: input_type="signature" + # No change needed here for 'yesno', as it's handled above + } # Get the validation type from the field, if available validation_type = field.get( @@ -85,6 +90,7 @@ def parse_field_type_and_value(field, input_type_map): return input_type, value_type + def process_choices(field_type, choices_str): if field_type not in ["radio", "dropdown"]: # Handle only radio and dropdown types return None From 4359791a214e7ed1b64d58eb29482340e941859d Mon Sep 17 00:00:00 2001 From: yibeichan Date: Wed, 7 Feb 2024 11:47:16 -0500 Subject: [PATCH 06/16] fix typo --- reproschema/redcap2reproschema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reproschema/redcap2reproschema.py b/reproschema/redcap2reproschema.py index aa0e655..3959d1b 100644 --- a/reproschema/redcap2reproschema.py +++ b/reproschema/redcap2reproschema.py @@ -342,7 +342,7 @@ def create_protocol_schema( # Populate addProperties list for activity in protocol_order: - full_path = f"../activities/{activity_name}/{activity_name}_schema" + full_path = f"../activities/{activity}/{activity}_schema" add_property = { "isAbout": full_path, "variableName": f"{activity}_schema", From b17b5c7c93dc492104f3720dd4ddbd7702a2b905 Mon Sep 17 00:00:00 2001 From: yibeichan Date: Thu, 22 Feb 2024 17:09:00 -0500 Subject: [PATCH 07/16] update context, field->item, fix isVis --- reproschema/redcap2reproschema.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/reproschema/redcap2reproschema.py b/reproschema/redcap2reproschema.py index 3959d1b..b9e223c 100644 --- a/reproschema/redcap2reproschema.py +++ b/reproschema/redcap2reproschema.py @@ -25,15 +25,21 @@ def normalize_condition(condition_str): re_brackets = re.compile(r"\[([^\]]*)\]") re_extra_spaces = re.compile(r"\s+") re_double_quotes = re.compile(r'"') + re_or = re.compile(r'\bor\b') # Match 'or' as whole word # Apply regex replacements condition_str = re_parentheses.sub(r"___\1", condition_str) condition_str = re_non_gt_lt_equal.sub(r"\1 ==", condition_str) - condition_str = condition_str.replace(" and ", " && ").replace(" or ", " || ") condition_str = re_brackets.sub(r" \1 ", condition_str) + # Replace 'or' with '||', ensuring not to replace '||' + condition_str = re_or.sub('||', condition_str) + + # Replace 'and' with '&&' + condition_str = condition_str.replace(" and ", " && ") + # Trim extra spaces and replace double quotes with single quotes - condition_str = re_extra_spaces.sub(' ', condition_str) # Reduce multiple spaces to a single space + condition_str = re_extra_spaces.sub(' ', condition_str).strip() # Reduce multiple spaces to a single space condition_str = re_double_quotes.sub("'", condition_str) # Replace double quotes with single quotes return condition_str.strip() @@ -175,7 +181,7 @@ def process_row( rowData = { "@context": schema_context_url, - "@type": "reproschema:Field", + "@type": "reproschema:Item", "@id": item_id, "prefLabel": item_id, "description": f"{item_id} of {form_name}", @@ -456,7 +462,7 @@ def redcap2reproschema(csv_file, yaml_file, schema_context_url=None): abs_folder_path = os.path.abspath(protocol_name) if schema_context_url is None: - schema_context_url = "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc4/contexts/generic" + schema_context_url = "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new" # Initialize variables schema_map = { From ca3162de5bed4017ea9088ec1f8ae04f62d2a655 Mon Sep 17 00:00:00 2001 From: yibeichan Date: Thu, 22 Feb 2024 21:35:12 -0500 Subject: [PATCH 08/16] remove useless due to failed validation --- reproschema/redcap2reproschema.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/reproschema/redcap2reproschema.py b/reproschema/redcap2reproschema.py index b9e223c..d3aee9d 100644 --- a/reproschema/redcap2reproschema.py +++ b/reproschema/redcap2reproschema.py @@ -119,7 +119,7 @@ def process_choices(field_type, choices_str): choice_obj = {"name": parts[1], "value": value} if len(parts) == 3: # Handle image url - choice_obj["schema:image"] = f"{parts[2]}.png" + choice_obj["image"] = f"{parts[2]}.png" choices.append(choice_obj) return choices @@ -205,7 +205,7 @@ def process_row( for key, value in field.items(): if ( - schema_map.get(key) in ["question", "schema:description", "preamble"] + schema_map.get(key) in ["question", "description", "preamble"] and value ): rowData.update({schema_map[key]: parse_html(value)}) @@ -334,11 +334,11 @@ def create_protocol_schema( "@context": schema_context_url, "@type": "reproschema:Protocol", "@id": f"{protocol_name}_schema", - "skos:prefLabel": protocol_display_name, - "skos:altLabel": f"{protocol_name}_schema", - "schema:description": protocol_description, - "schema:schemaVersion": "1.0.0-rc4", - "schema:version": redcap_version, + "prefLabel": protocol_display_name, + # "altLabel": f"{protocol_name}_schema", + "description": protocol_description, + "schemaVersion": "1.0.0-rc4", + "version": redcap_version, "ui": { "addProperties": [], "order": [], From 4288f8aa2bd7a1ae9e48643fa2a538854e310d00 Mon Sep 17 00:00:00 2001 From: yibeichan Date: Fri, 23 Feb 2024 15:28:41 -0500 Subject: [PATCH 09/16] remove visibility at the item level & remove matrixInfo --- reproschema/redcap2reproschema.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/reproschema/redcap2reproschema.py b/reproschema/redcap2reproschema.py index d3aee9d..b1dcd52 100644 --- a/reproschema/redcap2reproschema.py +++ b/reproschema/redcap2reproschema.py @@ -239,12 +239,6 @@ def process_row( } ) - elif schema_map.get(key) == "visibility" and value: - condition = normalize_condition(value) - rowData.setdefault("visibility", []).append( - {"variableName": field["Variable / Field Name"], "isVis": condition} - ) - elif key == "Identifier?" and value: identifier_val = value.lower() == "y" rowData.update( @@ -293,8 +287,9 @@ def create_form_schema( }, } - if matrix_list: - json_ld["matrixInfo"] = matrix_list + # remove matrixInfo to pass validataion + # if matrix_list: + # json_ld["matrixInfo"] = matrix_list if scores_list: json_ld["scoringLogic"] = scores_list @@ -335,7 +330,7 @@ def create_protocol_schema( "@type": "reproschema:Protocol", "@id": f"{protocol_name}_schema", "prefLabel": protocol_display_name, - # "altLabel": f"{protocol_name}_schema", + "altLabel": f"{protocol_name}_schema", "description": protocol_description, "schemaVersion": "1.0.0-rc4", "version": redcap_version, From 57ca52e16d3966dd0ef03cc73cea74fc874b9bcf Mon Sep 17 00:00:00 2001 From: yibeichan Date: Sun, 25 Feb 2024 17:54:03 -0500 Subject: [PATCH 10/16] fix choice --- reproschema/redcap2reproschema.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/reproschema/redcap2reproschema.py b/reproschema/redcap2reproschema.py index b1dcd52..8afdc5b 100644 --- a/reproschema/redcap2reproschema.py +++ b/reproschema/redcap2reproschema.py @@ -116,10 +116,11 @@ def process_choices(field_type, choices_str): except ValueError: value = parts[0] - choice_obj = {"name": parts[1], "value": value} - if len(parts) == 3: - # Handle image url - choice_obj["image"] = f"{parts[2]}.png" + choice_obj = {"name": " ".join(parts[1:]), "value": value} + # remove image for now + # if len(parts) == 3: + # # Handle image url + # choice_obj["image"] = f"{parts[2]}.png" choices.append(choice_obj) return choices From 82e2300566080acd5cef3b0225510abe9fb2eea0 Mon Sep 17 00:00:00 2001 From: yibeichan Date: Wed, 28 Feb 2024 11:33:26 -0500 Subject: [PATCH 11/16] remove identifier --- reproschema/redcap2reproschema.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/reproschema/redcap2reproschema.py b/reproschema/redcap2reproschema.py index 8afdc5b..d7d881c 100644 --- a/reproschema/redcap2reproschema.py +++ b/reproschema/redcap2reproschema.py @@ -240,15 +240,15 @@ def process_row( } ) - elif key == "Identifier?" and value: - identifier_val = value.lower() == "y" - rowData.update( - { - schema_map[key]: [ - {"legalStandard": "unknown", "isIdentifier": identifier_val} - ] - } - ) + # elif key == "Identifier?" and value: + # identifier_val = value.lower() == "y" + # rowData.update( + # { + # schema_map[key]: [ + # {"legalStandard": "unknown", "isIdentifier": identifier_val} + # ] + # } + # ) elif key in additional_notes_list and value: notes_obj = {"source": "redcap", "column": key, "value": value} @@ -475,7 +475,7 @@ def redcap2reproschema(csv_file, yaml_file, schema_context_url=None): "Choices, Calculations, OR Slider Labels": "choices", # column F "Branching Logic (Show field only if...)": "visibility", # column L "Custom Alignment": "customAlignment", # column N - "Identifier?": "identifiable", # column K + # "Identifier?": "identifiable", # column K "multipleChoice": "multipleChoice", "responseType": "@type", } From 3c7049fa7c81b5b110cb687dffd2021b4849f80c Mon Sep 17 00:00:00 2001 From: yibeichan Date: Sat, 20 Apr 2024 21:33:27 -0400 Subject: [PATCH 12/16] fix conversion tests --- reproschema/redcap2reproschema.py | 2 - reproschema/reproschema2redcap.py | 13 +- reproschema/tests/test_redcap2reproschema.py | 26 ++-- .../tests/test_redcap2rs_data/redcap2rs.yaml | 9 +- reproschema/tests/test_reproschema2redcap.py | 18 ++- templates/redcap2rs.yaml | 2 + .../autism_parenting_stress_index_apsi_schema | 124 ++++++++++++++++++ .../items/apsi_accepted | 38 ++++++ .../items/apsi_agressive | 38 ++++++ .../items/apsi_bowel | 38 ++++++ .../items/apsi_communicate | 38 ++++++ .../items/apsi_date | 19 +++ .../items/apsi_diet | 38 ++++++ .../items/apsi_independently | 38 ++++++ .../items/apsi_name_of_child | 16 +++ .../items/apsi_not_close | 38 ++++++ .../items/apsi_person_completing | 16 +++ .../items/apsi_potty | 38 ++++++ .../items/apsi_self_injure | 38 ++++++ .../items/apsi_sleep | 38 ++++++ .../items/apsi_social_dev | 41 ++++++ .../items/apsi_tantrums | 38 ++++++ .../items/apsi_total | 16 +++ .../items/apsi_transitions | 38 ++++++ .../items/record_id | 16 +++ ...ffective_mindfulness_scalerevised_c_schema | 88 +++++++++++++ .../items/cams_r_1 | 37 ++++++ .../items/cams_r_10 | 34 +++++ .../items/cams_r_11 | 34 +++++ .../items/cams_r_12 | 34 +++++ .../items/cams_r_2 | 34 +++++ .../items/cams_r_3 | 34 +++++ .../items/cams_r_4 | 34 +++++ .../items/cams_r_5 | 34 +++++ .../items/cams_r_6 | 34 +++++ .../items/cams_r_7 | 34 +++++ .../items/cams_r_8 | 34 +++++ .../items/cams_r_9 | 34 +++++ .../test_redcap2rs/test_redcap2rs_schema | 31 +++++ 39 files changed, 1273 insertions(+), 31 deletions(-) create mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/autism_parenting_stress_index_apsi_schema create mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_accepted create mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_agressive create mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_bowel create mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_communicate create mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_date create mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_diet create mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_independently create mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_name_of_child create mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_not_close create mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_person_completing create mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_potty create mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_self_injure create mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_sleep create mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_social_dev create mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_tantrums create mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_total create mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_transitions create mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/record_id create mode 100644 test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/cognitive_and_affective_mindfulness_scalerevised_c_schema create mode 100644 test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_1 create mode 100644 test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_10 create mode 100644 test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_11 create mode 100644 test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_12 create mode 100644 test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_2 create mode 100644 test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_3 create mode 100644 test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_4 create mode 100644 test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_5 create mode 100644 test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_6 create mode 100644 test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_7 create mode 100644 test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_8 create mode 100644 test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_9 create mode 100644 test_redcap2rs/test_redcap2rs/test_redcap2rs_schema diff --git a/reproschema/redcap2reproschema.py b/reproschema/redcap2reproschema.py index d7d881c..799a795 100644 --- a/reproschema/redcap2reproschema.py +++ b/reproschema/redcap2reproschema.py @@ -8,7 +8,6 @@ matrix_group_count = {} - def clean_header(header): cleaned_header = {} for k, v in header.items(): @@ -17,7 +16,6 @@ def clean_header(header): cleaned_header[cleaned_key] = v return cleaned_header - def normalize_condition(condition_str): # Regular expressions for various pattern replacements re_parentheses = re.compile(r"\(([0-9]*)\)") diff --git a/reproschema/reproschema2redcap.py b/reproschema/reproschema2redcap.py index 3d03cf3..3e1af67 100644 --- a/reproschema/reproschema2redcap.py +++ b/reproschema/reproschema2redcap.py @@ -142,6 +142,7 @@ def get_csv_data(dir_path): if protocol_dir.is_dir(): # Check for a _schema file in each directory schema_file = next(protocol_dir.glob("*_schema"), None) + print(f"Found schema file: {schema_file}") if schema_file: # Process the found _schema file parsed_protocol_json = read_json_file(schema_file) @@ -149,11 +150,10 @@ def get_csv_data(dir_path): activity_order = parsed_protocol_json.get("ui", {}).get("order", []) for relative_activity_path in activity_order: # Normalize the relative path and construct the absolute path - normalized_relative_path = Path( - relative_activity_path.lstrip("../") - ) - activity_path = dir_path / normalized_relative_path - print(f"Processing activity {activity_path}") + normalized_relative_path = Path(relative_activity_path.lstrip("../")) + + activity_path = dir_path / "activities" / normalized_relative_path / (normalized_relative_path.name + "_schema") + parsed_activity_json = read_json_file(activity_path) if parsed_activity_json: @@ -164,6 +164,7 @@ def get_csv_data(dir_path): if item_json: row_data = process_item(item_json, activity_path.stem) csv_data.append(row_data) + print(f"Processed item {item_path}") # Break after finding the first _schema file break @@ -239,4 +240,4 @@ def main(input_dir_path, output_csv_filename): sys.exit(1) input_dir_path = Path(sys.argv[1]) output_csv_filename = sys.argv[2] - main(input_dir_path, output_csv_filename) + main(input_dir_path, output_csv_filename) \ No newline at end of file diff --git a/reproschema/tests/test_redcap2reproschema.py b/reproschema/tests/test_redcap2reproschema.py index 2386a8c..2486714 100644 --- a/reproschema/tests/test_redcap2reproschema.py +++ b/reproschema/tests/test_redcap2reproschema.py @@ -1,10 +1,10 @@ import os import shutil import pytest +import yaml from click.testing import CliRunner -from ..cli import main # Import the Click group +from ..cli import main -# Assuming your test files are located in a 'tests' directory CSV_FILE_NAME = "redcap_dict.csv" YAML_FILE_NAME = "redcap2rs.yaml" CSV_TEST_FILE = os.path.join( @@ -14,18 +14,24 @@ os.path.dirname(__file__), "test_redcap2rs_data", YAML_FILE_NAME ) - -def test_redcap2reproschema_success(): +def test_redcap2reproschema_success(tmpdir): runner = CliRunner() - with runner.isolated_filesystem(): - # Copy the test files to the isolated filesystem - shutil.copy(CSV_TEST_FILE, CSV_FILE_NAME) - shutil.copy(YAML_TEST_FILE, YAML_FILE_NAME) + # Copy the test files to the custom temporary directory + shutil.copy(CSV_TEST_FILE, tmpdir.join(CSV_FILE_NAME)) + shutil.copy(YAML_TEST_FILE, tmpdir.join(YAML_FILE_NAME)) + + # Set the working directory to tmpdir + with tmpdir.as_cwd(): + # Read YAML to find the expected output directory name + with open(YAML_FILE_NAME, 'r') as file: + protocol = yaml.safe_load(file) + protocol_name = protocol.get("protocol_name", "").replace(" ", "_") - # Run the command within the isolated filesystem result = runner.invoke( main, ["redcap2reproschema", CSV_FILE_NAME, YAML_FILE_NAME] ) - print(result.output) + + # Assertions assert result.exit_code == 0 + assert os.path.isdir(protocol_name), f"Expected output directory '{protocol_name}' does not exist" diff --git a/reproschema/tests/test_redcap2rs_data/redcap2rs.yaml b/reproschema/tests/test_redcap2rs_data/redcap2rs.yaml index 3330f3b..c201323 100644 --- a/reproschema/tests/test_redcap2rs_data/redcap2rs.yaml +++ b/reproschema/tests/test_redcap2rs_data/redcap2rs.yaml @@ -9,13 +9,8 @@ protocol_name: "test_redcap2rs" # Example: "My_Protocol" # This name will be displayed in the application. protocol_display_name: "redcap protocols" -# GitHub Repository Information: -# Create a GitHub repository named 'reproschema' to store your reproschema protocols. -# Replace 'your_github_username' with your actual GitHub username. -user_name: "yibeichan" -repo_name: "redcap2reproschema" # Recommended name; can be different if preferred. -repo_url: "https://github.com/{{user_name}}/{{repo_name}}" - # Protocol Description: # Provide a brief description of your protocol. protocol_description: "testing" # Example: "This protocol is for ..." + +redcap_version: "3.0.0" \ No newline at end of file diff --git a/reproschema/tests/test_reproschema2redcap.py b/reproschema/tests/test_reproschema2redcap.py index f0a02ce..5860121 100644 --- a/reproschema/tests/test_reproschema2redcap.py +++ b/reproschema/tests/test_reproschema2redcap.py @@ -2,23 +2,26 @@ import pytest from click.testing import CliRunner from ..cli import main -from shutil import copytree +from shutil import copytree, rmtree from pathlib import Path import csv - +import tempfile def test_reproschema2redcap_success(): runner = CliRunner() with runner.isolated_filesystem(): + # Create a temporary directory for output + temp_dir = tempfile.mkdtemp(dir='.') + print(f"Temporary directory: {temp_dir}") # Copy necessary test data into the isolated filesystem original_data_dir = os.path.join( - os.path.dirname(__file__), "test_rs2redcap_data" + os.path.dirname(__file__), "test_rs2redcap_data", "test_redcap2rs" ) copytree(original_data_dir, "input_data") input_path = Path("input_data") # Using Path object - output_csv_path = "output.csv" + output_csv_path = os.path.join(temp_dir, "output.csv") # Invoke the reproschema2redcap command result = runner.invoke( @@ -43,5 +46,8 @@ def test_reproschema2redcap_success(): print(row) # Optionally, assert conditions about the CSV contents - # For example, assert that the file is not empty - assert len(csv_contents) > 0 + # For example, assert that the file has more than just headers + assert len(csv_contents) > 1 # More than one row indicates content beyond headers + + # Clean up temporary directory after use (optional) + # rmtree(temp_dir) \ No newline at end of file diff --git a/templates/redcap2rs.yaml b/templates/redcap2rs.yaml index 1e1dbc3..aa2f831 100644 --- a/templates/redcap2rs.yaml +++ b/templates/redcap2rs.yaml @@ -12,3 +12,5 @@ protocol_display_name: "Your protocol display name" # Protocol Description: # Provide a brief description of your protocol. protocol_description: "Description for your protocol" # Example: "This protocol is for ..." + +redcap_version: "x.y.z" # Example: "3.0.0" \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/autism_parenting_stress_index_apsi_schema b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/autism_parenting_stress_index_apsi_schema new file mode 100644 index 0000000..fff03c4 --- /dev/null +++ b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/autism_parenting_stress_index_apsi_schema @@ -0,0 +1,124 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Activity", + "@id": "autism_parenting_stress_index_apsi_schema", + "prefLabel": "autism_parenting_stress_index_apsi", + "description": "Default description", + "schemaVersion": "1.0.0-rc4", + "version": "3.0.0", + "ui": { + "order": [ + "items/record_id", + "items/apsi_date", + "items/apsi_name_of_child", + "items/apsi_person_completing", + "items/apsi_social_dev", + "items/apsi_communicate", + "items/apsi_tantrums", + "items/apsi_agressive", + "items/apsi_self_injure", + "items/apsi_transitions", + "items/apsi_sleep", + "items/apsi_diet", + "items/apsi_bowel", + "items/apsi_potty", + "items/apsi_not_close", + "items/apsi_accepted", + "items/apsi_independently", + "items/apsi_total" + ], + "addProperties": [ + { + "variableName": "record_id", + "isAbout": "items/record_id", + "isVis": true + }, + { + "variableName": "apsi_date", + "isAbout": "items/apsi_date", + "isVis": true + }, + { + "variableName": "apsi_name_of_child", + "isAbout": "items/apsi_name_of_child", + "isVis": true + }, + { + "variableName": "apsi_person_completing", + "isAbout": "items/apsi_person_completing", + "isVis": true + }, + { + "variableName": "apsi_social_dev", + "isAbout": "items/apsi_social_dev", + "isVis": true + }, + { + "variableName": "apsi_communicate", + "isAbout": "items/apsi_communicate", + "isVis": true + }, + { + "variableName": "apsi_tantrums", + "isAbout": "items/apsi_tantrums", + "isVis": true + }, + { + "variableName": "apsi_agressive", + "isAbout": "items/apsi_agressive", + "isVis": true + }, + { + "variableName": "apsi_self_injure", + "isAbout": "items/apsi_self_injure", + "isVis": true + }, + { + "variableName": "apsi_transitions", + "isAbout": "items/apsi_transitions", + "isVis": true + }, + { + "variableName": "apsi_sleep", + "isAbout": "items/apsi_sleep", + "isVis": true + }, + { + "variableName": "apsi_diet", + "isAbout": "items/apsi_diet", + "isVis": true + }, + { + "variableName": "apsi_bowel", + "isAbout": "items/apsi_bowel", + "isVis": true + }, + { + "variableName": "apsi_potty", + "isAbout": "items/apsi_potty", + "isVis": true + }, + { + "variableName": "apsi_not_close", + "isAbout": "items/apsi_not_close", + "isVis": true + }, + { + "variableName": "apsi_accepted", + "isAbout": "items/apsi_accepted", + "isVis": true + }, + { + "variableName": "apsi_independently", + "isAbout": "items/apsi_independently", + "isVis": true + }, + { + "variableName": "apsi_total", + "isAbout": "items/apsi_total", + "isVis": true + } + ], + "shuffle": false + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_accepted b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_accepted new file mode 100644 index 0000000..5833f48 --- /dev/null +++ b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_accepted @@ -0,0 +1,38 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "apsi_accepted", + "prefLabel": "apsi_accepted", + "description": "apsi_accepted of autism_parenting_stress_index_apsi", + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "choices": [ + { + "name": "0 - Not stressful ", + "value": 0 + }, + { + "name": "1 - Sometimes creates stress ", + "value": 1 + }, + { + "name": "2 - Often creates stress ", + "value": 2 + }, + { + "name": "3 - Very stressful on a daily basis ", + "value": 3 + }, + { + "name": "5 - So stressful sometimes we feel we can't cope", + "value": 5 + } + ] + }, + "question": { + "en": "Concern for the future of your child being accepted by others" + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_agressive b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_agressive new file mode 100644 index 0000000..8717b1b --- /dev/null +++ b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_agressive @@ -0,0 +1,38 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "apsi_agressive", + "prefLabel": "apsi_agressive", + "description": "apsi_agressive of autism_parenting_stress_index_apsi", + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "choices": [ + { + "name": "0 - Not stressful ", + "value": 0 + }, + { + "name": "1 - Sometimes creates stress ", + "value": 1 + }, + { + "name": "2 - Often creates stress ", + "value": 2 + }, + { + "name": "3 - Very stressful on a daily basis ", + "value": 3 + }, + { + "name": "5 - So stressful sometimes we feel we can't cope", + "value": 5 + } + ] + }, + "question": { + "en": "Aggressive behavior (siblings, peers)" + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_bowel b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_bowel new file mode 100644 index 0000000..7b06f0f --- /dev/null +++ b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_bowel @@ -0,0 +1,38 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "apsi_bowel", + "prefLabel": "apsi_bowel", + "description": "apsi_bowel of autism_parenting_stress_index_apsi", + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "choices": [ + { + "name": "0 - Not stressful ", + "value": 0 + }, + { + "name": "1 - Sometimes creates stress ", + "value": 1 + }, + { + "name": "2 - Often creates stress ", + "value": 2 + }, + { + "name": "3 - Very stressful on a daily basis ", + "value": 3 + }, + { + "name": "5 - So stressful sometimes we feel we can't cope", + "value": 5 + } + ] + }, + "question": { + "en": "Bowel problems (diarrhea, constipation)" + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_communicate b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_communicate new file mode 100644 index 0000000..cc0bada --- /dev/null +++ b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_communicate @@ -0,0 +1,38 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "apsi_communicate", + "prefLabel": "apsi_communicate", + "description": "apsi_communicate of autism_parenting_stress_index_apsi", + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "choices": [ + { + "name": "0 - Not stressful ", + "value": 0 + }, + { + "name": "1 - Sometimes creates stress ", + "value": 1 + }, + { + "name": "2 - Often creates stress ", + "value": 2 + }, + { + "name": "3 - Very stressful on a daily basis ", + "value": 3 + }, + { + "name": "5 - So stressful sometimes we feel we can't cope", + "value": 5 + } + ] + }, + "question": { + "en": "Your child's ability to communicate" + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_date b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_date new file mode 100644 index 0000000..4af48ba --- /dev/null +++ b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_date @@ -0,0 +1,19 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "apsi_date", + "prefLabel": "apsi_date", + "description": "apsi_date of autism_parenting_stress_index_apsi", + "ui": { + "inputType": "text" + }, + "responseOptions": { + "valueType": "xsd:string" + }, + "preamble": { + "en": "Autism Parenting Stress Index for the Qigong Sensory Training Program Instructions: 1. Before beginning Qigong Sensory Training therapy with your child, complete the form on the following page. 2. Enter the date, name of your child, and who is completing the checklist. (It is very important that the same parent/caretaker complete the form each time the form is used.) 3. Choose the response for each item that most accurately describes your child. 4. Add all of the numbers chosen. 5. Enter total into the space provided. After using Qigong Sensory Training therapy on your child once a day for a five months, have the same parent complete the form again. Total numbers circled. Compare this number to the number at the beginning. If Qigong Sensory Training therapy is being implemented successfully, the total number should decrease over time." + }, + "question": { + "en": "Date:" + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_diet b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_diet new file mode 100644 index 0000000..f1bb04c --- /dev/null +++ b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_diet @@ -0,0 +1,38 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "apsi_diet", + "prefLabel": "apsi_diet", + "description": "apsi_diet of autism_parenting_stress_index_apsi", + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "choices": [ + { + "name": "0 - Not stressful ", + "value": 0 + }, + { + "name": "1 - Sometimes creates stress ", + "value": 1 + }, + { + "name": "2 - Often creates stress ", + "value": 2 + }, + { + "name": "3 - Very stressful on a daily basis ", + "value": 3 + }, + { + "name": "5 - So stressful sometimes we feel we can't cope", + "value": 5 + } + ] + }, + "question": { + "en": "Your child's diet" + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_independently b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_independently new file mode 100644 index 0000000..0389638 --- /dev/null +++ b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_independently @@ -0,0 +1,38 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "apsi_independently", + "prefLabel": "apsi_independently", + "description": "apsi_independently of autism_parenting_stress_index_apsi", + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "choices": [ + { + "name": "0 - Not stressful ", + "value": 0 + }, + { + "name": "1 - Sometimes creates stress ", + "value": 1 + }, + { + "name": "2 - Often creates stress ", + "value": 2 + }, + { + "name": "3 - Very stressful on a daily basis ", + "value": 3 + }, + { + "name": "5 - So stressful sometimes we feel we can't cope", + "value": 5 + } + ] + }, + "question": { + "en": "Concern for the future of your child living independently" + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_name_of_child b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_name_of_child new file mode 100644 index 0000000..195af9a --- /dev/null +++ b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_name_of_child @@ -0,0 +1,16 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "apsi_name_of_child", + "prefLabel": "apsi_name_of_child", + "description": "apsi_name_of_child of autism_parenting_stress_index_apsi", + "ui": { + "inputType": "text" + }, + "responseOptions": { + "valueType": "xsd:string" + }, + "question": { + "en": "Name of child:" + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_not_close b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_not_close new file mode 100644 index 0000000..a2b8fa7 --- /dev/null +++ b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_not_close @@ -0,0 +1,38 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "apsi_not_close", + "prefLabel": "apsi_not_close", + "description": "apsi_not_close of autism_parenting_stress_index_apsi", + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "choices": [ + { + "name": "0 - Not stressful ", + "value": 0 + }, + { + "name": "1 - Sometimes creates stress ", + "value": 1 + }, + { + "name": "2 - Often creates stress ", + "value": 2 + }, + { + "name": "3 - Very stressful on a daily basis ", + "value": 3 + }, + { + "name": "5 - So stressful sometimes we feel we can't cope", + "value": 5 + } + ] + }, + "question": { + "en": "Not feeling close to your child" + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_person_completing b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_person_completing new file mode 100644 index 0000000..76cfd23 --- /dev/null +++ b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_person_completing @@ -0,0 +1,16 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "apsi_person_completing", + "prefLabel": "apsi_person_completing", + "description": "apsi_person_completing of autism_parenting_stress_index_apsi", + "ui": { + "inputType": "text" + }, + "responseOptions": { + "valueType": "xsd:string" + }, + "question": { + "en": "Person completing checklist:" + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_potty b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_potty new file mode 100644 index 0000000..6640aae --- /dev/null +++ b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_potty @@ -0,0 +1,38 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "apsi_potty", + "prefLabel": "apsi_potty", + "description": "apsi_potty of autism_parenting_stress_index_apsi", + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "choices": [ + { + "name": "0 - Not stressful ", + "value": 0 + }, + { + "name": "1 - Sometimes creates stress ", + "value": 1 + }, + { + "name": "2 - Often creates stress ", + "value": 2 + }, + { + "name": "3 - Very stressful on a daily basis ", + "value": 3 + }, + { + "name": "5 - So stressful sometimes we feel we can't cope", + "value": 5 + } + ] + }, + "question": { + "en": "Potty training" + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_self_injure b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_self_injure new file mode 100644 index 0000000..29d8837 --- /dev/null +++ b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_self_injure @@ -0,0 +1,38 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "apsi_self_injure", + "prefLabel": "apsi_self_injure", + "description": "apsi_self_injure of autism_parenting_stress_index_apsi", + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "choices": [ + { + "name": "0 - Not stressful ", + "value": 0 + }, + { + "name": "1 - Sometimes creates stress ", + "value": 1 + }, + { + "name": "2 - Often creates stress ", + "value": 2 + }, + { + "name": "3 - Very stressful on a daily basis ", + "value": 3 + }, + { + "name": "5 - So stressful sometimes we feel we can't cope", + "value": 5 + } + ] + }, + "question": { + "en": "Self-injurious behavior" + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_sleep b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_sleep new file mode 100644 index 0000000..dbd01be --- /dev/null +++ b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_sleep @@ -0,0 +1,38 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "apsi_sleep", + "prefLabel": "apsi_sleep", + "description": "apsi_sleep of autism_parenting_stress_index_apsi", + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "choices": [ + { + "name": "0 - Not stressful ", + "value": 0 + }, + { + "name": "1 - Sometimes creates stress ", + "value": 1 + }, + { + "name": "2 - Often creates stress ", + "value": 2 + }, + { + "name": "3 - Very stressful on a daily basis ", + "value": 3 + }, + { + "name": "5 - So stressful sometimes we feel we can't cope", + "value": 5 + } + ] + }, + "question": { + "en": "Sleep problems" + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_social_dev b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_social_dev new file mode 100644 index 0000000..333be63 --- /dev/null +++ b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_social_dev @@ -0,0 +1,41 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "apsi_social_dev", + "prefLabel": "apsi_social_dev", + "description": "apsi_social_dev of autism_parenting_stress_index_apsi", + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "choices": [ + { + "name": "0 - Not stressful ", + "value": 0 + }, + { + "name": "1 - Sometimes creates stress ", + "value": 1 + }, + { + "name": "2 - Often creates stress ", + "value": 2 + }, + { + "name": "3 - Very stressful on a daily basis ", + "value": 3 + }, + { + "name": "5 - So stressful sometimes we feel we can't cope", + "value": 5 + } + ] + }, + "preamble": { + "en": "Stress Ratings Please rate the following aspects of your child'shealth according to how much stress it causes you and/or your familyby clicking on the button that best describes your situation." + }, + "question": { + "en": "Your child's social development" + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_tantrums b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_tantrums new file mode 100644 index 0000000..e07f99d --- /dev/null +++ b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_tantrums @@ -0,0 +1,38 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "apsi_tantrums", + "prefLabel": "apsi_tantrums", + "description": "apsi_tantrums of autism_parenting_stress_index_apsi", + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "choices": [ + { + "name": "0 - Not stressful ", + "value": 0 + }, + { + "name": "1 - Sometimes creates stress ", + "value": 1 + }, + { + "name": "2 - Often creates stress ", + "value": 2 + }, + { + "name": "3 - Very stressful on a daily basis ", + "value": 3 + }, + { + "name": "5 - So stressful sometimes we feel we can't cope", + "value": 5 + } + ] + }, + "question": { + "en": "Tantrums/meltdowns" + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_total b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_total new file mode 100644 index 0000000..15328ec --- /dev/null +++ b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_total @@ -0,0 +1,16 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "apsi_total", + "prefLabel": "apsi_total", + "description": "apsi_total of autism_parenting_stress_index_apsi", + "ui": { + "inputType": "text" + }, + "responseOptions": { + "valueType": "xsd:string" + }, + "question": { + "en": "Total" + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_transitions b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_transitions new file mode 100644 index 0000000..ce9782c --- /dev/null +++ b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_transitions @@ -0,0 +1,38 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "apsi_transitions", + "prefLabel": "apsi_transitions", + "description": "apsi_transitions of autism_parenting_stress_index_apsi", + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "choices": [ + { + "name": "0 - Not stressful ", + "value": 0 + }, + { + "name": "1 - Sometimes creates stress ", + "value": 1 + }, + { + "name": "2 - Often creates stress ", + "value": 2 + }, + { + "name": "3 - Very stressful on a daily basis ", + "value": 3 + }, + { + "name": "5 - So stressful sometimes we feel we can't cope", + "value": 5 + } + ] + }, + "question": { + "en": "Difficulty making transitions from one activity to another" + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/record_id b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/record_id new file mode 100644 index 0000000..3971398 --- /dev/null +++ b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/record_id @@ -0,0 +1,16 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "record_id", + "prefLabel": "record_id", + "description": "record_id of autism_parenting_stress_index_apsi", + "ui": { + "inputType": "text" + }, + "responseOptions": { + "valueType": "xsd:string" + }, + "question": { + "en": "Record ID" + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/cognitive_and_affective_mindfulness_scalerevised_c_schema b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/cognitive_and_affective_mindfulness_scalerevised_c_schema new file mode 100644 index 0000000..ed06073 --- /dev/null +++ b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/cognitive_and_affective_mindfulness_scalerevised_c_schema @@ -0,0 +1,88 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Activity", + "@id": "cognitive_and_affective_mindfulness_scalerevised_c_schema", + "prefLabel": "cognitive_and_affective_mindfulness_scalerevised_c", + "description": "Default description", + "schemaVersion": "1.0.0-rc4", + "version": "3.0.0", + "ui": { + "order": [ + "items/cams_r_1", + "items/cams_r_2", + "items/cams_r_3", + "items/cams_r_4", + "items/cams_r_5", + "items/cams_r_6", + "items/cams_r_7", + "items/cams_r_8", + "items/cams_r_9", + "items/cams_r_10", + "items/cams_r_11", + "items/cams_r_12" + ], + "addProperties": [ + { + "variableName": "cams_r_1", + "isAbout": "items/cams_r_1", + "isVis": true + }, + { + "variableName": "cams_r_2", + "isAbout": "items/cams_r_2", + "isVis": true + }, + { + "variableName": "cams_r_3", + "isAbout": "items/cams_r_3", + "isVis": true + }, + { + "variableName": "cams_r_4", + "isAbout": "items/cams_r_4", + "isVis": true + }, + { + "variableName": "cams_r_5", + "isAbout": "items/cams_r_5", + "isVis": true + }, + { + "variableName": "cams_r_6", + "isAbout": "items/cams_r_6", + "isVis": true + }, + { + "variableName": "cams_r_7", + "isAbout": "items/cams_r_7", + "isVis": true + }, + { + "variableName": "cams_r_8", + "isAbout": "items/cams_r_8", + "isVis": true + }, + { + "variableName": "cams_r_9", + "isAbout": "items/cams_r_9", + "isVis": true + }, + { + "variableName": "cams_r_10", + "isAbout": "items/cams_r_10", + "isVis": true + }, + { + "variableName": "cams_r_11", + "isAbout": "items/cams_r_11", + "isVis": true + }, + { + "variableName": "cams_r_12", + "isAbout": "items/cams_r_12", + "isVis": true + } + ], + "shuffle": false + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_1 b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_1 new file mode 100644 index 0000000..433ff0b --- /dev/null +++ b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_1 @@ -0,0 +1,37 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "cams_r_1", + "prefLabel": "cams_r_1", + "description": "cams_r_1 of cognitive_and_affective_mindfulness_scalerevised_c", + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "choices": [ + { + "name": "1 - Rarely/Not at all ", + "value": 1 + }, + { + "name": "2 - Sometimes ", + "value": 2 + }, + { + "name": "3 - Often ", + "value": 3 + }, + { + "name": "4 - Almost Always", + "value": 4 + } + ] + }, + "preamble": { + "en": "Instructions: People have a variety of ways of relating to their thoughts and feelings. For each of the items below, rate how much each of these ways applies to you." + }, + "question": { + "en": "1. It is easy for me to concentrate on what I am doing." + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_10 b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_10 new file mode 100644 index 0000000..2d39b9e --- /dev/null +++ b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_10 @@ -0,0 +1,34 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "cams_r_10", + "prefLabel": "cams_r_10", + "description": "cams_r_10 of cognitive_and_affective_mindfulness_scalerevised_c", + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "choices": [ + { + "name": "1 - Rarely/Not at all ", + "value": 1 + }, + { + "name": "2 - Sometimes ", + "value": 2 + }, + { + "name": "3 - Often ", + "value": 3 + }, + { + "name": "4 - Almost Always", + "value": 4 + } + ] + }, + "question": { + "en": "10. I am able to accept the thoughts and feelings I have." + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_11 b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_11 new file mode 100644 index 0000000..cd236fb --- /dev/null +++ b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_11 @@ -0,0 +1,34 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "cams_r_11", + "prefLabel": "cams_r_11", + "description": "cams_r_11 of cognitive_and_affective_mindfulness_scalerevised_c", + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "choices": [ + { + "name": "1 - Rarely/Not at all ", + "value": 1 + }, + { + "name": "2 - Sometimes ", + "value": 2 + }, + { + "name": "3 - Often ", + "value": 3 + }, + { + "name": "4 - Almost Always", + "value": 4 + } + ] + }, + "question": { + "en": "11. I am able to focus on the present moment." + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_12 b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_12 new file mode 100644 index 0000000..69c0020 --- /dev/null +++ b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_12 @@ -0,0 +1,34 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "cams_r_12", + "prefLabel": "cams_r_12", + "description": "cams_r_12 of cognitive_and_affective_mindfulness_scalerevised_c", + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "choices": [ + { + "name": "1 - Rarely/Not at all ", + "value": 1 + }, + { + "name": "2 - Sometimes ", + "value": 2 + }, + { + "name": "3 - Often ", + "value": 3 + }, + { + "name": "4 - Almost Always", + "value": 4 + } + ] + }, + "question": { + "en": "12. I am able to pay close attention to one thing for a long period of time." + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_2 b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_2 new file mode 100644 index 0000000..701fe6f --- /dev/null +++ b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_2 @@ -0,0 +1,34 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "cams_r_2", + "prefLabel": "cams_r_2", + "description": "cams_r_2 of cognitive_and_affective_mindfulness_scalerevised_c", + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "choices": [ + { + "name": "1 - Rarely/Not at all ", + "value": 1 + }, + { + "name": "2 - Sometimes ", + "value": 2 + }, + { + "name": "3 - Often ", + "value": 3 + }, + { + "name": "4 - Almost Always", + "value": 4 + } + ] + }, + "question": { + "en": "2. I am preoccupied by the future." + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_3 b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_3 new file mode 100644 index 0000000..3bf5196 --- /dev/null +++ b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_3 @@ -0,0 +1,34 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "cams_r_3", + "prefLabel": "cams_r_3", + "description": "cams_r_3 of cognitive_and_affective_mindfulness_scalerevised_c", + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "choices": [ + { + "name": "1 - Rarely/Not at all ", + "value": 1 + }, + { + "name": "2 - Sometimes ", + "value": 2 + }, + { + "name": "3 - Often ", + "value": 3 + }, + { + "name": "4 - Almost Always", + "value": 4 + } + ] + }, + "question": { + "en": "3. I can tolerate emotional pain." + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_4 b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_4 new file mode 100644 index 0000000..85598a5 --- /dev/null +++ b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_4 @@ -0,0 +1,34 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "cams_r_4", + "prefLabel": "cams_r_4", + "description": "cams_r_4 of cognitive_and_affective_mindfulness_scalerevised_c", + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "choices": [ + { + "name": "1 - Rarely/Not at all ", + "value": 1 + }, + { + "name": "2 - Sometimes ", + "value": 2 + }, + { + "name": "3 - Often ", + "value": 3 + }, + { + "name": "4 - Almost Always", + "value": 4 + } + ] + }, + "question": { + "en": "4. I can accept things I cannot change." + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_5 b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_5 new file mode 100644 index 0000000..8df3dc3 --- /dev/null +++ b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_5 @@ -0,0 +1,34 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "cams_r_5", + "prefLabel": "cams_r_5", + "description": "cams_r_5 of cognitive_and_affective_mindfulness_scalerevised_c", + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "choices": [ + { + "name": "1 - Rarely/Not at all ", + "value": 1 + }, + { + "name": "2 - Sometimes ", + "value": 2 + }, + { + "name": "3 - Often ", + "value": 3 + }, + { + "name": "4 - Almost Always", + "value": 4 + } + ] + }, + "question": { + "en": "5. I can usually describe how I feel at the moment in considerable detail." + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_6 b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_6 new file mode 100644 index 0000000..ee98bb5 --- /dev/null +++ b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_6 @@ -0,0 +1,34 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "cams_r_6", + "prefLabel": "cams_r_6", + "description": "cams_r_6 of cognitive_and_affective_mindfulness_scalerevised_c", + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "choices": [ + { + "name": "1 - Rarely/Not at all ", + "value": 1 + }, + { + "name": "2 - Sometimes ", + "value": 2 + }, + { + "name": "3 - Often ", + "value": 3 + }, + { + "name": "4 - Almost Always", + "value": 4 + } + ] + }, + "question": { + "en": "6. I am easily distracted." + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_7 b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_7 new file mode 100644 index 0000000..8f264e2 --- /dev/null +++ b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_7 @@ -0,0 +1,34 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "cams_r_7", + "prefLabel": "cams_r_7", + "description": "cams_r_7 of cognitive_and_affective_mindfulness_scalerevised_c", + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "choices": [ + { + "name": "1 - Rarely/Not at all ", + "value": 1 + }, + { + "name": "2 - Sometimes ", + "value": 2 + }, + { + "name": "3 - Often ", + "value": 3 + }, + { + "name": "4 - Almost Always", + "value": 4 + } + ] + }, + "question": { + "en": "7. I am preoccupied by the past." + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_8 b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_8 new file mode 100644 index 0000000..7bae21c --- /dev/null +++ b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_8 @@ -0,0 +1,34 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "cams_r_8", + "prefLabel": "cams_r_8", + "description": "cams_r_8 of cognitive_and_affective_mindfulness_scalerevised_c", + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "choices": [ + { + "name": "1 - Rarely/Not at all ", + "value": 1 + }, + { + "name": "2 - Sometimes ", + "value": 2 + }, + { + "name": "3 - Often ", + "value": 3 + }, + { + "name": "4 - Almost Always", + "value": 4 + } + ] + }, + "question": { + "en": "8. It's easy for me to keep track of my thoughts and feelings." + } +} \ No newline at end of file diff --git a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_9 b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_9 new file mode 100644 index 0000000..2b628a7 --- /dev/null +++ b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_9 @@ -0,0 +1,34 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Item", + "@id": "cams_r_9", + "prefLabel": "cams_r_9", + "description": "cams_r_9 of cognitive_and_affective_mindfulness_scalerevised_c", + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "choices": [ + { + "name": "1 - Rarely/Not at all ", + "value": 1 + }, + { + "name": "2 - Sometimes ", + "value": 2 + }, + { + "name": "3 - Often ", + "value": 3 + }, + { + "name": "4 - Almost Always", + "value": 4 + } + ] + }, + "question": { + "en": "9. I try to notice my thoughts without judging them." + } +} \ No newline at end of file diff --git a/test_redcap2rs/test_redcap2rs/test_redcap2rs_schema b/test_redcap2rs/test_redcap2rs/test_redcap2rs_schema new file mode 100644 index 0000000..423c39b --- /dev/null +++ b/test_redcap2rs/test_redcap2rs/test_redcap2rs_schema @@ -0,0 +1,31 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", + "@type": "reproschema:Protocol", + "@id": "test_redcap2rs_schema", + "prefLabel": "redcap protocols", + "altLabel": "test_redcap2rs_schema", + "description": "testing", + "schemaVersion": "1.0.0-rc4", + "version": "3.0.0", + "ui": { + "addProperties": [ + { + "isAbout": "../activities/autism_parenting_stress_index_apsi/autism_parenting_stress_index_apsi_schema", + "variableName": "autism_parenting_stress_index_apsi_schema", + "prefLabel": "Autism Parenting Stress Index Apsi", + "isVis": true + }, + { + "isAbout": "../activities/cognitive_and_affective_mindfulness_scalerevised_c/cognitive_and_affective_mindfulness_scalerevised_c_schema", + "variableName": "cognitive_and_affective_mindfulness_scalerevised_c_schema", + "prefLabel": "Cognitive And Affective Mindfulness Scalerevised C", + "isVis": true + } + ], + "order": [ + "../activities/autism_parenting_stress_index_apsi/autism_parenting_stress_index_apsi_schema", + "../activities/cognitive_and_affective_mindfulness_scalerevised_c/cognitive_and_affective_mindfulness_scalerevised_c_schema" + ], + "shuffle": false + } +} \ No newline at end of file From a60612fc96369c1bcdeb1655aee2a02355eb7810 Mon Sep 17 00:00:00 2001 From: yibeichan Date: Sat, 20 Apr 2024 21:34:38 -0400 Subject: [PATCH 13/16] remove test output --- .../autism_parenting_stress_index_apsi_schema | 124 ------------------ .../items/apsi_accepted | 38 ------ .../items/apsi_agressive | 38 ------ .../items/apsi_bowel | 38 ------ .../items/apsi_communicate | 38 ------ .../items/apsi_date | 19 --- .../items/apsi_diet | 38 ------ .../items/apsi_independently | 38 ------ .../items/apsi_name_of_child | 16 --- .../items/apsi_not_close | 38 ------ .../items/apsi_person_completing | 16 --- .../items/apsi_potty | 38 ------ .../items/apsi_self_injure | 38 ------ .../items/apsi_sleep | 38 ------ .../items/apsi_social_dev | 41 ------ .../items/apsi_tantrums | 38 ------ .../items/apsi_total | 16 --- .../items/apsi_transitions | 38 ------ .../items/record_id | 16 --- ...ffective_mindfulness_scalerevised_c_schema | 88 ------------- .../items/cams_r_1 | 37 ------ .../items/cams_r_10 | 34 ----- .../items/cams_r_11 | 34 ----- .../items/cams_r_12 | 34 ----- .../items/cams_r_2 | 34 ----- .../items/cams_r_3 | 34 ----- .../items/cams_r_4 | 34 ----- .../items/cams_r_5 | 34 ----- .../items/cams_r_6 | 34 ----- .../items/cams_r_7 | 34 ----- .../items/cams_r_8 | 34 ----- .../items/cams_r_9 | 34 ----- .../test_redcap2rs/test_redcap2rs_schema | 31 ----- 33 files changed, 1234 deletions(-) delete mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/autism_parenting_stress_index_apsi_schema delete mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_accepted delete mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_agressive delete mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_bowel delete mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_communicate delete mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_date delete mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_diet delete mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_independently delete mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_name_of_child delete mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_not_close delete mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_person_completing delete mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_potty delete mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_self_injure delete mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_sleep delete mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_social_dev delete mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_tantrums delete mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_total delete mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_transitions delete mode 100644 test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/record_id delete mode 100644 test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/cognitive_and_affective_mindfulness_scalerevised_c_schema delete mode 100644 test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_1 delete mode 100644 test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_10 delete mode 100644 test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_11 delete mode 100644 test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_12 delete mode 100644 test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_2 delete mode 100644 test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_3 delete mode 100644 test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_4 delete mode 100644 test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_5 delete mode 100644 test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_6 delete mode 100644 test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_7 delete mode 100644 test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_8 delete mode 100644 test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_9 delete mode 100644 test_redcap2rs/test_redcap2rs/test_redcap2rs_schema diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/autism_parenting_stress_index_apsi_schema b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/autism_parenting_stress_index_apsi_schema deleted file mode 100644 index fff03c4..0000000 --- a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/autism_parenting_stress_index_apsi_schema +++ /dev/null @@ -1,124 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Activity", - "@id": "autism_parenting_stress_index_apsi_schema", - "prefLabel": "autism_parenting_stress_index_apsi", - "description": "Default description", - "schemaVersion": "1.0.0-rc4", - "version": "3.0.0", - "ui": { - "order": [ - "items/record_id", - "items/apsi_date", - "items/apsi_name_of_child", - "items/apsi_person_completing", - "items/apsi_social_dev", - "items/apsi_communicate", - "items/apsi_tantrums", - "items/apsi_agressive", - "items/apsi_self_injure", - "items/apsi_transitions", - "items/apsi_sleep", - "items/apsi_diet", - "items/apsi_bowel", - "items/apsi_potty", - "items/apsi_not_close", - "items/apsi_accepted", - "items/apsi_independently", - "items/apsi_total" - ], - "addProperties": [ - { - "variableName": "record_id", - "isAbout": "items/record_id", - "isVis": true - }, - { - "variableName": "apsi_date", - "isAbout": "items/apsi_date", - "isVis": true - }, - { - "variableName": "apsi_name_of_child", - "isAbout": "items/apsi_name_of_child", - "isVis": true - }, - { - "variableName": "apsi_person_completing", - "isAbout": "items/apsi_person_completing", - "isVis": true - }, - { - "variableName": "apsi_social_dev", - "isAbout": "items/apsi_social_dev", - "isVis": true - }, - { - "variableName": "apsi_communicate", - "isAbout": "items/apsi_communicate", - "isVis": true - }, - { - "variableName": "apsi_tantrums", - "isAbout": "items/apsi_tantrums", - "isVis": true - }, - { - "variableName": "apsi_agressive", - "isAbout": "items/apsi_agressive", - "isVis": true - }, - { - "variableName": "apsi_self_injure", - "isAbout": "items/apsi_self_injure", - "isVis": true - }, - { - "variableName": "apsi_transitions", - "isAbout": "items/apsi_transitions", - "isVis": true - }, - { - "variableName": "apsi_sleep", - "isAbout": "items/apsi_sleep", - "isVis": true - }, - { - "variableName": "apsi_diet", - "isAbout": "items/apsi_diet", - "isVis": true - }, - { - "variableName": "apsi_bowel", - "isAbout": "items/apsi_bowel", - "isVis": true - }, - { - "variableName": "apsi_potty", - "isAbout": "items/apsi_potty", - "isVis": true - }, - { - "variableName": "apsi_not_close", - "isAbout": "items/apsi_not_close", - "isVis": true - }, - { - "variableName": "apsi_accepted", - "isAbout": "items/apsi_accepted", - "isVis": true - }, - { - "variableName": "apsi_independently", - "isAbout": "items/apsi_independently", - "isVis": true - }, - { - "variableName": "apsi_total", - "isAbout": "items/apsi_total", - "isVis": true - } - ], - "shuffle": false - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_accepted b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_accepted deleted file mode 100644 index 5833f48..0000000 --- a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_accepted +++ /dev/null @@ -1,38 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "apsi_accepted", - "prefLabel": "apsi_accepted", - "description": "apsi_accepted of autism_parenting_stress_index_apsi", - "ui": { - "inputType": "radio" - }, - "responseOptions": { - "valueType": "xsd:integer", - "choices": [ - { - "name": "0 - Not stressful ", - "value": 0 - }, - { - "name": "1 - Sometimes creates stress ", - "value": 1 - }, - { - "name": "2 - Often creates stress ", - "value": 2 - }, - { - "name": "3 - Very stressful on a daily basis ", - "value": 3 - }, - { - "name": "5 - So stressful sometimes we feel we can't cope", - "value": 5 - } - ] - }, - "question": { - "en": "Concern for the future of your child being accepted by others" - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_agressive b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_agressive deleted file mode 100644 index 8717b1b..0000000 --- a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_agressive +++ /dev/null @@ -1,38 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "apsi_agressive", - "prefLabel": "apsi_agressive", - "description": "apsi_agressive of autism_parenting_stress_index_apsi", - "ui": { - "inputType": "radio" - }, - "responseOptions": { - "valueType": "xsd:integer", - "choices": [ - { - "name": "0 - Not stressful ", - "value": 0 - }, - { - "name": "1 - Sometimes creates stress ", - "value": 1 - }, - { - "name": "2 - Often creates stress ", - "value": 2 - }, - { - "name": "3 - Very stressful on a daily basis ", - "value": 3 - }, - { - "name": "5 - So stressful sometimes we feel we can't cope", - "value": 5 - } - ] - }, - "question": { - "en": "Aggressive behavior (siblings, peers)" - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_bowel b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_bowel deleted file mode 100644 index 7b06f0f..0000000 --- a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_bowel +++ /dev/null @@ -1,38 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "apsi_bowel", - "prefLabel": "apsi_bowel", - "description": "apsi_bowel of autism_parenting_stress_index_apsi", - "ui": { - "inputType": "radio" - }, - "responseOptions": { - "valueType": "xsd:integer", - "choices": [ - { - "name": "0 - Not stressful ", - "value": 0 - }, - { - "name": "1 - Sometimes creates stress ", - "value": 1 - }, - { - "name": "2 - Often creates stress ", - "value": 2 - }, - { - "name": "3 - Very stressful on a daily basis ", - "value": 3 - }, - { - "name": "5 - So stressful sometimes we feel we can't cope", - "value": 5 - } - ] - }, - "question": { - "en": "Bowel problems (diarrhea, constipation)" - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_communicate b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_communicate deleted file mode 100644 index cc0bada..0000000 --- a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_communicate +++ /dev/null @@ -1,38 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "apsi_communicate", - "prefLabel": "apsi_communicate", - "description": "apsi_communicate of autism_parenting_stress_index_apsi", - "ui": { - "inputType": "radio" - }, - "responseOptions": { - "valueType": "xsd:integer", - "choices": [ - { - "name": "0 - Not stressful ", - "value": 0 - }, - { - "name": "1 - Sometimes creates stress ", - "value": 1 - }, - { - "name": "2 - Often creates stress ", - "value": 2 - }, - { - "name": "3 - Very stressful on a daily basis ", - "value": 3 - }, - { - "name": "5 - So stressful sometimes we feel we can't cope", - "value": 5 - } - ] - }, - "question": { - "en": "Your child's ability to communicate" - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_date b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_date deleted file mode 100644 index 4af48ba..0000000 --- a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_date +++ /dev/null @@ -1,19 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "apsi_date", - "prefLabel": "apsi_date", - "description": "apsi_date of autism_parenting_stress_index_apsi", - "ui": { - "inputType": "text" - }, - "responseOptions": { - "valueType": "xsd:string" - }, - "preamble": { - "en": "Autism Parenting Stress Index for the Qigong Sensory Training Program Instructions: 1. Before beginning Qigong Sensory Training therapy with your child, complete the form on the following page. 2. Enter the date, name of your child, and who is completing the checklist. (It is very important that the same parent/caretaker complete the form each time the form is used.) 3. Choose the response for each item that most accurately describes your child. 4. Add all of the numbers chosen. 5. Enter total into the space provided. After using Qigong Sensory Training therapy on your child once a day for a five months, have the same parent complete the form again. Total numbers circled. Compare this number to the number at the beginning. If Qigong Sensory Training therapy is being implemented successfully, the total number should decrease over time." - }, - "question": { - "en": "Date:" - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_diet b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_diet deleted file mode 100644 index f1bb04c..0000000 --- a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_diet +++ /dev/null @@ -1,38 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "apsi_diet", - "prefLabel": "apsi_diet", - "description": "apsi_diet of autism_parenting_stress_index_apsi", - "ui": { - "inputType": "radio" - }, - "responseOptions": { - "valueType": "xsd:integer", - "choices": [ - { - "name": "0 - Not stressful ", - "value": 0 - }, - { - "name": "1 - Sometimes creates stress ", - "value": 1 - }, - { - "name": "2 - Often creates stress ", - "value": 2 - }, - { - "name": "3 - Very stressful on a daily basis ", - "value": 3 - }, - { - "name": "5 - So stressful sometimes we feel we can't cope", - "value": 5 - } - ] - }, - "question": { - "en": "Your child's diet" - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_independently b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_independently deleted file mode 100644 index 0389638..0000000 --- a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_independently +++ /dev/null @@ -1,38 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "apsi_independently", - "prefLabel": "apsi_independently", - "description": "apsi_independently of autism_parenting_stress_index_apsi", - "ui": { - "inputType": "radio" - }, - "responseOptions": { - "valueType": "xsd:integer", - "choices": [ - { - "name": "0 - Not stressful ", - "value": 0 - }, - { - "name": "1 - Sometimes creates stress ", - "value": 1 - }, - { - "name": "2 - Often creates stress ", - "value": 2 - }, - { - "name": "3 - Very stressful on a daily basis ", - "value": 3 - }, - { - "name": "5 - So stressful sometimes we feel we can't cope", - "value": 5 - } - ] - }, - "question": { - "en": "Concern for the future of your child living independently" - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_name_of_child b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_name_of_child deleted file mode 100644 index 195af9a..0000000 --- a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_name_of_child +++ /dev/null @@ -1,16 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "apsi_name_of_child", - "prefLabel": "apsi_name_of_child", - "description": "apsi_name_of_child of autism_parenting_stress_index_apsi", - "ui": { - "inputType": "text" - }, - "responseOptions": { - "valueType": "xsd:string" - }, - "question": { - "en": "Name of child:" - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_not_close b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_not_close deleted file mode 100644 index a2b8fa7..0000000 --- a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_not_close +++ /dev/null @@ -1,38 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "apsi_not_close", - "prefLabel": "apsi_not_close", - "description": "apsi_not_close of autism_parenting_stress_index_apsi", - "ui": { - "inputType": "radio" - }, - "responseOptions": { - "valueType": "xsd:integer", - "choices": [ - { - "name": "0 - Not stressful ", - "value": 0 - }, - { - "name": "1 - Sometimes creates stress ", - "value": 1 - }, - { - "name": "2 - Often creates stress ", - "value": 2 - }, - { - "name": "3 - Very stressful on a daily basis ", - "value": 3 - }, - { - "name": "5 - So stressful sometimes we feel we can't cope", - "value": 5 - } - ] - }, - "question": { - "en": "Not feeling close to your child" - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_person_completing b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_person_completing deleted file mode 100644 index 76cfd23..0000000 --- a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_person_completing +++ /dev/null @@ -1,16 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "apsi_person_completing", - "prefLabel": "apsi_person_completing", - "description": "apsi_person_completing of autism_parenting_stress_index_apsi", - "ui": { - "inputType": "text" - }, - "responseOptions": { - "valueType": "xsd:string" - }, - "question": { - "en": "Person completing checklist:" - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_potty b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_potty deleted file mode 100644 index 6640aae..0000000 --- a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_potty +++ /dev/null @@ -1,38 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "apsi_potty", - "prefLabel": "apsi_potty", - "description": "apsi_potty of autism_parenting_stress_index_apsi", - "ui": { - "inputType": "radio" - }, - "responseOptions": { - "valueType": "xsd:integer", - "choices": [ - { - "name": "0 - Not stressful ", - "value": 0 - }, - { - "name": "1 - Sometimes creates stress ", - "value": 1 - }, - { - "name": "2 - Often creates stress ", - "value": 2 - }, - { - "name": "3 - Very stressful on a daily basis ", - "value": 3 - }, - { - "name": "5 - So stressful sometimes we feel we can't cope", - "value": 5 - } - ] - }, - "question": { - "en": "Potty training" - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_self_injure b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_self_injure deleted file mode 100644 index 29d8837..0000000 --- a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_self_injure +++ /dev/null @@ -1,38 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "apsi_self_injure", - "prefLabel": "apsi_self_injure", - "description": "apsi_self_injure of autism_parenting_stress_index_apsi", - "ui": { - "inputType": "radio" - }, - "responseOptions": { - "valueType": "xsd:integer", - "choices": [ - { - "name": "0 - Not stressful ", - "value": 0 - }, - { - "name": "1 - Sometimes creates stress ", - "value": 1 - }, - { - "name": "2 - Often creates stress ", - "value": 2 - }, - { - "name": "3 - Very stressful on a daily basis ", - "value": 3 - }, - { - "name": "5 - So stressful sometimes we feel we can't cope", - "value": 5 - } - ] - }, - "question": { - "en": "Self-injurious behavior" - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_sleep b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_sleep deleted file mode 100644 index dbd01be..0000000 --- a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_sleep +++ /dev/null @@ -1,38 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "apsi_sleep", - "prefLabel": "apsi_sleep", - "description": "apsi_sleep of autism_parenting_stress_index_apsi", - "ui": { - "inputType": "radio" - }, - "responseOptions": { - "valueType": "xsd:integer", - "choices": [ - { - "name": "0 - Not stressful ", - "value": 0 - }, - { - "name": "1 - Sometimes creates stress ", - "value": 1 - }, - { - "name": "2 - Often creates stress ", - "value": 2 - }, - { - "name": "3 - Very stressful on a daily basis ", - "value": 3 - }, - { - "name": "5 - So stressful sometimes we feel we can't cope", - "value": 5 - } - ] - }, - "question": { - "en": "Sleep problems" - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_social_dev b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_social_dev deleted file mode 100644 index 333be63..0000000 --- a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_social_dev +++ /dev/null @@ -1,41 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "apsi_social_dev", - "prefLabel": "apsi_social_dev", - "description": "apsi_social_dev of autism_parenting_stress_index_apsi", - "ui": { - "inputType": "radio" - }, - "responseOptions": { - "valueType": "xsd:integer", - "choices": [ - { - "name": "0 - Not stressful ", - "value": 0 - }, - { - "name": "1 - Sometimes creates stress ", - "value": 1 - }, - { - "name": "2 - Often creates stress ", - "value": 2 - }, - { - "name": "3 - Very stressful on a daily basis ", - "value": 3 - }, - { - "name": "5 - So stressful sometimes we feel we can't cope", - "value": 5 - } - ] - }, - "preamble": { - "en": "Stress Ratings Please rate the following aspects of your child'shealth according to how much stress it causes you and/or your familyby clicking on the button that best describes your situation." - }, - "question": { - "en": "Your child's social development" - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_tantrums b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_tantrums deleted file mode 100644 index e07f99d..0000000 --- a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_tantrums +++ /dev/null @@ -1,38 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "apsi_tantrums", - "prefLabel": "apsi_tantrums", - "description": "apsi_tantrums of autism_parenting_stress_index_apsi", - "ui": { - "inputType": "radio" - }, - "responseOptions": { - "valueType": "xsd:integer", - "choices": [ - { - "name": "0 - Not stressful ", - "value": 0 - }, - { - "name": "1 - Sometimes creates stress ", - "value": 1 - }, - { - "name": "2 - Often creates stress ", - "value": 2 - }, - { - "name": "3 - Very stressful on a daily basis ", - "value": 3 - }, - { - "name": "5 - So stressful sometimes we feel we can't cope", - "value": 5 - } - ] - }, - "question": { - "en": "Tantrums/meltdowns" - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_total b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_total deleted file mode 100644 index 15328ec..0000000 --- a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_total +++ /dev/null @@ -1,16 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "apsi_total", - "prefLabel": "apsi_total", - "description": "apsi_total of autism_parenting_stress_index_apsi", - "ui": { - "inputType": "text" - }, - "responseOptions": { - "valueType": "xsd:string" - }, - "question": { - "en": "Total" - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_transitions b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_transitions deleted file mode 100644 index ce9782c..0000000 --- a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/apsi_transitions +++ /dev/null @@ -1,38 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "apsi_transitions", - "prefLabel": "apsi_transitions", - "description": "apsi_transitions of autism_parenting_stress_index_apsi", - "ui": { - "inputType": "radio" - }, - "responseOptions": { - "valueType": "xsd:integer", - "choices": [ - { - "name": "0 - Not stressful ", - "value": 0 - }, - { - "name": "1 - Sometimes creates stress ", - "value": 1 - }, - { - "name": "2 - Often creates stress ", - "value": 2 - }, - { - "name": "3 - Very stressful on a daily basis ", - "value": 3 - }, - { - "name": "5 - So stressful sometimes we feel we can't cope", - "value": 5 - } - ] - }, - "question": { - "en": "Difficulty making transitions from one activity to another" - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/record_id b/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/record_id deleted file mode 100644 index 3971398..0000000 --- a/test_redcap2rs/activities/autism_parenting_stress_index_apsi/items/record_id +++ /dev/null @@ -1,16 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "record_id", - "prefLabel": "record_id", - "description": "record_id of autism_parenting_stress_index_apsi", - "ui": { - "inputType": "text" - }, - "responseOptions": { - "valueType": "xsd:string" - }, - "question": { - "en": "Record ID" - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/cognitive_and_affective_mindfulness_scalerevised_c_schema b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/cognitive_and_affective_mindfulness_scalerevised_c_schema deleted file mode 100644 index ed06073..0000000 --- a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/cognitive_and_affective_mindfulness_scalerevised_c_schema +++ /dev/null @@ -1,88 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Activity", - "@id": "cognitive_and_affective_mindfulness_scalerevised_c_schema", - "prefLabel": "cognitive_and_affective_mindfulness_scalerevised_c", - "description": "Default description", - "schemaVersion": "1.0.0-rc4", - "version": "3.0.0", - "ui": { - "order": [ - "items/cams_r_1", - "items/cams_r_2", - "items/cams_r_3", - "items/cams_r_4", - "items/cams_r_5", - "items/cams_r_6", - "items/cams_r_7", - "items/cams_r_8", - "items/cams_r_9", - "items/cams_r_10", - "items/cams_r_11", - "items/cams_r_12" - ], - "addProperties": [ - { - "variableName": "cams_r_1", - "isAbout": "items/cams_r_1", - "isVis": true - }, - { - "variableName": "cams_r_2", - "isAbout": "items/cams_r_2", - "isVis": true - }, - { - "variableName": "cams_r_3", - "isAbout": "items/cams_r_3", - "isVis": true - }, - { - "variableName": "cams_r_4", - "isAbout": "items/cams_r_4", - "isVis": true - }, - { - "variableName": "cams_r_5", - "isAbout": "items/cams_r_5", - "isVis": true - }, - { - "variableName": "cams_r_6", - "isAbout": "items/cams_r_6", - "isVis": true - }, - { - "variableName": "cams_r_7", - "isAbout": "items/cams_r_7", - "isVis": true - }, - { - "variableName": "cams_r_8", - "isAbout": "items/cams_r_8", - "isVis": true - }, - { - "variableName": "cams_r_9", - "isAbout": "items/cams_r_9", - "isVis": true - }, - { - "variableName": "cams_r_10", - "isAbout": "items/cams_r_10", - "isVis": true - }, - { - "variableName": "cams_r_11", - "isAbout": "items/cams_r_11", - "isVis": true - }, - { - "variableName": "cams_r_12", - "isAbout": "items/cams_r_12", - "isVis": true - } - ], - "shuffle": false - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_1 b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_1 deleted file mode 100644 index 433ff0b..0000000 --- a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_1 +++ /dev/null @@ -1,37 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "cams_r_1", - "prefLabel": "cams_r_1", - "description": "cams_r_1 of cognitive_and_affective_mindfulness_scalerevised_c", - "ui": { - "inputType": "radio" - }, - "responseOptions": { - "valueType": "xsd:integer", - "choices": [ - { - "name": "1 - Rarely/Not at all ", - "value": 1 - }, - { - "name": "2 - Sometimes ", - "value": 2 - }, - { - "name": "3 - Often ", - "value": 3 - }, - { - "name": "4 - Almost Always", - "value": 4 - } - ] - }, - "preamble": { - "en": "Instructions: People have a variety of ways of relating to their thoughts and feelings. For each of the items below, rate how much each of these ways applies to you." - }, - "question": { - "en": "1. It is easy for me to concentrate on what I am doing." - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_10 b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_10 deleted file mode 100644 index 2d39b9e..0000000 --- a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_10 +++ /dev/null @@ -1,34 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "cams_r_10", - "prefLabel": "cams_r_10", - "description": "cams_r_10 of cognitive_and_affective_mindfulness_scalerevised_c", - "ui": { - "inputType": "radio" - }, - "responseOptions": { - "valueType": "xsd:integer", - "choices": [ - { - "name": "1 - Rarely/Not at all ", - "value": 1 - }, - { - "name": "2 - Sometimes ", - "value": 2 - }, - { - "name": "3 - Often ", - "value": 3 - }, - { - "name": "4 - Almost Always", - "value": 4 - } - ] - }, - "question": { - "en": "10. I am able to accept the thoughts and feelings I have." - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_11 b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_11 deleted file mode 100644 index cd236fb..0000000 --- a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_11 +++ /dev/null @@ -1,34 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "cams_r_11", - "prefLabel": "cams_r_11", - "description": "cams_r_11 of cognitive_and_affective_mindfulness_scalerevised_c", - "ui": { - "inputType": "radio" - }, - "responseOptions": { - "valueType": "xsd:integer", - "choices": [ - { - "name": "1 - Rarely/Not at all ", - "value": 1 - }, - { - "name": "2 - Sometimes ", - "value": 2 - }, - { - "name": "3 - Often ", - "value": 3 - }, - { - "name": "4 - Almost Always", - "value": 4 - } - ] - }, - "question": { - "en": "11. I am able to focus on the present moment." - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_12 b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_12 deleted file mode 100644 index 69c0020..0000000 --- a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_12 +++ /dev/null @@ -1,34 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "cams_r_12", - "prefLabel": "cams_r_12", - "description": "cams_r_12 of cognitive_and_affective_mindfulness_scalerevised_c", - "ui": { - "inputType": "radio" - }, - "responseOptions": { - "valueType": "xsd:integer", - "choices": [ - { - "name": "1 - Rarely/Not at all ", - "value": 1 - }, - { - "name": "2 - Sometimes ", - "value": 2 - }, - { - "name": "3 - Often ", - "value": 3 - }, - { - "name": "4 - Almost Always", - "value": 4 - } - ] - }, - "question": { - "en": "12. I am able to pay close attention to one thing for a long period of time." - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_2 b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_2 deleted file mode 100644 index 701fe6f..0000000 --- a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_2 +++ /dev/null @@ -1,34 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "cams_r_2", - "prefLabel": "cams_r_2", - "description": "cams_r_2 of cognitive_and_affective_mindfulness_scalerevised_c", - "ui": { - "inputType": "radio" - }, - "responseOptions": { - "valueType": "xsd:integer", - "choices": [ - { - "name": "1 - Rarely/Not at all ", - "value": 1 - }, - { - "name": "2 - Sometimes ", - "value": 2 - }, - { - "name": "3 - Often ", - "value": 3 - }, - { - "name": "4 - Almost Always", - "value": 4 - } - ] - }, - "question": { - "en": "2. I am preoccupied by the future." - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_3 b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_3 deleted file mode 100644 index 3bf5196..0000000 --- a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_3 +++ /dev/null @@ -1,34 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "cams_r_3", - "prefLabel": "cams_r_3", - "description": "cams_r_3 of cognitive_and_affective_mindfulness_scalerevised_c", - "ui": { - "inputType": "radio" - }, - "responseOptions": { - "valueType": "xsd:integer", - "choices": [ - { - "name": "1 - Rarely/Not at all ", - "value": 1 - }, - { - "name": "2 - Sometimes ", - "value": 2 - }, - { - "name": "3 - Often ", - "value": 3 - }, - { - "name": "4 - Almost Always", - "value": 4 - } - ] - }, - "question": { - "en": "3. I can tolerate emotional pain." - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_4 b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_4 deleted file mode 100644 index 85598a5..0000000 --- a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_4 +++ /dev/null @@ -1,34 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "cams_r_4", - "prefLabel": "cams_r_4", - "description": "cams_r_4 of cognitive_and_affective_mindfulness_scalerevised_c", - "ui": { - "inputType": "radio" - }, - "responseOptions": { - "valueType": "xsd:integer", - "choices": [ - { - "name": "1 - Rarely/Not at all ", - "value": 1 - }, - { - "name": "2 - Sometimes ", - "value": 2 - }, - { - "name": "3 - Often ", - "value": 3 - }, - { - "name": "4 - Almost Always", - "value": 4 - } - ] - }, - "question": { - "en": "4. I can accept things I cannot change." - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_5 b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_5 deleted file mode 100644 index 8df3dc3..0000000 --- a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_5 +++ /dev/null @@ -1,34 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "cams_r_5", - "prefLabel": "cams_r_5", - "description": "cams_r_5 of cognitive_and_affective_mindfulness_scalerevised_c", - "ui": { - "inputType": "radio" - }, - "responseOptions": { - "valueType": "xsd:integer", - "choices": [ - { - "name": "1 - Rarely/Not at all ", - "value": 1 - }, - { - "name": "2 - Sometimes ", - "value": 2 - }, - { - "name": "3 - Often ", - "value": 3 - }, - { - "name": "4 - Almost Always", - "value": 4 - } - ] - }, - "question": { - "en": "5. I can usually describe how I feel at the moment in considerable detail." - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_6 b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_6 deleted file mode 100644 index ee98bb5..0000000 --- a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_6 +++ /dev/null @@ -1,34 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "cams_r_6", - "prefLabel": "cams_r_6", - "description": "cams_r_6 of cognitive_and_affective_mindfulness_scalerevised_c", - "ui": { - "inputType": "radio" - }, - "responseOptions": { - "valueType": "xsd:integer", - "choices": [ - { - "name": "1 - Rarely/Not at all ", - "value": 1 - }, - { - "name": "2 - Sometimes ", - "value": 2 - }, - { - "name": "3 - Often ", - "value": 3 - }, - { - "name": "4 - Almost Always", - "value": 4 - } - ] - }, - "question": { - "en": "6. I am easily distracted." - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_7 b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_7 deleted file mode 100644 index 8f264e2..0000000 --- a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_7 +++ /dev/null @@ -1,34 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "cams_r_7", - "prefLabel": "cams_r_7", - "description": "cams_r_7 of cognitive_and_affective_mindfulness_scalerevised_c", - "ui": { - "inputType": "radio" - }, - "responseOptions": { - "valueType": "xsd:integer", - "choices": [ - { - "name": "1 - Rarely/Not at all ", - "value": 1 - }, - { - "name": "2 - Sometimes ", - "value": 2 - }, - { - "name": "3 - Often ", - "value": 3 - }, - { - "name": "4 - Almost Always", - "value": 4 - } - ] - }, - "question": { - "en": "7. I am preoccupied by the past." - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_8 b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_8 deleted file mode 100644 index 7bae21c..0000000 --- a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_8 +++ /dev/null @@ -1,34 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "cams_r_8", - "prefLabel": "cams_r_8", - "description": "cams_r_8 of cognitive_and_affective_mindfulness_scalerevised_c", - "ui": { - "inputType": "radio" - }, - "responseOptions": { - "valueType": "xsd:integer", - "choices": [ - { - "name": "1 - Rarely/Not at all ", - "value": 1 - }, - { - "name": "2 - Sometimes ", - "value": 2 - }, - { - "name": "3 - Often ", - "value": 3 - }, - { - "name": "4 - Almost Always", - "value": 4 - } - ] - }, - "question": { - "en": "8. It's easy for me to keep track of my thoughts and feelings." - } -} \ No newline at end of file diff --git a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_9 b/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_9 deleted file mode 100644 index 2b628a7..0000000 --- a/test_redcap2rs/activities/cognitive_and_affective_mindfulness_scalerevised_c/items/cams_r_9 +++ /dev/null @@ -1,34 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Item", - "@id": "cams_r_9", - "prefLabel": "cams_r_9", - "description": "cams_r_9 of cognitive_and_affective_mindfulness_scalerevised_c", - "ui": { - "inputType": "radio" - }, - "responseOptions": { - "valueType": "xsd:integer", - "choices": [ - { - "name": "1 - Rarely/Not at all ", - "value": 1 - }, - { - "name": "2 - Sometimes ", - "value": 2 - }, - { - "name": "3 - Often ", - "value": 3 - }, - { - "name": "4 - Almost Always", - "value": 4 - } - ] - }, - "question": { - "en": "9. I try to notice my thoughts without judging them." - } -} \ No newline at end of file diff --git a/test_redcap2rs/test_redcap2rs/test_redcap2rs_schema b/test_redcap2rs/test_redcap2rs/test_redcap2rs_schema deleted file mode 100644 index 423c39b..0000000 --- a/test_redcap2rs/test_redcap2rs/test_redcap2rs_schema +++ /dev/null @@ -1,31 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/efb74e155c09e13aa009ea04609ba4f1152fcbc6/contexts/reproschema_new", - "@type": "reproschema:Protocol", - "@id": "test_redcap2rs_schema", - "prefLabel": "redcap protocols", - "altLabel": "test_redcap2rs_schema", - "description": "testing", - "schemaVersion": "1.0.0-rc4", - "version": "3.0.0", - "ui": { - "addProperties": [ - { - "isAbout": "../activities/autism_parenting_stress_index_apsi/autism_parenting_stress_index_apsi_schema", - "variableName": "autism_parenting_stress_index_apsi_schema", - "prefLabel": "Autism Parenting Stress Index Apsi", - "isVis": true - }, - { - "isAbout": "../activities/cognitive_and_affective_mindfulness_scalerevised_c/cognitive_and_affective_mindfulness_scalerevised_c_schema", - "variableName": "cognitive_and_affective_mindfulness_scalerevised_c_schema", - "prefLabel": "Cognitive And Affective Mindfulness Scalerevised C", - "isVis": true - } - ], - "order": [ - "../activities/autism_parenting_stress_index_apsi/autism_parenting_stress_index_apsi_schema", - "../activities/cognitive_and_affective_mindfulness_scalerevised_c/cognitive_and_affective_mindfulness_scalerevised_c_schema" - ], - "shuffle": false - } -} \ No newline at end of file From e1e847d342c1921fa422a8f96674bfcf16d860ea Mon Sep 17 00:00:00 2001 From: yibeichan Date: Sat, 20 Apr 2024 21:47:56 -0400 Subject: [PATCH 14/16] change test output directory --- reproschema/tests/test_redcap2reproschema.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/reproschema/tests/test_redcap2reproschema.py b/reproschema/tests/test_redcap2reproschema.py index 2486714..840ac4f 100644 --- a/reproschema/tests/test_redcap2reproschema.py +++ b/reproschema/tests/test_redcap2reproschema.py @@ -17,21 +17,27 @@ def test_redcap2reproschema_success(tmpdir): runner = CliRunner() - # Copy the test files to the custom temporary directory - shutil.copy(CSV_TEST_FILE, tmpdir.join(CSV_FILE_NAME)) - shutil.copy(YAML_TEST_FILE, tmpdir.join(YAML_FILE_NAME)) + # Define the paths to the CSV and YAML files in the temporary directory + temp_csv_file = tmpdir.join(CSV_FILE_NAME) + temp_yaml_file = tmpdir.join(YAML_FILE_NAME) - # Set the working directory to tmpdir + # Copy the test files to the temporary directory + shutil.copy(CSV_TEST_FILE, str(temp_csv_file)) # Convert to string + shutil.copy(YAML_TEST_FILE, str(temp_yaml_file)) # Convert to string + + # Change the current working directory to tmpdir with tmpdir.as_cwd(): # Read YAML to find the expected output directory name - with open(YAML_FILE_NAME, 'r') as file: + with open(str(temp_yaml_file), 'r') as file: # Convert to string protocol = yaml.safe_load(file) protocol_name = protocol.get("protocol_name", "").replace(" ", "_") + # Run the command with the path arguments pointing to the temp directory files result = runner.invoke( - main, ["redcap2reproschema", CSV_FILE_NAME, YAML_FILE_NAME] + main, ["redcap2reproschema", str(temp_csv_file), str(temp_yaml_file)] # Convert to string ) # Assertions - assert result.exit_code == 0 + assert result.exit_code == 0, f"The command failed to execute successfully: {result.output}" assert os.path.isdir(protocol_name), f"Expected output directory '{protocol_name}' does not exist" + print("Command output:", result.output) \ No newline at end of file From 51d30b7bd1a0203ebe28622e7eeebd3d61fa1413 Mon Sep 17 00:00:00 2001 From: yibeichan Date: Sat, 20 Apr 2024 21:54:53 -0400 Subject: [PATCH 15/16] final improvments on tests --- reproschema/redcap2reproschema.py | 3 ++- reproschema/reproschema2redcap.py | 1 - reproschema/tests/test_redcap2reproschema.py | 7 +------ reproschema/tests/test_reproschema2redcap.py | 22 ++++---------------- 4 files changed, 7 insertions(+), 26 deletions(-) diff --git a/reproschema/redcap2reproschema.py b/reproschema/redcap2reproschema.py index 799a795..253c6b5 100644 --- a/reproschema/redcap2reproschema.py +++ b/reproschema/redcap2reproschema.py @@ -16,6 +16,7 @@ def clean_header(header): cleaned_header[cleaned_key] = v return cleaned_header + def normalize_condition(condition_str): # Regular expressions for various pattern replacements re_parentheses = re.compile(r"\(([0-9]*)\)") @@ -42,6 +43,7 @@ def normalize_condition(condition_str): return condition_str.strip() + def process_visibility(data): condition = data.get("Branching Logic (Show field only if...)") if condition: @@ -94,7 +96,6 @@ def parse_field_type_and_value(field, input_type_map): return input_type, value_type - def process_choices(field_type, choices_str): if field_type not in ["radio", "dropdown"]: # Handle only radio and dropdown types return None diff --git a/reproschema/reproschema2redcap.py b/reproschema/reproschema2redcap.py index 3e1af67..ffb7eea 100644 --- a/reproschema/reproschema2redcap.py +++ b/reproschema/reproschema2redcap.py @@ -164,7 +164,6 @@ def get_csv_data(dir_path): if item_json: row_data = process_item(item_json, activity_path.stem) csv_data.append(row_data) - print(f"Processed item {item_path}") # Break after finding the first _schema file break diff --git a/reproschema/tests/test_redcap2reproschema.py b/reproschema/tests/test_redcap2reproschema.py index 840ac4f..4dff719 100644 --- a/reproschema/tests/test_redcap2reproschema.py +++ b/reproschema/tests/test_redcap2reproschema.py @@ -14,14 +14,12 @@ os.path.dirname(__file__), "test_redcap2rs_data", YAML_FILE_NAME ) -def test_redcap2reproschema_success(tmpdir): +def test_redcap2reproschema(tmpdir): runner = CliRunner() - # Define the paths to the CSV and YAML files in the temporary directory temp_csv_file = tmpdir.join(CSV_FILE_NAME) temp_yaml_file = tmpdir.join(YAML_FILE_NAME) - # Copy the test files to the temporary directory shutil.copy(CSV_TEST_FILE, str(temp_csv_file)) # Convert to string shutil.copy(YAML_TEST_FILE, str(temp_yaml_file)) # Convert to string @@ -32,12 +30,9 @@ def test_redcap2reproschema_success(tmpdir): protocol = yaml.safe_load(file) protocol_name = protocol.get("protocol_name", "").replace(" ", "_") - # Run the command with the path arguments pointing to the temp directory files result = runner.invoke( main, ["redcap2reproschema", str(temp_csv_file), str(temp_yaml_file)] # Convert to string ) - # Assertions assert result.exit_code == 0, f"The command failed to execute successfully: {result.output}" assert os.path.isdir(protocol_name), f"Expected output directory '{protocol_name}' does not exist" - print("Command output:", result.output) \ No newline at end of file diff --git a/reproschema/tests/test_reproschema2redcap.py b/reproschema/tests/test_reproschema2redcap.py index 5860121..c652d3d 100644 --- a/reproschema/tests/test_reproschema2redcap.py +++ b/reproschema/tests/test_reproschema2redcap.py @@ -5,49 +5,35 @@ from shutil import copytree, rmtree from pathlib import Path import csv -import tempfile -def test_reproschema2redcap_success(): +def test_reproschema2redcap(tmpdir): runner = CliRunner() with runner.isolated_filesystem(): - # Create a temporary directory for output - temp_dir = tempfile.mkdtemp(dir='.') - print(f"Temporary directory: {temp_dir}") # Copy necessary test data into the isolated filesystem original_data_dir = os.path.join( os.path.dirname(__file__), "test_rs2redcap_data", "test_redcap2rs" ) copytree(original_data_dir, "input_data") - input_path = Path("input_data") # Using Path object - output_csv_path = os.path.join(temp_dir, "output.csv") + input_path = Path("input_data") + output_csv_path = os.path.join(tmpdir, "output.csv") - # Invoke the reproschema2redcap command result = runner.invoke( main, ["reproschema2redcap", str(input_path), output_csv_path] ) - # Print the output for debugging print(result.output) - # Assert the expected outcomes assert result.exit_code == 0 - # Check if the output CSV file has been created assert os.path.exists(output_csv_path) - # Read and print the contents of the CSV file with open(output_csv_path, "r", encoding="utf-8") as csv_file: reader = csv.reader(csv_file) csv_contents = list(reader) - print("CSV File Contents:") - for row in csv_contents: - print(row) - # Optionally, assert conditions about the CSV contents - # For example, assert that the file has more than just headers assert len(csv_contents) > 1 # More than one row indicates content beyond headers # Clean up temporary directory after use (optional) - # rmtree(temp_dir) \ No newline at end of file + # rmtree(tmpdir) \ No newline at end of file From ab7c051dbd4ebfce92917ce154a8053343a011e7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 21 Apr 2024 02:02:04 +0000 Subject: [PATCH 16/16] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- reproschema/redcap2reproschema.py | 28 +++++++++++-------- reproschema/reproschema2redcap.py | 15 +++++++--- reproschema/tests/test_redcap2reproschema.py | 20 +++++++++---- .../tests/test_redcap2rs_data/redcap2rs.yaml | 2 +- reproschema/tests/test_reproschema2redcap.py | 9 ++++-- templates/redcap2rs.yaml | 2 +- 6 files changed, 50 insertions(+), 26 deletions(-) diff --git a/reproschema/redcap2reproschema.py b/reproschema/redcap2reproschema.py index 253c6b5..e7f67c7 100644 --- a/reproschema/redcap2reproschema.py +++ b/reproschema/redcap2reproschema.py @@ -8,11 +8,12 @@ matrix_group_count = {} + def clean_header(header): cleaned_header = {} for k, v in header.items(): # Strip BOM, whitespace, and enclosing quotation marks if present - cleaned_key = k.lstrip('\ufeff').strip().strip('"') + cleaned_key = k.lstrip("\ufeff").strip().strip('"') cleaned_header[cleaned_key] = v return cleaned_header @@ -24,7 +25,7 @@ def normalize_condition(condition_str): re_brackets = re.compile(r"\[([^\]]*)\]") re_extra_spaces = re.compile(r"\s+") re_double_quotes = re.compile(r'"') - re_or = re.compile(r'\bor\b') # Match 'or' as whole word + re_or = re.compile(r"\bor\b") # Match 'or' as whole word # Apply regex replacements condition_str = re_parentheses.sub(r"___\1", condition_str) @@ -32,16 +33,20 @@ def normalize_condition(condition_str): condition_str = re_brackets.sub(r" \1 ", condition_str) # Replace 'or' with '||', ensuring not to replace '||' - condition_str = re_or.sub('||', condition_str) + condition_str = re_or.sub("||", condition_str) # Replace 'and' with '&&' condition_str = condition_str.replace(" and ", " && ") # Trim extra spaces and replace double quotes with single quotes - condition_str = re_extra_spaces.sub(' ', condition_str).strip() # Reduce multiple spaces to a single space - condition_str = re_double_quotes.sub("'", condition_str) # Replace double quotes with single quotes + condition_str = re_extra_spaces.sub( + " ", condition_str + ).strip() # Reduce multiple spaces to a single space + condition_str = re_double_quotes.sub( + "'", condition_str + ) # Replace double quotes with single quotes - return condition_str.strip() + return condition_str.strip() def process_visibility(data): @@ -116,7 +121,7 @@ def process_choices(field_type, choices_str): value = parts[0] choice_obj = {"name": " ".join(parts[1:]), "value": value} - # remove image for now + # remove image for now # if len(parts) == 3: # # Handle image url # choice_obj["image"] = f"{parts[2]}.png" @@ -204,10 +209,7 @@ def process_row( } for key, value in field.items(): - if ( - schema_map.get(key) in ["question", "description", "preamble"] - and value - ): + if schema_map.get(key) in ["question", "description", "preamble"] and value: rowData.update({schema_map[key]: parse_html(value)}) elif schema_map.get(key) == "allow" and value: @@ -349,7 +351,9 @@ def create_protocol_schema( "variableName": f"{activity}_schema", # Assuming activity name as prefLabel, update as needed "prefLabel": activity.replace("_", " ").title(), - "isVis": protocol_visibility_obj.get(activity, True), # Default to True if not specified + "isVis": protocol_visibility_obj.get( + activity, True + ), # Default to True if not specified } protocol_schema["ui"]["addProperties"].append(add_property) # Add the full path to the order list diff --git a/reproschema/reproschema2redcap.py b/reproschema/reproschema2redcap.py index ffb7eea..298c56e 100644 --- a/reproschema/reproschema2redcap.py +++ b/reproschema/reproschema2redcap.py @@ -150,10 +150,17 @@ def get_csv_data(dir_path): activity_order = parsed_protocol_json.get("ui", {}).get("order", []) for relative_activity_path in activity_order: # Normalize the relative path and construct the absolute path - normalized_relative_path = Path(relative_activity_path.lstrip("../")) + normalized_relative_path = Path( + relative_activity_path.lstrip("../") + ) + + activity_path = ( + dir_path + / "activities" + / normalized_relative_path + / (normalized_relative_path.name + "_schema") + ) - activity_path = dir_path / "activities" / normalized_relative_path / (normalized_relative_path.name + "_schema") - parsed_activity_json = read_json_file(activity_path) if parsed_activity_json: @@ -239,4 +246,4 @@ def main(input_dir_path, output_csv_filename): sys.exit(1) input_dir_path = Path(sys.argv[1]) output_csv_filename = sys.argv[2] - main(input_dir_path, output_csv_filename) \ No newline at end of file + main(input_dir_path, output_csv_filename) diff --git a/reproschema/tests/test_redcap2reproschema.py b/reproschema/tests/test_redcap2reproschema.py index 4dff719..bbf2df7 100644 --- a/reproschema/tests/test_redcap2reproschema.py +++ b/reproschema/tests/test_redcap2reproschema.py @@ -3,7 +3,7 @@ import pytest import yaml from click.testing import CliRunner -from ..cli import main +from ..cli import main CSV_FILE_NAME = "redcap_dict.csv" YAML_FILE_NAME = "redcap2rs.yaml" @@ -14,6 +14,7 @@ os.path.dirname(__file__), "test_redcap2rs_data", YAML_FILE_NAME ) + def test_redcap2reproschema(tmpdir): runner = CliRunner() @@ -26,13 +27,22 @@ def test_redcap2reproschema(tmpdir): # Change the current working directory to tmpdir with tmpdir.as_cwd(): # Read YAML to find the expected output directory name - with open(str(temp_yaml_file), 'r') as file: # Convert to string + with open(str(temp_yaml_file), "r") as file: # Convert to string protocol = yaml.safe_load(file) protocol_name = protocol.get("protocol_name", "").replace(" ", "_") result = runner.invoke( - main, ["redcap2reproschema", str(temp_csv_file), str(temp_yaml_file)] # Convert to string + main, + [ + "redcap2reproschema", + str(temp_csv_file), + str(temp_yaml_file), + ], # Convert to string ) - assert result.exit_code == 0, f"The command failed to execute successfully: {result.output}" - assert os.path.isdir(protocol_name), f"Expected output directory '{protocol_name}' does not exist" + assert ( + result.exit_code == 0 + ), f"The command failed to execute successfully: {result.output}" + assert os.path.isdir( + protocol_name + ), f"Expected output directory '{protocol_name}' does not exist" diff --git a/reproschema/tests/test_redcap2rs_data/redcap2rs.yaml b/reproschema/tests/test_redcap2rs_data/redcap2rs.yaml index c201323..95d4a9c 100644 --- a/reproschema/tests/test_redcap2rs_data/redcap2rs.yaml +++ b/reproschema/tests/test_redcap2rs_data/redcap2rs.yaml @@ -13,4 +13,4 @@ protocol_display_name: "redcap protocols" # Provide a brief description of your protocol. protocol_description: "testing" # Example: "This protocol is for ..." -redcap_version: "3.0.0" \ No newline at end of file +redcap_version: "3.0.0" diff --git a/reproschema/tests/test_reproschema2redcap.py b/reproschema/tests/test_reproschema2redcap.py index c652d3d..eff26b3 100644 --- a/reproschema/tests/test_reproschema2redcap.py +++ b/reproschema/tests/test_reproschema2redcap.py @@ -6,6 +6,7 @@ from pathlib import Path import csv + def test_reproschema2redcap(tmpdir): runner = CliRunner() @@ -16,7 +17,7 @@ def test_reproschema2redcap(tmpdir): ) copytree(original_data_dir, "input_data") - input_path = Path("input_data") + input_path = Path("input_data") output_csv_path = os.path.join(tmpdir, "output.csv") result = runner.invoke( @@ -33,7 +34,9 @@ def test_reproschema2redcap(tmpdir): reader = csv.reader(csv_file) csv_contents = list(reader) - assert len(csv_contents) > 1 # More than one row indicates content beyond headers + assert ( + len(csv_contents) > 1 + ) # More than one row indicates content beyond headers # Clean up temporary directory after use (optional) - # rmtree(tmpdir) \ No newline at end of file + # rmtree(tmpdir) diff --git a/templates/redcap2rs.yaml b/templates/redcap2rs.yaml index aa2f831..4bbf78f 100644 --- a/templates/redcap2rs.yaml +++ b/templates/redcap2rs.yaml @@ -13,4 +13,4 @@ protocol_display_name: "Your protocol display name" # Provide a brief description of your protocol. protocol_description: "Description for your protocol" # Example: "This protocol is for ..." -redcap_version: "x.y.z" # Example: "3.0.0" \ No newline at end of file +redcap_version: "x.y.z" # Example: "3.0.0"