canql 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fa1d31ca5b1532394ba5988520cf393d0d64a47a
4
- data.tar.gz: efef75eab310ba0284b6c23fd047ed4febf6ccc1
3
+ metadata.gz: 5d930c202647a6b479bc8a7bea504b377155b2df
4
+ data.tar.gz: ca21ec21e84cecfab26ed4f687caa307d46d848b
5
5
  SHA512:
6
- metadata.gz: 2acbf6e64b433c5d33f7dfd5eb4ae7c39fbef1ebab51c496331643e1510239958a4a4e7846dc168b6b5fc262064f28f349fc1eb65d26cb07e0093241ed69ec30
7
- data.tar.gz: 24623f83a1f7dcede1ac8a37c23d464f874f1c438968c64d0f3fce3b6cf3810074cda026de2814689205c11fcda2196f932f20f319ea50abf60da8ebf18c0235
6
+ metadata.gz: 3bdfc6f29b5fcf385d936fdf14d6f7b6efcf192bbbdd7c98bc77f9448e02feac0acc3668bf7f76f33d64c3b8678fbd799c41fcadc38927949656a2d107bddbf8
7
+ data.tar.gz: 3d237636b1e26aa131ee3192ca7e00f2e6fd0ed83b3548d7a796236293d674eabf9a36de6a1382c17f05f938be7628c85441ad6dd43b65828f4cf33ae39918d2
data/code_safety.yml CHANGED
@@ -58,8 +58,8 @@ file safety:
58
58
  safe_revision: d6f1ccac606735190d30c962b7681ed12aec374a
59
59
  lib/canql/grammars.rb:
60
60
  comments:
61
- reviewed_by: timgentry
62
- safe_revision: 6932d590299ad4a9d2ba24b425b158c67142bf74
61
+ reviewed_by: josh.pencheon
62
+ safe_revision: 526dbe8a3dc3334b4174928e6f51d07e48ed9247
63
63
  lib/canql/grammars/age.treetop:
64
64
  comments: It is a known issue that this is potentially susceptible to certain
65
65
  kinds of DoS attack
@@ -83,11 +83,15 @@ file safety:
83
83
  comments:
84
84
  reviewed_by: timgentry
85
85
  safe_revision: 03f7a8fbee06a947e60bc554dcc1d1311c5632ac
86
+ lib/canql/grammars/genetic_test.treetop:
87
+ comments:
88
+ reviewed_by: josh.pencheon
89
+ safe_revision: 526dbe8a3dc3334b4174928e6f51d07e48ed9247
86
90
  lib/canql/grammars/main.treetop:
87
91
  comments: It is a known issue that this is potentially susceptible to certain
88
92
  kinds of DoS attack
89
- reviewed_by: timgentry
90
- safe_revision: bf2fbe12794f8b53e30a1ace01677cf6f215dbca
93
+ reviewed_by: josh.pencheon
94
+ safe_revision: 526dbe8a3dc3334b4174928e6f51d07e48ed9247
91
95
  lib/canql/grammars/patient.treetop:
92
96
  comments: It is a known issue that this is potentially susceptible to certain
93
97
  kinds of DoS attack
@@ -105,8 +109,8 @@ file safety:
105
109
  safe_revision: c39d24bb500719971969762e94545e82866bf92f
106
110
  lib/canql/nodes.rb:
107
111
  comments:
108
- reviewed_by: timgentry
109
- safe_revision: 6932d590299ad4a9d2ba24b425b158c67142bf74
112
+ reviewed_by: josh.pencheon
113
+ safe_revision: 526dbe8a3dc3334b4174928e6f51d07e48ed9247
110
114
  lib/canql/nodes/age.rb:
111
115
  comments:
112
116
  reviewed_by: timgentry
@@ -127,10 +131,14 @@ file safety:
127
131
  comments:
128
132
  reviewed_by: timgentry
129
133
  safe_revision: 1b73bdcf483c6e44979e183c5873a1f0612a49a1
134
+ lib/canql/nodes/genetic_test.rb:
135
+ comments:
136
+ reviewed_by: josh.pencheon
137
+ safe_revision: 526dbe8a3dc3334b4174928e6f51d07e48ed9247
130
138
  lib/canql/nodes/main.rb:
131
139
  comments:
132
- reviewed_by: timgentry
133
- safe_revision: c39d24bb500719971969762e94545e82866bf92f
140
+ reviewed_by: josh.pencheon
141
+ safe_revision: 526dbe8a3dc3334b4174928e6f51d07e48ed9247
134
142
  lib/canql/nodes/patient.rb:
135
143
  comments:
136
144
  reviewed_by: josh.pencheon
@@ -153,8 +161,8 @@ file safety:
153
161
  safe_revision: 6932d590299ad4a9d2ba24b425b158c67142bf74
154
162
  lib/canql/version.rb:
155
163
  comments:
156
- reviewed_by: timgentry
157
- safe_revision: df59353b99c2536124308c7c137e8f0587676200
164
+ reviewed_by: josh.pencheon
165
+ safe_revision: 60f7281fd6ef911b932992b2c965c6f8ace182c5
158
166
  test/anomaly_test_helper.rb:
159
167
  comments:
160
168
  reviewed_by: timgentry
@@ -183,6 +191,10 @@ file safety:
183
191
  comments:
184
192
  reviewed_by: timgentry
