quby-compiler 0.4.10 → 0.4.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0a76be7d6ec0fbd4f1fabe4beeacd159210a050fe62ab79b69198f472dfefd42
4
- data.tar.gz: 01a6a867ec3680ae24f49447000bd0d95dcb465cd1c9cba5fd71d66079c5c150
3
+ metadata.gz: 8b2f73a073de0f20b5dfd57b8e8c3b65c1878abce2cb109e67fe1cc302900b02
4
+ data.tar.gz: fec490f89c77a497fbac304a381e150aec1fc8e8e4e06950aff20424561fb69c
5
5
  SHA512:
6
- metadata.gz: 4a863660e2399ca7472cd1e2353c72444405fb8bd859da2c5b259097e77d0522493867ccd0b6b690a2c6c5000c65fc829ff4e85ac69f46a7b0ddd0dd960a756c
7
- data.tar.gz: b96591eb23810f2e66cbf1111e9232a691b3bf508efe8402cf3473e5201a734818c0f459b6fb959a6b54303c81f83e7c41019b8815a94fda7ac424410fb43c36
6
+ metadata.gz: 70bbcf09fa8b4d789ec22eaebb06b46a10bbdfcf5a5125f205f26307cceb471aef5c1e5e30a5b7ea510f64a304a59e21a40c64b3c40dde6935f291f04237e6de
7
+ data.tar.gz: 887f84082878e3a49dda34d8c92f62db3849e5ee716e0a69f9d1b92c1543cc1a3fe21fd65c5603c7703ce4168404dab75fc191f4999bd0aeeb032137d41e50e4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.4.11
2
+
3
+ * roqua.json: Baseline for a chart now always exports as a hash of gender/age => value
4
+
1
5
  # 0.4.10
2
6
 
3
7
  * quby2.json: Fix validations json (regex-serialization and key-capitalization)
@@ -60,9 +60,8 @@ module Quby
60
60
  case chart
61
61
  when Quby::Compiler::Entities::Charting::LineChart
62
62
  {
63
- y_label: chart.y_label,
64
63
  tonality: chart.tonality,
65
- baseline: YAML.dump(chart.baseline),
64
+ baseline: chart_baseline(chart.baseline),
66
65
  clinically_relevant_change: chart.clinically_relevant_change,
67
66
  }
68
67
  when Quby::Compiler::Entities::Charting::OverviewChart
@@ -89,6 +88,17 @@ module Quby
89
88
  }
90
89
  end
91
90
 
91
+ def chart_baseline(baseline)
92
+ case baseline
93
+ when nil
94
+ nil
95
+ when Float, Integer
96
+ {default: {default: baseline}}
97
+ when Hash
98
+ baseline
99
+ end
100
+ end
101
+
92
102
  # configuration for outcome tables.
93
103
  # tables:
94
104
  # <outcome_table_name:Symbol>: # each entry is a table.
@@ -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)
@@ -1,5 +1,5 @@
1
1
  module Quby
2
2
  module Compiler
3
- VERSION = "0.4.10"
3
+ VERSION = "0.4.11"
4
4
  end
5
5
  end
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.10
4
+ version: 0.4.11
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-03-18 00:00:00.000000000 Z
11
+ date: 2022-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel