From 200e3211eeab3b6811ba84dfc52b482182a80b2c Mon Sep 17 00:00:00 2001 From: rmanaem Date: Fri, 3 Nov 2023 16:32:31 -0400 Subject: [PATCH 1/4] Renamed example files --- .../examples/good/example_synthetic.json | 107 +++++++++++++- .../example_synthetic_expected_output.json | 131 ------------------ .../good/example_synthetic_participants.json | 34 +++++ 3 files changed, 136 insertions(+), 136 deletions(-) delete mode 100644 cypress/fixtures/examples/good/example_synthetic_expected_output.json create mode 100644 cypress/fixtures/examples/good/example_synthetic_participants.json diff --git a/cypress/fixtures/examples/good/example_synthetic.json b/cypress/fixtures/examples/good/example_synthetic.json index 41e75aac..3f7dafb3 100644 --- a/cypress/fixtures/examples/good/example_synthetic.json +++ b/cypress/fixtures/examples/good/example_synthetic.json @@ -1,18 +1,57 @@ { "participant_id":{ - "Description":"A participant ID" + "Description":"A participant ID", + "Annotations":{ + "IsAbout":{ + "TermURL":"nb:ParticipantID", + "Label":"Subject Unique Identifier" + }, + "Identifies":"participant" + } }, "session_id":{ "Description":"A session ID" }, "pheno_age":{ - "Description":"Age of the participant" + "Description":"Age of the participant", + "Annotations":{ + "IsAbout":{ + "TermURL":"nb:Age", + "Label":"Age" + }, + "Transformation":{ + "TermURL":"nb:FromEuro", + "Label":"european decimal value" + }, + "MissingValues":[ + "NA" + ] + } }, "pheno_sex":{ "Description":"Sex variable", "Levels":{ "M":"Male", "F":"Female" + }, + "Annotations":{ + "IsAbout":{ + "TermURL":"nb:Sex", + "Label":"Sex" + }, + "Levels":{ + "M":{ + "TermURL":"snomed:248153007", + "Label":"Male" + }, + "F":{ + "TermURL":"snomed:248152002", + "Label":"Female" + } + }, + "MissingValues":[ + "missing" + ] } }, "pheno_group":{ @@ -20,15 +59,73 @@ "Levels":{ "PAT":"Patient", "CTRL":"Control subject" + }, + "Annotations":{ + "IsAbout":{ + "TermURL":"nb:Diagnosis", + "Label":"Diagnosis" + }, + "Levels":{ + "PAT":{ + "TermURL":"snomed:406506008", + "Label":"Attention deficit hyperactivity disorder" + }, + "CTRL":{ + "TermURL":"ncit:C94342", + "Label":"Healthy Control" + } + }, + "MissingValues":[ + "NA" + ] } }, "tool1_item1":{ - "Description":"item 1 scores for tool1" + "Description":"item 1 scores for tool1", + "Annotations":{ + "IsAbout":{ + "TermURL":"nb:Assessment", + "Label":"Assessment tool" + }, + "IsPartOf":{ + "TermURL":"cogatlas:trm_57964b8a66aed", + "Label":"Montreal Cognitive Assessment" + }, + "MissingValues":[ + "missing" + ] + } }, "tool1_item2":{ - "Description":"item 2 scores for tool1" + "Description":"item 2 scores for tool1", + "Annotations":{ + "IsAbout":{ + "TermURL":"nb:Assessment", + "Label":"Assessment tool" + }, + "IsPartOf":{ + "TermURL":"cogatlas:trm_57964b8a66aed", + "Label":"Montreal Cognitive Assessment" + }, + "MissingValues":[ + "missing" + ] + } }, "tool2_item1":{ - "Description":"item 1 scores for tool2" + "Description":"item 1 scores for tool2", + "Annotations":{ + "IsAbout":{ + "TermURL":"nb:Assessment", + "Label":"Assessment tool" + }, + "IsPartOf":{ + "TermURL":"cogatlas:tsk_4a57abb949ece", + "Label":"Unified Parkinson's Disease Rating Scale" + }, + "MissingValues":[ + "not completed" + ] + } } } diff --git a/cypress/fixtures/examples/good/example_synthetic_expected_output.json b/cypress/fixtures/examples/good/example_synthetic_expected_output.json deleted file mode 100644 index 3f7dafb3..00000000 --- a/cypress/fixtures/examples/good/example_synthetic_expected_output.json +++ /dev/null @@ -1,131 +0,0 @@ -{ - "participant_id":{ - "Description":"A participant ID", - "Annotations":{ - "IsAbout":{ - "TermURL":"nb:ParticipantID", - "Label":"Subject Unique Identifier" - }, - "Identifies":"participant" - } - }, - "session_id":{ - "Description":"A session ID" - }, - "pheno_age":{ - "Description":"Age of the participant", - "Annotations":{ - "IsAbout":{ - "TermURL":"nb:Age", - "Label":"Age" - }, - "Transformation":{ - "TermURL":"nb:FromEuro", - "Label":"european decimal value" - }, - "MissingValues":[ - "NA" - ] - } - }, - "pheno_sex":{ - "Description":"Sex variable", - "Levels":{ - "M":"Male", - "F":"Female" - }, - "Annotations":{ - "IsAbout":{ - "TermURL":"nb:Sex", - "Label":"Sex" - }, - "Levels":{ - "M":{ - "TermURL":"snomed:248153007", - "Label":"Male" - }, - "F":{ - "TermURL":"snomed:248152002", - "Label":"Female" - } - }, - "MissingValues":[ - "missing" - ] - } - }, - "pheno_group":{ - "Description":"Group variable", - "Levels":{ - "PAT":"Patient", - "CTRL":"Control subject" - }, - "Annotations":{ - "IsAbout":{ - "TermURL":"nb:Diagnosis", - "Label":"Diagnosis" - }, - "Levels":{ - "PAT":{ - "TermURL":"snomed:406506008", - "Label":"Attention deficit hyperactivity disorder" - }, - "CTRL":{ - "TermURL":"ncit:C94342", - "Label":"Healthy Control" - } - }, - "MissingValues":[ - "NA" - ] - } - }, - "tool1_item1":{ - "Description":"item 1 scores for tool1", - "Annotations":{ - "IsAbout":{ - "TermURL":"nb:Assessment", - "Label":"Assessment tool" - }, - "IsPartOf":{ - "TermURL":"cogatlas:trm_57964b8a66aed", - "Label":"Montreal Cognitive Assessment" - }, - "MissingValues":[ - "missing" - ] - } - }, - "tool1_item2":{ - "Description":"item 2 scores for tool1", - "Annotations":{ - "IsAbout":{ - "TermURL":"nb:Assessment", - "Label":"Assessment tool" - }, - "IsPartOf":{ - "TermURL":"cogatlas:trm_57964b8a66aed", - "Label":"Montreal Cognitive Assessment" - }, - "MissingValues":[ - "missing" - ] - } - }, - "tool2_item1":{ - "Description":"item 1 scores for tool2", - "Annotations":{ - "IsAbout":{ - "TermURL":"nb:Assessment", - "Label":"Assessment tool" - }, - "IsPartOf":{ - "TermURL":"cogatlas:tsk_4a57abb949ece", - "Label":"Unified Parkinson's Disease Rating Scale" - }, - "MissingValues":[ - "not completed" - ] - } - } -} diff --git a/cypress/fixtures/examples/good/example_synthetic_participants.json b/cypress/fixtures/examples/good/example_synthetic_participants.json new file mode 100644 index 00000000..41e75aac --- /dev/null +++ b/cypress/fixtures/examples/good/example_synthetic_participants.json @@ -0,0 +1,34 @@ +{ + "participant_id":{ + "Description":"A participant ID" + }, + "session_id":{ + "Description":"A session ID" + }, + "pheno_age":{ + "Description":"Age of the participant" + }, + "pheno_sex":{ + "Description":"Sex variable", + "Levels":{ + "M":"Male", + "F":"Female" + } + }, + "pheno_group":{ + "Description":"Group variable", + "Levels":{ + "PAT":"Patient", + "CTRL":"Control subject" + } + }, + "tool1_item1":{ + "Description":"item 1 scores for tool1" + }, + "tool1_item2":{ + "Description":"item 2 scores for tool1" + }, + "tool2_item1":{ + "Description":"item 1 scores for tool2" + } +} From 345762d2f8fedbc4eb57ee6fad239e3d223fab52 Mon Sep 17 00:00:00 2001 From: rmanaem Date: Fri, 3 Nov 2023 16:53:39 -0400 Subject: [PATCH 2/4] Updated `validate-output-example_synthetic-e2etest` --- .../e2e/app/validate-output-example-synthetic-e2etest.cy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/app/validate-output-example-synthetic-e2etest.cy.js b/cypress/e2e/app/validate-output-example-synthetic-e2etest.cy.js index a6eea532..e3bebba0 100644 --- a/cypress/e2e/app/validate-output-example-synthetic-e2etest.cy.js +++ b/cypress/e2e/app/validate-output-example-synthetic-e2etest.cy.js @@ -6,7 +6,7 @@ describe("to annotate an assessment ", () => { /* ==== Generated with Cypress Studio ==== */ cy.get('[data-cy="data-dictionary-selector"] > .row > form > .file-selector-button').click(); - cy.get('[data-cy="data-dictionary-selector"] > .row > form > .file-selector-button > input').selectFile('cypress/fixtures/examples/good/example_synthetic.json', { force: true }); + cy.get('[data-cy="data-dictionary-selector"] > .row > form > .file-selector-button > input').selectFile('cypress/fixtures/examples/good/example_synthetic_participants.json', { force: true }); /* ==== End Cypress Studio ==== */ cy.get("[data-cy='button-nextpage']").click(); @@ -105,7 +105,7 @@ describe("to annotate an assessment ", () => { cy.task("downloads", "cypress/downloads").then(folderStateAfter => { cy.readFile('cypress/downloads/' + folderStateAfter[folderStateAfter.length - 1]).then((outputContent) => { - const expectedOutput = require('../../fixtures/examples/good/example_synthetic_expected_output.json'); + const expectedOutput = require('../../fixtures/examples/good/example_synthetic.json'); expect(outputContent).to.deep.equal(expectedOutput); }); }); From f1c204586d5ea69e5134775dc83cebd278ce06b8 Mon Sep 17 00:00:00 2001 From: rmanaem Date: Sat, 4 Nov 2023 20:01:39 -0400 Subject: [PATCH 3/4] Formatted example json files --- cypress/fixtures/examples/good/example_synthetic.json | 2 +- .../fixtures/examples/good/example_synthetic_participants.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/fixtures/examples/good/example_synthetic.json b/cypress/fixtures/examples/good/example_synthetic.json index 3f7dafb3..804af9d5 100644 --- a/cypress/fixtures/examples/good/example_synthetic.json +++ b/cypress/fixtures/examples/good/example_synthetic.json @@ -128,4 +128,4 @@ ] } } -} +} \ No newline at end of file diff --git a/cypress/fixtures/examples/good/example_synthetic_participants.json b/cypress/fixtures/examples/good/example_synthetic_participants.json index 41e75aac..48ebf6fd 100644 --- a/cypress/fixtures/examples/good/example_synthetic_participants.json +++ b/cypress/fixtures/examples/good/example_synthetic_participants.json @@ -31,4 +31,4 @@ "tool2_item1":{ "Description":"item 1 scores for tool2" } -} +} \ No newline at end of file From f310b4f2c03d3c10bda09839210cd4f68af6b052 Mon Sep 17 00:00:00 2001 From: rmanaem Date: Mon, 6 Nov 2023 11:59:41 -0500 Subject: [PATCH 4/4] Reformatted json example files --- .../examples/good/example_synthetic.json | 242 +++++++++--------- .../good/example_synthetic_participants.json | 48 ++-- 2 files changed, 145 insertions(+), 145 deletions(-) diff --git a/cypress/fixtures/examples/good/example_synthetic.json b/cypress/fixtures/examples/good/example_synthetic.json index 804af9d5..1e1c2b5b 100644 --- a/cypress/fixtures/examples/good/example_synthetic.json +++ b/cypress/fixtures/examples/good/example_synthetic.json @@ -1,131 +1,131 @@ { - "participant_id":{ - "Description":"A participant ID", - "Annotations":{ - "IsAbout":{ - "TermURL":"nb:ParticipantID", - "Label":"Subject Unique Identifier" - }, - "Identifies":"participant" - } + "participant_id": { + "Description": "A participant ID", + "Annotations": { + "IsAbout": { + "TermURL": "nb:ParticipantID", + "Label": "Subject Unique Identifier" + }, + "Identifies": "participant" + } }, - "session_id":{ - "Description":"A session ID" + "session_id": { + "Description": "A session ID" }, - "pheno_age":{ - "Description":"Age of the participant", - "Annotations":{ - "IsAbout":{ - "TermURL":"nb:Age", - "Label":"Age" - }, - "Transformation":{ - "TermURL":"nb:FromEuro", - "Label":"european decimal value" - }, - "MissingValues":[ - "NA" - ] - } + "pheno_age": { + "Description": "Age of the participant", + "Annotations": { + "IsAbout": { + "TermURL": "nb:Age", + "Label": "Age" + }, + "Transformation": { + "TermURL": "nb:FromEuro", + "Label": "european decimal value" + }, + "MissingValues": [ + "NA" + ] + } }, - "pheno_sex":{ - "Description":"Sex variable", - "Levels":{ - "M":"Male", - "F":"Female" - }, - "Annotations":{ - "IsAbout":{ - "TermURL":"nb:Sex", - "Label":"Sex" - }, - "Levels":{ - "M":{ - "TermURL":"snomed:248153007", - "Label":"Male" - }, - "F":{ - "TermURL":"snomed:248152002", - "Label":"Female" - } - }, - "MissingValues":[ - "missing" - ] - } + "pheno_sex": { + "Description": "Sex variable", + "Levels": { + "M": "Male", + "F": "Female" + }, + "Annotations": { + "IsAbout": { + "TermURL": "nb:Sex", + "Label": "Sex" + }, + "Levels": { + "M": { + "TermURL": "snomed:248153007", + "Label": "Male" + }, + "F": { + "TermURL": "snomed:248152002", + "Label": "Female" + } + }, + "MissingValues": [ + "missing" + ] + } }, - "pheno_group":{ - "Description":"Group variable", - "Levels":{ - "PAT":"Patient", - "CTRL":"Control subject" - }, - "Annotations":{ - "IsAbout":{ - "TermURL":"nb:Diagnosis", - "Label":"Diagnosis" - }, - "Levels":{ - "PAT":{ - "TermURL":"snomed:406506008", - "Label":"Attention deficit hyperactivity disorder" - }, - "CTRL":{ - "TermURL":"ncit:C94342", - "Label":"Healthy Control" - } - }, - "MissingValues":[ - "NA" - ] - } + "pheno_group": { + "Description": "Group variable", + "Levels": { + "PAT": "Patient", + "CTRL": "Control subject" + }, + "Annotations": { + "IsAbout": { + "TermURL": "nb:Diagnosis", + "Label": "Diagnosis" + }, + "Levels": { + "PAT": { + "TermURL": "snomed:406506008", + "Label": "Attention deficit hyperactivity disorder" + }, + "CTRL": { + "TermURL": "ncit:C94342", + "Label": "Healthy Control" + } + }, + "MissingValues": [ + "NA" + ] + } }, - "tool1_item1":{ - "Description":"item 1 scores for tool1", - "Annotations":{ - "IsAbout":{ - "TermURL":"nb:Assessment", - "Label":"Assessment tool" - }, - "IsPartOf":{ - "TermURL":"cogatlas:trm_57964b8a66aed", - "Label":"Montreal Cognitive Assessment" - }, - "MissingValues":[ - "missing" - ] - } + "tool1_item1": { + "Description": "item 1 scores for tool1", + "Annotations": { + "IsAbout": { + "TermURL": "nb:Assessment", + "Label": "Assessment tool" + }, + "IsPartOf": { + "TermURL": "cogatlas:trm_57964b8a66aed", + "Label": "Montreal Cognitive Assessment" + }, + "MissingValues": [ + "missing" + ] + } }, - "tool1_item2":{ - "Description":"item 2 scores for tool1", - "Annotations":{ - "IsAbout":{ - "TermURL":"nb:Assessment", - "Label":"Assessment tool" - }, - "IsPartOf":{ - "TermURL":"cogatlas:trm_57964b8a66aed", - "Label":"Montreal Cognitive Assessment" - }, - "MissingValues":[ - "missing" - ] - } + "tool1_item2": { + "Description": "item 2 scores for tool1", + "Annotations": { + "IsAbout": { + "TermURL": "nb:Assessment", + "Label": "Assessment tool" + }, + "IsPartOf": { + "TermURL": "cogatlas:trm_57964b8a66aed", + "Label": "Montreal Cognitive Assessment" + }, + "MissingValues": [ + "missing" + ] + } }, - "tool2_item1":{ - "Description":"item 1 scores for tool2", - "Annotations":{ - "IsAbout":{ - "TermURL":"nb:Assessment", - "Label":"Assessment tool" - }, - "IsPartOf":{ - "TermURL":"cogatlas:tsk_4a57abb949ece", - "Label":"Unified Parkinson's Disease Rating Scale" - }, - "MissingValues":[ - "not completed" - ] - } + "tool2_item1": { + "Description": "item 1 scores for tool2", + "Annotations": { + "IsAbout": { + "TermURL": "nb:Assessment", + "Label": "Assessment tool" + }, + "IsPartOf": { + "TermURL": "cogatlas:tsk_4a57abb949ece", + "Label": "Unified Parkinson's Disease Rating Scale" + }, + "MissingValues": [ + "not completed" + ] + } } } \ No newline at end of file diff --git a/cypress/fixtures/examples/good/example_synthetic_participants.json b/cypress/fixtures/examples/good/example_synthetic_participants.json index 48ebf6fd..51dfed5b 100644 --- a/cypress/fixtures/examples/good/example_synthetic_participants.json +++ b/cypress/fixtures/examples/good/example_synthetic_participants.json @@ -1,34 +1,34 @@ { - "participant_id":{ - "Description":"A participant ID" + "participant_id": { + "Description": "A participant ID" }, - "session_id":{ - "Description":"A session ID" + "session_id": { + "Description": "A session ID" }, - "pheno_age":{ - "Description":"Age of the participant" + "pheno_age": { + "Description": "Age of the participant" }, - "pheno_sex":{ - "Description":"Sex variable", - "Levels":{ - "M":"Male", - "F":"Female" - } + "pheno_sex": { + "Description": "Sex variable", + "Levels": { + "M": "Male", + "F": "Female" + } }, - "pheno_group":{ - "Description":"Group variable", - "Levels":{ - "PAT":"Patient", - "CTRL":"Control subject" - } + "pheno_group": { + "Description": "Group variable", + "Levels": { + "PAT": "Patient", + "CTRL": "Control subject" + } }, - "tool1_item1":{ - "Description":"item 1 scores for tool1" + "tool1_item1": { + "Description": "item 1 scores for tool1" }, - "tool1_item2":{ - "Description":"item 2 scores for tool1" + "tool1_item2": { + "Description": "item 2 scores for tool1" }, - "tool2_item1":{ - "Description":"item 1 scores for tool2" + "tool2_item1": { + "Description": "item 1 scores for tool2" } } \ No newline at end of file