Skip to content

Commit 15b5dc4

Browse files
authored
Merge pull request #9 from sanuann/master
add messages, overrideProperties and some refactoring
2 parents 3a09b62 + 7acba36 commit 15b5dc4

File tree

8 files changed

+345
-110
lines changed

8 files changed

+345
-110
lines changed

reproschema/tests/contexts/generic

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@
9191
"@id": "schema:unitCode",
9292
"@container": "@set"
9393
},
94+
"unitOptions": {
95+
"@id": "reproschema:unitOptions",
96+
"@container": "@set"
97+
},
9498
"ui" : "@nest",
9599
"order": {
96100
"@id": "reproschema:order",
@@ -104,6 +108,16 @@
104108
"@container": "@set",
105109
"@nest": "ui"
106110
},
111+
"overrideProperties": {
112+
"@id": "reproschema:overrideProperties",
113+
"@type": "reproschema:OverrideProperty",
114+
"@container": "@set",
115+
"@nest": "ui"
116+
},
117+
"message": {
118+
"@id": "reproschema:message",
119+
"@container": "@language"
120+
},
107121
"shuffle": {
108122
"@id": "reproschema:shuffle",
109123
"@type": "schema:Boolean",
@@ -127,6 +141,10 @@
127141
"@id": "reproschema:compute",
128142
"@container": "@index"
129143
},
144+
"messages": {
145+
"@id": "reproschema:messages",
146+
"@container": "@index"
147+
},
130148
"jsExpression": {
131149
"@id": "reproschema:jsExpression"
132150
},

reproschema/tests/data/activities/activity1.jsonld

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,23 @@
44
"@id": "activity1.jsonld",
55
"prefLabel": "Example 1",
66
"description": "Activity example 1",
7-
"schemaVersion": "1.0.0-rc1.post",
7+
"schemaVersion": "1.0.0-rc2",
88
"version": "0.0.1",
99
"citation": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1495268/",
1010
"preamble": {
1111
"en": "Over the last 2 weeks, how often have you been bothered by any of the following problems?",
1212
"es": "Durante las últimas 2 semanas, ¿con qué frecuencia le han molestado los siguintes problemas?"
1313
},
14+
"messages": [
15+
{
16+
"message": "Test message: Triggered when item1 value is greater than 1",
17+
"jsExpression": "item1 > 1"
18+
}
19+
],
1420
"compute": [
1521
{
16-
"variableName": "phq9_total_score",
17-
"jsExpression": "phq9_1 + phq9_2 + phq9_3 + phq9_4 + phq9_5 + phq9_6 + phq9_7 + phq9_8 + phq9_9"
22+
"variableName": "activity1_total_score",
23+
"jsExpression": "item1 + item2"
1824
}
1925
],
2026
"ui": {
@@ -26,11 +32,17 @@
2632
"randomMaxDelay": "PT2H",
2733
"limit": "P2D",
2834
"schedule": "R/2020-08-01T08:00:00Z/P1D"
35+
},
36+
{ "isAbout": "items/item2.jsonld",
37+
"variableName": "item2",
38+
"requiredValue": true,
39+
"isVis": true
2940
}
3041
],
3142
"order": [
32-
"items/item1.jsonld"
43+
"items/item1.jsonld",
44+
"items/item2.jsonld"
3345
],
3446
"shuffle": false
3547
}
36-
}
48+
}

reproschema/tests/data/activities/activity1_embed.jsonld

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"@id": "activity1.jsonld",
55
"prefLabel": "Example 1",
66
"description": "Activity example 1",
7-
"schemaVersion": "1.0.0-rc1.post",
7+
"schemaVersion": "1.0.0-rc2",
88
"version": "0.0.1",
99
"citation": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1495268/",
1010
"preamble": {
@@ -24,7 +24,7 @@
2424
"@id": "items/item1.jsonld",
2525
"prefLabel": "item1",
2626
"description": "Q1 of example 1",
27-
"schemaVersion": "1.0.0-rc1.post",
27+
"schemaVersion": "1.0.0-rc2",
2828
"version": "0.0.1",
2929
"question": {
3030
"en": "Little interest or pleasure in doing things",

reproschema/tests/data/activities/items/item1.jsonld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"@id": "item1.jsonld",
55
"prefLabel": "item1",
66
"description": "Q1 of example 1",
7-
"schemaVersion": "1.0.0-rc1.post",
7+
"schemaVersion": "1.0.0-rc2",
88
"version": "0.0.1",
99
"question": {
1010
"en": "Little interest or pleasure in doing things",
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"@context": "../../../contexts/generic",
3+
"@type": "reproschema:Field",
4+
"@id": "item2.jsonld",
5+
"prefLabel": "item2",
6+
"description": "Q2 of example 1",
7+
"schemaVersion": "1.0.0-rc2",
8+
"version": "0.0.1",
9+
"question": {
10+
"en": "Current temperature.",
11+
"es": "Fiebre actual."
12+
},
13+
"ui": {
14+
"inputType": "float"
15+
},
16+
"responseOptions": {
17+
"valueType": "xsd:float",
18+
"unitOptions": [
19+
{
20+
"prefLabel": {
21+
"en": "Fahrenheit",
22+
"es": "Fahrenheit"
23+
},
24+
"value": "°F"
25+
},
26+
{
27+
"prefLabel": {
28+
"en": "Celsius",
29+
"es": "Celsius"
30+
},
31+
"value": "°C"
32+
}
33+
]
34+
}
35+
}
36+
37+
38+

reproschema/tests/data/protocols/protocol1.jsonld

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@
77
"es": "Protocol1_es"
88
},
99
"description": "example Protocol",
10-
"schemaVersion": "1.0.0-rc1.post",
10+
"schemaVersion": "1.0.0-rc2",
1111
"version": "0.0.1",
12+
"messages": [
13+
{
14+
"message": "Test message: Triggered when item1 value is greater than 0",
15+
"jsExpression": "item1 > 0"
16+
}
17+
],
1218
"ui": {
1319
"addProperties": [
1420
{

reproschema/tests/data/protocols/protocol1_embed.jsonld

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"es": "Protocol1_es"
88
},
99
"description": "example Protocol",
10-
"schemaVersion": "1.0.0-rc1.post",
10+
"schemaVersion": "1.0.0-rc2",
1111
"version": "0.0.1",
1212
"ui": {
1313
"addProperties": [
@@ -27,7 +27,7 @@
2727
"@id": "../activities/activity1.jsonld",
2828
"prefLabel": "Example 1",
2929
"description": "Activity example 1",
30-
"schemaVersion": "1.0.0-rc1.post",
30+
"schemaVersion": "1.0.0-rc2",
3131
"version": "0.0.1",
3232
"citation": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1495268/",
3333
"preamble": {
@@ -49,7 +49,7 @@
4949
"@id": "../activities/items/item1.jsonld",
5050
"prefLabel": "item1",
5151
"description": "Q1 of example 1",
52-
"schemaVersion": "0.0.1",
52+
"schemaVersion": "1.0.0-rc2",
5353
"version": "0.0.1",
5454
"question": {
5555
"en": "Little interest or pleasure in doing things",

0 commit comments

Comments
 (0)