185
193
  safe_revision: 6932d590299ad4a9d2ba24b425b158c67142bf74
194
+ test/nodes/genetic_tests_test.rb:
195
+ comments:
196
+ reviewed_by: josh.pencheon
197
+ safe_revision: 526dbe8a3dc3334b4174928e6f51d07e48ed9247
186
198
  test/nodes/main_test.rb:
187
199
  comments:
188
200
  reviewed_by: timgentry
@@ -0,0 +1,15 @@
1
+ module Canql
2
+ grammar GeneticTest
3
+ rule genetic_tests
4
+ and_keyword? existance_modifier:genetic_tests_no_keyword? genetic_tests_keyword <Nodes::GeneticTest::WithCondition>
5
+ end
6
+
7
+ rule genetic_tests_no_keyword
8
+ space ('no' / 'some') word_break
9
+ end
10
+
11
+ rule genetic_tests_keyword
12
+ space 'genetic tests' word_break
13
+ end
14
+ end
15
+ end
@@ -2,6 +2,7 @@ grammar Canql
2
2
  include Registry
3
3
  include Patient
4
4
  include Anomaly
5
+ include GeneticTest
5
6
  include TestResult
6
7
  include Dates
7
8
  include EBaseRecords
@@ -97,6 +98,6 @@ grammar Canql
97
98
  end
98
99
 
99
100
  rule with_conditions
100
- anomalies / test_results / patient_field_existance / mother_conditions / action_or_ebr
101
+ anomalies / genetic_tests / test_results / patient_field_existance / mother_conditions / action_or_ebr
101
102
  end
102
103
  end
@@ -7,6 +7,7 @@ Treetop.load File.expand_path('grammars/dates', File.dirname(__FILE__))
7
7
  Treetop.load File.expand_path('grammars/anomaly', File.dirname(__FILE__))
8
8
  Treetop.load File.expand_path('grammars/batch_types', File.dirname(__FILE__))
9
9
  Treetop.load File.expand_path('grammars/e_base_records', File.dirname(__FILE__))
10
+ Treetop.load File.expand_path('grammars/genetic_test', File.dirname(__FILE__))
10
11
  Treetop.load File.expand_path('grammars/test_result', File.dirname(__FILE__))
11
12
  Treetop.load File.expand_path('grammars/patient', File.dirname(__FILE__))
12
13
  Treetop.load File.expand_path('grammars/registry', File.dirname(__FILE__))
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Canql #:nodoc: all
4
+ module Nodes
5
+ module GeneticTest
6
+ module WithCondition
7
+ def to_genetic_test
8
+ genetic_test_hash = { 'exists' => existance_filter }
9
+ genetic_test_hash
10
+ end
11
+
12
+ def existance_filter
13
+ { Canql::EQUALS => existance_modifier.text_value.strip != 'no' }
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -20,14 +20,17 @@ module Canql #:nodoc: all
20
20
  def meta_data_item
21
21
  conditions = {}
22
22
  anomalies = []
23
+ genetic_tests = []
23
24
  test_results = []
24
25
 
25
26
  post.elements.each do |element|
26
27
  anomalies << element.to_anomaly if element.respond_to?(:to_anomaly)
28
+ genetic_tests << element.to_genetic_test if element.respond_to?(:to_genetic_test)
27
29
  test_results << element.to_test_result if element.respond_to?(:to_test_result)
28
30
  end
29
31
 
30
32
  conditions['anomalies'] = { Canql::ALL => anomalies } if anomalies.any?
33
+ conditions['genetic_tests'] = { Canql::ALL => genetic_tests } if genetic_tests.any?
31
34
  conditions['test_results'] = { Canql::ALL => test_results } if test_results.any?
32
35
  conditions
33
36
  end
data/lib/canql/nodes.rb CHANGED
@@ -15,6 +15,7 @@ require 'canql/nodes/dates'
15
15
  require 'canql/nodes/e_base_records'
16
16
  require 'canql/nodes/batch_types'
17
17
  require 'canql/nodes/anomaly'
18
+ require 'canql/nodes/genetic_test'
18
19
  require 'canql/nodes/test_result'
19
20
  require 'canql/nodes/patient'
20
21
  require 'canql/nodes/main'
data/lib/canql/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  # This stores the current version of the Canql gem
4
4
  module Canql
5
- VERSION = '2.3.0'
5
+ VERSION = '2.4.0'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canql
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - PHE NDR Development Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-08 00:00:00.000000000 Z
11
+ date: 2018-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chronic
@@ -237,6 +237,7 @@ files:
237
237
  - lib/canql/grammars/batch_types.treetop
238
238
  - lib/canql/grammars/dates.treetop
239
239
  - lib/canql/grammars/e_base_records.treetop
240
+ - lib/canql/grammars/genetic_test.treetop
240
241
  - lib/canql/grammars/main.treetop
241
242
  - lib/canql/grammars/patient.treetop
242
243
  - lib/canql/grammars/registry.treetop
@@ -247,6 +248,7 @@ files:
247
248
  - lib/canql/nodes/batch_types.rb
248
249
  - lib/canql/nodes/dates.rb
249
250
  - lib/canql/nodes/e_base_records.rb
251
+ - lib/canql/nodes/genetic_test.rb
250
252
  - lib/canql/nodes/main.rb
251
253
  - lib/canql/nodes/patient.rb
252
254
  - lib/canql/nodes/registry.rb