canql 5.4.0 → 5.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +1 -1
- data/CHANGELOG.md +7 -5
- data/README.md +1 -1
- data/code_safety.yml +27 -11
- data/lib/canql/grammars.rb +1 -0
- data/lib/canql/grammars/hes_event.treetop +15 -0
- data/lib/canql/grammars/main.treetop +4 -2
- data/lib/canql/nodes.rb +1 -0
- data/lib/canql/nodes/hes_event.rb +17 -0
- data/lib/canql/nodes/main.rb +2 -1
- data/lib/canql/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f1406cd4a6e0b0e9f66ef6386f0356b8b60e7c9ed6300ac8366a3e6b65aad4c
|
4
|
+
data.tar.gz: 6933617a2d3b293fa5c844d4885ee2e0b005cb5ba4596de4699fcaf3254faff5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 458ad85cf4588bde403a34ec3721a5e6f22b2a7242029f9d21b4f9f4fa1264355c408e8ba84f8cb280023b5fff5ab480ba5a29d163e62030e7b2b3354d1b301d
|
7
|
+
data.tar.gz: dd916f281f0d531b84ac6e6ff696d28761d92915e70eca5266bfdd4c5ea3f93daaa1dbb246e9482e47b6e6a6b9907f6d1fdca8ac2e8e47f69ea1da1a1ff5b359
|
data/.github/workflows/test.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,25 +1,27 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
* no relevant changes
|
3
3
|
|
4
|
-
## 5.
|
4
|
+
## 5.5.0 / 2021-03-16
|
5
|
+
### Added
|
6
|
+
* Add HES event filter (#72)
|
5
7
|
|
8
|
+
## 5.4.0 / 2021-03-08
|
9
|
+
### Added
|
6
10
|
* Add 'pending data' option to the anomaly screening status filter (#69)
|
7
11
|
|
8
12
|
## 5.3.0 / 2021-03-05
|
9
|
-
|
13
|
+
### Added
|
10
14
|
* Added new FASP case RAG rating filters (#66)
|
11
15
|
|
12
16
|
## 5.2.0 / 2021-03-04
|
13
|
-
|
17
|
+
### Added
|
14
18
|
* Added new FASP anomaly RAG rating filters (#63)
|
15
19
|
|
16
20
|
## 5.1.0 / 2021-01-25
|
17
|
-
|
18
21
|
### Added
|
19
22
|
* Added new filters for test acceptance requirments (#59)
|
20
23
|
|
21
24
|
## 5.0.0 / 2021-01-19
|
22
|
-
|
23
25
|
### Changed
|
24
26
|
* Changed the values of registry to use registry name rather than codes and added new supra-region options (#54)
|
25
27
|
|
data/README.md
CHANGED
@@ -50,7 +50,7 @@ would output:
|
|
50
50
|
and booking at hospital RGT01 and delivery at addenbrookes trust
|
51
51
|
The parser is case insensitive. An example of an almost fully involved CANQL query is:
|
52
52
|
|
53
|
-
> First 27 Male Liveborn Thames Primary Cases Due between 20/06/2015 and 25/06/2015 and Born on 22/06/2015 and that Died on 07/07/2015 with Suspected Prenatal Q20 Anomalies and Booking at hospital RGT01 and Delivery at addenbrookes trust and Postnatal Tests and Missing Postcode and Date of Birth and QA Action and Unprocessed paediatric records and Mother Born between 01/10/1990 and 10/01/1999 and who Died on 01/08/2015 with Populated Postcode and NHS Number
|
53
|
+
> First 27 Male Liveborn Thames Primary Cases Due between 20/06/2015 and 25/06/2015 and Born on 22/06/2015 and that Died on 07/07/2015 with Suspected Prenatal Q20 Anomalies and Booking at hospital RGT01 and Delivery at addenbrookes trust and Postnatal Tests and Missing Postcode and Date of Birth and QA Action and Unprocessed paediatric records and hes records and Mother Born between 01/10/1990 and 10/01/1999 and who Died on 01/08/2015 with Populated Postcode and NHS Number
|
54
54
|
|
55
55
|
Please see the tests for many more examples.
|
56
56
|
|
data/code_safety.yml
CHANGED
@@ -11,7 +11,7 @@ file safety:
|
|
11
11
|
".github/workflows/test.yml":
|
12
12
|
comments:
|
13
13
|
reviewed_by: josh.pencheon
|
14
|
-
safe_revision:
|
14
|
+
safe_revision: a3f5265f1d20a6dcb8c45ab5f09207ca7d1e255c
|
15
15
|
".gitignore":
|
16
16
|
comments:
|
17
17
|
reviewed_by: timgentry
|
@@ -26,8 +26,8 @@ file safety:
|
|
26
26
|
safe_revision: 146b255b240b0efc928d39dd1b70ab221ddc3138
|
27
27
|
CHANGELOG.md:
|
28
28
|
comments:
|
29
|
-
reviewed_by:
|
30
|
-
safe_revision:
|
29
|
+
reviewed_by: josh.pencheon
|
30
|
+
safe_revision: 154d287a89e13c77b34642ffb33eb4c07953aa1b
|
31
31
|
CODE_OF_CONDUCT.md:
|
32
32
|
comments:
|
33
33
|
reviewed_by: drewthorp
|
@@ -43,7 +43,7 @@ file safety:
|
|
43
43
|
README.md:
|
44
44
|
comments:
|
45
45
|
reviewed_by: josh.pencheon
|
46
|
-
safe_revision:
|
46
|
+
safe_revision: 3ace8794c1c545b47898da1fbee49af8afdbf521
|
47
47
|
Rakefile:
|
48
48
|
comments:
|
49
49
|
reviewed_by: timgentry
|
@@ -71,7 +71,7 @@ file safety:
|
|
71
71
|
lib/canql/grammars.rb:
|
72
72
|
comments:
|
73
73
|
reviewed_by: josh.pencheon
|
74
|
-
safe_revision:
|
74
|
+
safe_revision: 3ace8794c1c545b47898da1fbee49af8afdbf521
|
75
75
|
lib/canql/grammars/age.treetop:
|
76
76
|
comments: It is a known issue that this is potentially susceptible to certain
|
77
77
|
kinds of DoS attack
|
@@ -99,11 +99,15 @@ file safety:
|
|
99
99
|
comments:
|
100
100
|
reviewed_by: josh.pencheon
|
101
101
|
safe_revision: 526dbe8a3dc3334b4174928e6f51d07e48ed9247
|
102
|
+
lib/canql/grammars/hes_event.treetop:
|
103
|
+
comments:
|
104
|
+
reviewed_by: josh.pencheon
|
105
|
+
safe_revision: 3ace8794c1c545b47898da1fbee49af8afdbf521
|
102
106
|
lib/canql/grammars/main.treetop:
|
103
107
|
comments: It is a known issue that this is potentially susceptible to certain
|
104
108
|
kinds of DoS attack
|
105
109
|
reviewed_by: josh.pencheon
|
106
|
-
safe_revision:
|
110
|
+
safe_revision: 3ace8794c1c545b47898da1fbee49af8afdbf521
|
107
111
|
lib/canql/grammars/patient.treetop:
|
108
112
|
comments: It is a known issue that this is potentially susceptible to certain
|
109
113
|
kinds of DoS attack
|
@@ -134,7 +138,7 @@ file safety:
|
|
134
138
|
lib/canql/nodes.rb:
|
135
139
|
comments:
|
136
140
|
reviewed_by: josh.pencheon
|
137
|
-
safe_revision:
|
141
|
+
safe_revision: 3ace8794c1c545b47898da1fbee49af8afdbf521
|
138
142
|
lib/canql/nodes/age.rb:
|
139
143
|
comments:
|
140
144
|
reviewed_by: timgentry
|
@@ -159,10 +163,14 @@ file safety:
|
|
159
163
|
comments:
|
160
164
|
reviewed_by: josh.pencheon
|
161
165
|
safe_revision: 526dbe8a3dc3334b4174928e6f51d07e48ed9247
|
166
|
+
lib/canql/nodes/hes_event.rb:
|
167
|
+
comments:
|
168
|
+
reviewed_by: josh.pencheon
|
169
|
+
safe_revision: 3ace8794c1c545b47898da1fbee49af8afdbf521
|
162
170
|
lib/canql/nodes/main.rb:
|
163
171
|
comments:
|
164
172
|
reviewed_by: josh.pencheon
|
165
|
-
safe_revision:
|
173
|
+
safe_revision: 3ace8794c1c545b47898da1fbee49af8afdbf521
|
166
174
|
lib/canql/nodes/patient.rb:
|
167
175
|
comments:
|
168
176
|
reviewed_by: ollietulloch
|
@@ -193,8 +201,8 @@ file safety:
|
|
193
201
|
safe_revision: 6932d590299ad4a9d2ba24b425b158c67142bf74
|
194
202
|
lib/canql/version.rb:
|
195
203
|
comments:
|
196
|
-
reviewed_by:
|
197
|
-
safe_revision:
|
204
|
+
reviewed_by: josh.pencheon
|
205
|
+
safe_revision: 154d287a89e13c77b34642ffb33eb4c07953aa1b
|
198
206
|
test/anomaly_test_helper.rb:
|
199
207
|
comments:
|
200
208
|
reviewed_by: ollietulloch
|
@@ -203,6 +211,10 @@ file safety:
|
|
203
211
|
comments:
|
204
212
|
reviewed_by: timgentry
|
205
213
|
safe_revision: 6932d590299ad4a9d2ba24b425b158c67142bf74
|
214
|
+
test/hes_event_test_helper.rb:
|
215
|
+
comments:
|
216
|
+
reviewed_by: josh.pencheon
|
217
|
+
safe_revision: 3ace8794c1c545b47898da1fbee49af8afdbf521
|
206
218
|
test/minitest_helper.rb:
|
207
219
|
comments:
|
208
220
|
reviewed_by: timgentry
|
@@ -231,6 +243,10 @@ file safety:
|
|
231
243
|
comments:
|
232
244
|
reviewed_by: josh.pencheon
|
233
245
|
safe_revision: 511e4238f83eb5b32839c25d94ec2a59145539bb
|
246
|
+
test/nodes/hes_event_test.rb:
|
247
|
+
comments:
|
248
|
+
reviewed_by: josh.pencheon
|
249
|
+
safe_revision: 3ace8794c1c545b47898da1fbee49af8afdbf521
|
234
250
|
test/nodes/main_case_test.rb:
|
235
251
|
comments:
|
236
252
|
reviewed_by: josh.pencheon
|
@@ -270,7 +286,7 @@ file safety:
|
|
270
286
|
test/parser_test.rb:
|
271
287
|
comments:
|
272
288
|
reviewed_by: josh.pencheon
|
273
|
-
safe_revision:
|
289
|
+
safe_revision: 3ace8794c1c545b47898da1fbee49af8afdbf521
|
274
290
|
test/test_helper.rb:
|
275
291
|
comments:
|
276
292
|
reviewed_by: josh.pencheon
|
data/lib/canql/grammars.rb
CHANGED
@@ -14,4 +14,5 @@ Treetop.load File.expand_path('grammars/patient', File.dirname(__FILE__))
|
|
14
14
|
Treetop.load File.expand_path('grammars/registry', File.dirname(__FILE__))
|
15
15
|
Treetop.load File.expand_path('grammars/provider', File.dirname(__FILE__))
|
16
16
|
Treetop.load File.expand_path('grammars/perinatal_hospital', File.dirname(__FILE__))
|
17
|
+
Treetop.load File.expand_path('grammars/hes_event', File.dirname(__FILE__))
|
17
18
|
Treetop.load File.expand_path('grammars/main', File.dirname(__FILE__))
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Canql
|
2
|
+
grammar HesEvent
|
3
|
+
rule hes_events
|
4
|
+
and_keyword? existance_modifier:hes_no_keyword? hes_keyword <Nodes::HesEvent::WithCondition>
|
5
|
+
end
|
6
|
+
|
7
|
+
rule hes_no_keyword
|
8
|
+
space ('no' / 'some') word_break
|
9
|
+
end
|
10
|
+
|
11
|
+
rule hes_keyword
|
12
|
+
space ('hes events' / 'hes records') word_break
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -6,6 +6,7 @@ grammar Canql
|
|
6
6
|
include GeneticTest
|
7
7
|
include TestResult
|
8
8
|
include TestResultGroup
|
9
|
+
include HesEvent
|
9
10
|
include Dates
|
10
11
|
include EBaseRecords
|
11
12
|
include BatchTypes
|
@@ -130,10 +131,11 @@ grammar Canql
|
|
130
131
|
rule case_with_conditions
|
131
132
|
anomalies / genetic_tests / test_results / perinatal_hospital /
|
132
133
|
case_field_existance / test_acceptance_existance / test_result_groups /
|
133
|
-
mother_conditions / action_or_ebr
|
134
|
+
mother_conditions / action_or_ebr / hes_events
|
134
135
|
end
|
135
136
|
|
136
137
|
rule patient_with_conditions
|
137
|
-
anomalies / genetic_tests / test_results / patient_field_existance /
|
138
|
+
anomalies / genetic_tests / test_results / patient_field_existance /
|
139
|
+
action_or_ebr / hes_events
|
138
140
|
end
|
139
141
|
end
|
data/lib/canql/nodes.rb
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Canql #:nodoc: all
|
4
|
+
module Nodes
|
5
|
+
module HesEvent
|
6
|
+
module WithCondition
|
7
|
+
def to_hes
|
8
|
+
{ 'exists' => existance_filter }
|
9
|
+
end
|
10
|
+
|
11
|
+
def existance_filter
|
12
|
+
{ Canql::EQUALS => existance_modifier.text_value.strip != 'no' }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/canql/nodes/main.rb
CHANGED
@@ -32,7 +32,7 @@ module Canql #:nodoc: all
|
|
32
32
|
sub_clauses = build_sub_clauses
|
33
33
|
|
34
34
|
%i[
|
35
|
-
anomalies genetic_tests test_results test_result_groups test_acceptances
|
35
|
+
anomalies genetic_tests test_results test_result_groups test_acceptances hes_events
|
36
36
|
].each do |condition_key|
|
37
37
|
if sub_clauses[condition_key].present?
|
38
38
|
conditions[condition_key.to_s] = { Canql::ALL => sub_clauses[condition_key] }
|
@@ -52,6 +52,7 @@ module Canql #:nodoc: all
|
|
52
52
|
sub_clauses, element, :test_result_groups, :to_test_result_group
|
53
53
|
)
|
54
54
|
add_sub_clause(sub_clauses, element, :test_acceptances, :to_test_acceptance)
|
55
|
+
add_sub_clause(sub_clauses, element, :hes_events, :to_hes)
|
55
56
|
end
|
56
57
|
sub_clauses
|
57
58
|
end
|
data/lib/canql/version.rb
CHANGED
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: 5.
|
4
|
+
version: 5.5.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: 2021-03-
|
11
|
+
date: 2021-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chronic
|
@@ -235,6 +235,7 @@ files:
|
|
235
235
|
- lib/canql/grammars/dates.treetop
|
236
236
|
- lib/canql/grammars/e_base_records.treetop
|
237
237
|
- lib/canql/grammars/genetic_test.treetop
|
238
|
+
- lib/canql/grammars/hes_event.treetop
|
238
239
|
- lib/canql/grammars/main.treetop
|
239
240
|
- lib/canql/grammars/patient.treetop
|
240
241
|
- lib/canql/grammars/perinatal_hospital.treetop
|
@@ -249,6 +250,7 @@ files:
|
|
249
250
|
- lib/canql/nodes/dates.rb
|
250
251
|
- lib/canql/nodes/e_base_records.rb
|
251
252
|
- lib/canql/nodes/genetic_test.rb
|
253
|
+
- lib/canql/nodes/hes_event.rb
|
252
254
|
- lib/canql/nodes/main.rb
|
253
255
|
- lib/canql/nodes/patient.rb
|
254
256
|
- lib/canql/nodes/perinatal_hospital.rb
|