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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6fcbeb6ccebc9a99388e3eeb15f29d9faa270ac17f85cafecdf0384936fc8229
4
- data.tar.gz: 99b63524c4ac676bf7e878475ec59d53701cc35003ecc9dfdafd10630a98b637
3
+ metadata.gz: 6f1406cd4a6e0b0e9f66ef6386f0356b8b60e7c9ed6300ac8366a3e6b65aad4c
4
+ data.tar.gz: 6933617a2d3b293fa5c844d4885ee2e0b005cb5ba4596de4699fcaf3254faff5
5
5
  SHA512:
6
- metadata.gz: d7b16d016a069fb971fdbf749a3aaa935a9310d9f461109c3a12eb8a72d65ac98beb60eb3f6f7c5040c16b6a52fd39afdb513414cf82b3bdf35b7528c70ad8ae
7
- data.tar.gz: c44e33ce868f67731f27918dad42d4a683057390a9668c60332171ac337d3f643c6f0b03c103da05517be16720ac883cd4824a4a57870653f0363c30b3884649
6
+ metadata.gz: 458ad85cf4588bde403a34ec3721a5e6f22b2a7242029f9d21b4f9f4fa1264355c408e8ba84f8cb280023b5fff5ab480ba5a29d163e62030e7b2b3354d1b301d
7
+ data.tar.gz: dd916f281f0d531b84ac6e6ff696d28761d92915e70eca5266bfdd4c5ea3f93daaa1dbb246e9482e47b6e6a6b9907f6d1fdca8ac2e8e47f69ea1da1a1ff5b359
@@ -1,6 +1,6 @@
1
1
  name: Test
2
2
 
3
- on: [push, pull_request]
3
+ on: [push]
4
4
 
5
5
  jobs:
6
6
  test:
data/CHANGELOG.md CHANGED
@@ -1,25 +1,27 @@
1
1
  ## [Unreleased]
2
2
  * no relevant changes
3
3
 
4
- ## 5.4.0 / 2021-03-08
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: 865fc970554fee9207f8e3cd0247133c6a849b24
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: ollietulloch
30
- safe_revision: 8e66f9ea2d880e368446969c3b0e63a1660cb427
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: 8c07968aa84db92b6f1cc528180f73530ddc6ff5
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: c5f8f76b2c335a8554f39a14d6165bf5cd8f9b67
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: 9bb663b220e76e78f3f0f48e4bc6334fe9451925
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: c5f8f76b2c335a8554f39a14d6165bf5cd8f9b67
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: 361dea5dc6d64bdb7b03434dd2878f8c3b128c95
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: ollietulloch
197
- safe_revision: 8e66f9ea2d880e368446969c3b0e63a1660cb427
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: 293248a17d087d7557a6aacdcb5bf3fbec946b87
289
+ safe_revision: 3ace8794c1c545b47898da1fbee49af8afdbf521
274
290
  test/test_helper.rb:
275
291
  comments:
276
292
  reviewed_by: josh.pencheon
@@ -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 / action_or_ebr
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
@@ -22,3 +22,4 @@ require 'canql/nodes/patient'
22
22
  require 'canql/nodes/main'
23
23
  require 'canql/nodes/registry'
24
24
  require 'canql/nodes/perinatal_hospital'
25
+ require 'canql/nodes/hes_event'
@@ -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
@@ -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
@@ -2,5 +2,5 @@
2
2
 
3
3
  # This stores the current version of the Canql gem
4
4
  module Canql
5
- VERSION = '5.4.0'
5
+ VERSION = '5.5.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: 5.4.0
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-08 00:00:00.000000000 Z
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