quby-compiler 0.4.10 → 0.4.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/lib/quby/compiler/entities/questions/date_question.rb +14 -6
- data/lib/quby/compiler/entities/questions/string_question.rb +1 -1
- data/lib/quby/compiler/entities/questions/text_question.rb +1 -1
- data/lib/quby/compiler/outputs/roqua_serializer.rb +16 -3
- data/lib/quby/compiler/services/definition_validator.rb +2 -2
- data/lib/quby/compiler/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f13fa5a2d4c4da7b41e4a32905226d0523709bac245a9d7cba3d28fd927d2b6a
|
4
|
+
data.tar.gz: 4e8f0dfab2c05e6166176f5ddb951e5f4e51962b9902e75ea3e8561e9cda3392
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb6313ab623e76109aa94871bb192da9c95bbaa5809472b29bc88c2f7b61ebcb18b03b7433fe162209c33a1113aa7f359722c8927196d0d9b7ebf022e457e5b4
|
7
|
+
data.tar.gz: 3b3c6aeb7d590570defc880d3b1743ff64c1cb4c6227da2bb779c93057a7c1c249563f0e2366a1e6e13b6760fa90c010f66b57757159b24e0073af71403b6098
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
# 0.4.13
|
2
|
+
|
3
|
+
* quby2.json:
|
4
|
+
* string-questions: Don't pass a size of 30, when no size had been specified
|
5
|
+
* rename date type to date_parts, switch to use `date_parts: [{part: year, key: 'yyyy'}, ..]`
|
6
|
+
|
7
|
+
# 0.4.12
|
8
|
+
|
9
|
+
* roqua.json: Add questionnaire license
|
10
|
+
* roqua.json: Add `unchecks_all_others` for radio/checkbox question options
|
11
|
+
|
12
|
+
# 0.4.11
|
13
|
+
|
14
|
+
* roqua.json: Baseline for a chart now always exports as a hash of gender/age => value
|
15
|
+
|
1
16
|
# 0.4.10
|
2
17
|
|
3
18
|
* quby2.json: Fix validations json (regex-serialization and key-capitalization)
|
@@ -24,7 +24,8 @@ module Quby
|
|
24
24
|
def initialize(key, options = {})
|
25
25
|
super
|
26
26
|
|
27
|
-
|
27
|
+
# only possible order we support.
|
28
|
+
@components = options[:components] ? POSSIBLE_COMPONENTS & options[:components] : DEFAULT_COMPONENTS
|
28
29
|
@required_components = options[:required_components] || @components
|
29
30
|
@optional_components = @components - @required_components
|
30
31
|
|
@@ -39,7 +40,8 @@ module Quby
|
|
39
40
|
def add_date_validation(explanation)
|
40
41
|
@validations << {type: :valid_date,
|
41
42
|
subtype: :"valid_date_#{components.sort.join('_')}",
|
42
|
-
explanation: explanation
|
43
|
+
explanation: explanation,
|
44
|
+
requiredParts: required_components}
|
43
45
|
end
|
44
46
|
|
45
47
|
def claimed_keys
|
@@ -60,10 +62,16 @@ module Quby
|
|
60
62
|
end
|
61
63
|
|
62
64
|
def as_json(options = {})
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
65
|
+
super.merge(
|
66
|
+
type: 'date_parts',
|
67
|
+
as: 'date_parts',
|
68
|
+
dateParts: components.map { |component|
|
69
|
+
{
|
70
|
+
part: component,
|
71
|
+
key: send("#{component}_key")
|
72
|
+
}
|
73
|
+
}
|
74
|
+
)
|
67
75
|
end
|
68
76
|
end
|
69
77
|
end
|
@@ -36,6 +36,8 @@ module Quby
|
|
36
36
|
outcome_tables_schema: outcome_tables_schema,
|
37
37
|
questions: questions,
|
38
38
|
scores: scores,
|
39
|
+
license: questionnaire.license,
|
40
|
+
licensor: questionnaire.licensor,
|
39
41
|
}
|
40
42
|
end
|
41
43
|
|
@@ -60,9 +62,8 @@ module Quby
|
|
60
62
|
case chart
|
61
63
|
when Quby::Compiler::Entities::Charting::LineChart
|
62
64
|
{
|
63
|
-
y_label: chart.y_label,
|
64
65
|
tonality: chart.tonality,
|
65
|
-
baseline:
|
66
|
+
baseline: chart_baseline(chart.baseline),
|
66
67
|
clinically_relevant_change: chart.clinically_relevant_change,
|
67
68
|
}
|
68
69
|
when Quby::Compiler::Entities::Charting::OverviewChart
|
@@ -89,6 +90,17 @@ module Quby
|
|
89
90
|
}
|
90
91
|
end
|
91
92
|
|
93
|
+
def chart_baseline(baseline)
|
94
|
+
case baseline
|
95
|
+
when nil
|
96
|
+
nil
|
97
|
+
when Float, Integer
|
98
|
+
{default: {default: baseline}}
|
99
|
+
when Hash
|
100
|
+
baseline
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
92
104
|
# configuration for outcome tables.
|
93
105
|
# tables:
|
94
106
|
# <outcome_table_name:Symbol>: # each entry is a table.
|
@@ -220,7 +232,8 @@ module Quby
|
|
220
232
|
key: option.key,
|
221
233
|
value: (option.value.to_s unless question.type == :check_box),
|
222
234
|
description: option.context_free_description || parse_markdown_and_strip_tags(option.description),
|
223
|
-
child_question_keys: option.questions.map(&:key).presence
|
235
|
+
child_question_keys: option.questions.map(&:key).presence,
|
236
|
+
unchecks_all_others: question.try(:uncheck_all_option) && question.uncheck_all_option == option.key
|
224
237
|
}.compact
|
225
238
|
}
|
226
239
|
end
|
@@ -137,14 +137,14 @@ module Quby
|
|
137
137
|
unknown_questions = flag.shows_questions.select { |key| !questionnaire.key_in_use?(key) }
|
138
138
|
return if unknown_questions.blank?
|
139
139
|
|
140
|
-
fail ArgumentError, "Flag '#{key}' has unknown shows_questions keys #{unknown_questions}"
|
140
|
+
fail ArgumentError, "Flag '#{flag.key}' has unknown shows_questions keys #{unknown_questions}"
|
141
141
|
end
|
142
142
|
|
143
143
|
def validate_flag_hides(questionnaire, flag)
|
144
144
|
unknown_questions = flag.hides_questions.select { |key| !questionnaire.key_in_use?(key) }
|
145
145
|
return if unknown_questions.blank?
|
146
146
|
|
147
|
-
fail ArgumentError, "Flag '#{key}' has unknown hides_questions keys #{unknown_questions}"
|
147
|
+
fail ArgumentError, "Flag '#{flag.key}' has unknown hides_questions keys #{unknown_questions}"
|
148
148
|
end
|
149
149
|
|
150
150
|
def validate_flag_depends_on(questionnaire, flag)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quby-compiler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marten Veldthuis
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -259,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
259
259
|
- !ruby/object:Gem::Version
|
260
260
|
version: '0'
|
261
261
|
requirements: []
|
262
|
-
rubygems_version: 3.
|
262
|
+
rubygems_version: 3.3.22
|
263
263
|
signing_key:
|
264
264
|
specification_version: 4
|
265
265
|
summary: Quby::Compiler compiles a DSL for questionnaires to JSON
|