Skip to content

Commit

Permalink
Merge pull request #9 from sanuann/master
Browse files Browse the repository at this point in the history
add messages, overrideProperties and some refactoring
  • Loading branch information
satra authored Sep 25, 2020
2 parents 3a09b62 + 7acba36 commit 15b5dc4
Show file tree
Hide file tree
Showing 8 changed files with 345 additions and 110 deletions.
18 changes: 18 additions & 0 deletions reproschema/tests/contexts/generic
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@
"@id": "schema:unitCode",
"@container": "@set"
},
"unitOptions": {
"@id": "reproschema:unitOptions",
"@container": "@set"
},
"ui" : "@nest",
"order": {
"@id": "reproschema:order",
Expand All @@ -104,6 +108,16 @@
"@container": "@set",
"@nest": "ui"
},
"overrideProperties": {
"@id": "reproschema:overrideProperties",
"@type": "reproschema:OverrideProperty",
"@container": "@set",
"@nest": "ui"
},
"message": {
"@id": "reproschema:message",
"@container": "@language"
},
"shuffle": {
"@id": "reproschema:shuffle",
"@type": "schema:Boolean",
Expand All @@ -127,6 +141,10 @@
"@id": "reproschema:compute",
"@container": "@index"
},
"messages": {
"@id": "reproschema:messages",
"@container": "@index"
},
"jsExpression": {
"@id": "reproschema:jsExpression"
},
Expand Down
22 changes: 17 additions & 5 deletions reproschema/tests/data/activities/activity1.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,23 @@
"@id": "activity1.jsonld",
"prefLabel": "Example 1",
"description": "Activity example 1",
"schemaVersion": "1.0.0-rc1.post",
"schemaVersion": "1.0.0-rc2",
"version": "0.0.1",
"citation": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1495268/",
"preamble": {
"en": "Over the last 2 weeks, how often have you been bothered by any of the following problems?",
"es": "Durante las últimas 2 semanas, ¿con qué frecuencia le han molestado los siguintes problemas?"
},
"messages": [
{
"message": "Test message: Triggered when item1 value is greater than 1",
"jsExpression": "item1 > 1"
}
],
"compute": [
{
"variableName": "phq9_total_score",
"jsExpression": "phq9_1 + phq9_2 + phq9_3 + phq9_4 + phq9_5 + phq9_6 + phq9_7 + phq9_8 + phq9_9"
"variableName": "activity1_total_score",
"jsExpression": "item1 + item2"
}
],
"ui": {
Expand All @@ -26,11 +32,17 @@
"randomMaxDelay": "PT2H",
"limit": "P2D",
"schedule": "R/2020-08-01T08:00:00Z/P1D"
},
{ "isAbout": "items/item2.jsonld",
"variableName": "item2",
"requiredValue": true,
"isVis": true
}
],
"order": [
"items/item1.jsonld"
"items/item1.jsonld",
"items/item2.jsonld"
],
"shuffle": false
}
}
}
4 changes: 2 additions & 2 deletions reproschema/tests/data/activities/activity1_embed.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"@id": "activity1.jsonld",
"prefLabel": "Example 1",
"description": "Activity example 1",
"schemaVersion": "1.0.0-rc1.post",
"schemaVersion": "1.0.0-rc2",
"version": "0.0.1",
"citation": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1495268/",
"preamble": {
Expand All @@ -24,7 +24,7 @@
"@id": "items/item1.jsonld",
"prefLabel": "item1",
"description": "Q1 of example 1",
"schemaVersion": "1.0.0-rc1.post",
"schemaVersion": "1.0.0-rc2",
"version": "0.0.1",
"question": {
"en": "Little interest or pleasure in doing things",
Expand Down
2 changes: 1 addition & 1 deletion reproschema/tests/data/activities/items/item1.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"@id": "item1.jsonld",
"prefLabel": "item1",
"description": "Q1 of example 1",
"schemaVersion": "1.0.0-rc1.post",
"schemaVersion": "1.0.0-rc2",
"version": "0.0.1",
"question": {
"en": "Little interest or pleasure in doing things",
Expand Down
38 changes: 38 additions & 0 deletions reproschema/tests/data/activities/items/item2.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"@context": "../../../contexts/generic",
"@type": "reproschema:Field",
"@id": "item2.jsonld",
"prefLabel": "item2",
"description": "Q2 of example 1",
"schemaVersion": "1.0.0-rc2",
"version": "0.0.1",
"question": {
"en": "Current temperature.",
"es": "Fiebre actual."
},
"ui": {
"inputType": "float"
},
"responseOptions": {
"valueType": "xsd:float",
"unitOptions": [
{
"prefLabel": {
"en": "Fahrenheit",
"es": "Fahrenheit"
},
"value": "°F"
},
{
"prefLabel": {
"en": "Celsius",
"es": "Celsius"
},
"value": "°C"
}
]
}
}



8 changes: 7 additions & 1 deletion reproschema/tests/data/protocols/protocol1.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@
"es": "Protocol1_es"
},
"description": "example Protocol",
"schemaVersion": "1.0.0-rc1.post",
"schemaVersion": "1.0.0-rc2",
"version": "0.0.1",
"messages": [
{
"message": "Test message: Triggered when item1 value is greater than 0",
"jsExpression": "item1 > 0"
}
],
"ui": {
"addProperties": [
{
Expand Down
6 changes: 3 additions & 3 deletions reproschema/tests/data/protocols/protocol1_embed.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"es": "Protocol1_es"
},
"description": "example Protocol",
"schemaVersion": "1.0.0-rc1.post",
"schemaVersion": "1.0.0-rc2",
"version": "0.0.1",
"ui": {
"addProperties": [
Expand All @@ -27,7 +27,7 @@
"@id": "../activities/activity1.jsonld",
"prefLabel": "Example 1",
"description": "Activity example 1",
"schemaVersion": "1.0.0-rc1.post",
"schemaVersion": "1.0.0-rc2",
"version": "0.0.1",
"citation": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1495268/",
"preamble": {
Expand All @@ -49,7 +49,7 @@
"@id": "../activities/items/item1.jsonld",
"prefLabel": "item1",
"description": "Q1 of example 1",
"schemaVersion": "0.0.1",
"schemaVersion": "1.0.0-rc2",
"version": "0.0.1",
"question": {
"en": "Little interest or pleasure in doing things",
Expand Down
Loading

0 comments on commit 15b5dc4

Please sign in to comment.