canql 5.4.0 → 5.7.1
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 +20 -6
- data/README.md +1 -1
- data/code_safety.yml +43 -27
- data/lib/canql/grammars/anomaly.treetop +1 -1
- data/lib/canql/grammars/batch_types.treetop +19 -2
- data/lib/canql/grammars/hes_event.treetop +15 -0
- data/lib/canql/grammars/main.treetop +4 -2
- data/lib/canql/grammars/patient.treetop +3 -2
- data/lib/canql/grammars.rb +1 -0
- data/lib/canql/nodes/batch_types.rb +25 -1
- data/lib/canql/nodes/hes_event.rb +17 -0
- data/lib/canql/nodes/main.rb +2 -1
- data/lib/canql/nodes/patient.rb +7 -6
- data/lib/canql/nodes.rb +1 -0
- 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: b8c04694a35cd216e3d898eea6e2203a777f9d5116c40bff49b8da75483d868a
|
4
|
+
data.tar.gz: c18be16aa74a11cce48a9aa7d985acbc202c61c5f10e3a1cfddd07c667f83eec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 489de8c90e7f56acee103535eb963227c91f2bc4e6f6c480ba03881e3778ba5fe48e09ee7084e7bea2535fe3a096ced179654c216121967127a72636e1f8cd3e
|
7
|
+
data.tar.gz: 62cab1efb443fa2bf8db58b3d84516d89088897be2ab543904c6cd58150bb9320f99fb214eb855412d33a335e42c3cf1d8c471f589549834e5276b16f23a3a26
|
data/.github/workflows/test.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,25 +1,39 @@
|
|
1
1
|
## [Unreleased]
|
2
|
-
*
|
2
|
+
*no unreleased changes*
|
3
3
|
|
4
|
-
## 5.
|
4
|
+
## 5.7.1 / 2021-10-11
|
5
|
+
### Patched
|
6
|
+
* Corrected issue where date related tests failed on some ruby version (#83)
|
7
|
+
|
8
|
+
## 5.7.0 / 2021-09-16
|
9
|
+
* Added new 'fasp' and 'fasp amber and green' case / patient / anomaly categoryfilters (#78)
|
10
|
+
* Added new HES, BIOCHEM and USS unprocessed record filters (#79)
|
11
|
+
|
12
|
+
## 5.6.0 / 2021-03-16
|
13
|
+
### Added
|
14
|
+
* Add new CA Death option to the unprocessed record filter (#75)
|
5
15
|
|
16
|
+
## 5.5.0 / 2021-03-16
|
17
|
+
### Added
|
18
|
+
* Add HES event filter (#72)
|
19
|
+
|
20
|
+
## 5.4.0 / 2021-03-08
|
21
|
+
### Added
|
6
22
|
* Add 'pending data' option to the anomaly screening status filter (#69)
|
7
23
|
|
8
24
|
## 5.3.0 / 2021-03-05
|
9
|
-
|
25
|
+
### Added
|
10
26
|
* Added new FASP case RAG rating filters (#66)
|
11
27
|
|
12
28
|
## 5.2.0 / 2021-03-04
|
13
|
-
|
29
|
+
### Added
|
14
30
|
* Added new FASP anomaly RAG rating filters (#63)
|
15
31
|
|
16
32
|
## 5.1.0 / 2021-01-25
|
17
|
-
|
18
33
|
### Added
|
19
34
|
* Added new filters for test acceptance requirments (#59)
|
20
35
|
|
21
36
|
## 5.0.0 / 2021-01-19
|
22
|
-
|
23
37
|
### Changed
|
24
38
|
* Changed the values of registry to use registry name rather than codes and added new supra-region options (#54)
|
25
39
|
|
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
|
@@ -27,7 +27,7 @@ file safety:
|
|
27
27
|
CHANGELOG.md:
|
28
28
|
comments:
|
29
29
|
reviewed_by: ollietulloch
|
30
|
-
safe_revision:
|
30
|
+
safe_revision: 80a300b5aeadf74ca952d4adc4a7a49595e3cc6d
|
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
|
@@ -80,12 +80,12 @@ file safety:
|
|
80
80
|
lib/canql/grammars/anomaly.treetop:
|
81
81
|
comments: It is a known issue that this is potentially susceptible to certain
|
82
82
|
kinds of DoS attack
|
83
|
-
reviewed_by:
|
84
|
-
safe_revision:
|
83
|
+
reviewed_by: kenny.lee
|
84
|
+
safe_revision: 7580eb6b1196dec1fb778ee345d2bce50ef0f7c7
|
85
85
|
lib/canql/grammars/batch_types.treetop:
|
86
86
|
comments:
|
87
|
-
reviewed_by:
|
88
|
-
safe_revision:
|
87
|
+
reviewed_by: kenny.lee
|
88
|
+
safe_revision: 5bd6ccd1951140ab01b701583af94f414188b299
|
89
89
|
lib/canql/grammars/dates.treetop:
|
90
90
|
comments: It is a known issue that this is potentially susceptible to certain
|
91
91
|
kinds of DoS attack
|
@@ -99,16 +99,20 @@ 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
|
110
|
-
reviewed_by:
|
111
|
-
safe_revision:
|
114
|
+
reviewed_by: kenny.lee
|
115
|
+
safe_revision: a69bbd63d71d5fb2ba46d6a84589915b1120763b
|
112
116
|
lib/canql/grammars/perinatal_hospital.treetop:
|
113
117
|
comments:
|
114
118
|
reviewed_by: josh.pencheon
|
@@ -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
|
@@ -145,8 +149,8 @@ file safety:
|
|
145
149
|
safe_revision: e549c0dcafdd6004ec279bd256fae8b9964c9629
|
146
150
|
lib/canql/nodes/batch_types.rb:
|
147
151
|
comments:
|
148
|
-
reviewed_by:
|
149
|
-
safe_revision:
|
152
|
+
reviewed_by: kenny.lee
|
153
|
+
safe_revision: 49d17e254a95d50dea1448ca59fd45c44937d661
|
150
154
|
lib/canql/nodes/dates.rb:
|
151
155
|
comments:
|
152
156
|
reviewed_by: timgentry
|
@@ -159,14 +163,18 @@ 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
|
-
reviewed_by:
|
169
|
-
safe_revision:
|
176
|
+
reviewed_by: kenny.lee
|
177
|
+
safe_revision: 49d17e254a95d50dea1448ca59fd45c44937d661
|
170
178
|
lib/canql/nodes/perinatal_hospital.rb:
|
171
179
|
comments:
|
172
180
|
reviewed_by: josh.pencheon
|
@@ -194,7 +202,7 @@ file safety:
|
|
194
202
|
lib/canql/version.rb:
|
195
203
|
comments:
|
196
204
|
reviewed_by: ollietulloch
|
197
|
-
safe_revision:
|
205
|
+
safe_revision: 80a300b5aeadf74ca952d4adc4a7a49595e3cc6d
|
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
|
@@ -221,16 +233,20 @@ file safety:
|
|
221
233
|
safe_revision: 7490099869e368dcd5c26ded11eb90229baf4cae
|
222
234
|
test/nodes/code_test.rb:
|
223
235
|
comments:
|
224
|
-
reviewed_by:
|
225
|
-
safe_revision:
|
236
|
+
reviewed_by: kenny.lee
|
237
|
+
safe_revision: 7580eb6b1196dec1fb778ee345d2bce50ef0f7c7
|
226
238
|
test/nodes/e_base_records_test.rb:
|
227
239
|
comments:
|
228
|
-
reviewed_by:
|
229
|
-
safe_revision:
|
240
|
+
reviewed_by: ollietulloch
|
241
|
+
safe_revision: bdbff32b03f27a487a68f72f8663215282bf62b6
|
230
242
|
test/nodes/genetic_tests_test.rb:
|
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
|
@@ -241,16 +257,16 @@ file safety:
|
|
241
257
|
safe_revision: 511e4238f83eb5b32839c25d94ec2a59145539bb
|
242
258
|
test/nodes/mother_e_base_records_test.rb:
|
243
259
|
comments:
|
244
|
-
reviewed_by:
|
245
|
-
safe_revision:
|
260
|
+
reviewed_by: kenny.lee
|
261
|
+
safe_revision: 99ef15c6610409a1562e6a03b015569d087b045f
|
246
262
|
test/nodes/patient_age_test.rb:
|
247
263
|
comments:
|
248
264
|
reviewed_by: josh.pencheon
|
249
265
|
safe_revision: 511e4238f83eb5b32839c25d94ec2a59145539bb
|
250
266
|
test/nodes/patient_test.rb:
|
251
267
|
comments:
|
252
|
-
reviewed_by:
|
253
|
-
safe_revision:
|
268
|
+
reviewed_by: kenny.lee
|
269
|
+
safe_revision: a69bbd63d71d5fb2ba46d6a84589915b1120763b
|
254
270
|
test/nodes/perinatal_hospital_test.rb:
|
255
271
|
comments:
|
256
272
|
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
|
@@ -47,7 +47,7 @@ module Canql
|
|
47
47
|
end
|
48
48
|
|
49
49
|
rule fasp_rating
|
50
|
-
('fasp red and amber' / 'fasp amber and red' / 'fasp red' / 'fasp amber' / 'fasp green') <Nodes::Anomaly::SingleFaspRatingNode>
|
50
|
+
('fasp amber and green' / 'fasp green and amber' / 'fasp red and amber' / 'fasp amber and red' / 'fasp red' / 'fasp amber' / 'fasp green') <Nodes::Anomaly::SingleFaspRatingNode>
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|
@@ -1,7 +1,8 @@
|
|
1
1
|
module Canql
|
2
2
|
grammar BatchTypes
|
3
3
|
rule batch_type
|
4
|
-
(paediatric / enote2 / badger / ucyto / nipt / rddeath /
|
4
|
+
(paediatric / enote2 / badger / ucyto / nipt / rddeath /
|
5
|
+
umum / ca_death / biochem / hes / uss) <Nodes::BatchTypeNode>
|
5
6
|
end
|
6
7
|
|
7
8
|
rule paediatric
|
@@ -24,12 +25,28 @@ module Canql
|
|
24
25
|
'nipt' <Nodes::NiptNode>
|
25
26
|
end
|
26
27
|
|
28
|
+
rule biochem
|
29
|
+
'biochem' <Nodes::BiochemNode>
|
30
|
+
end
|
31
|
+
|
32
|
+
rule hes
|
33
|
+
'hes' <Nodes::HesNode>
|
34
|
+
end
|
35
|
+
|
36
|
+
rule uss
|
37
|
+
('uss' / 'ultrasound screening' ) <Nodes::UssNode>
|
38
|
+
end
|
39
|
+
|
27
40
|
rule rddeath
|
28
|
-
('rddeath' / 'rare disease death') <Nodes::RddeathNode>
|
41
|
+
('rddeath' / 'rd death' / 'rare disease death') <Nodes::RddeathNode>
|
29
42
|
end
|
30
43
|
|
31
44
|
rule umum
|
32
45
|
('umum' / 'mum') <Nodes::UmumNode>
|
33
46
|
end
|
47
|
+
|
48
|
+
rule ca_death
|
49
|
+
('cadeath' / 'ca death' / 'congenital anomaly death') <Nodes::CADeathNode>
|
50
|
+
end
|
34
51
|
end
|
35
52
|
end
|
@@ -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
|
@@ -16,8 +16,9 @@ module Canql
|
|
16
16
|
space category:('eurocat amber and green' /
|
17
17
|
'eurocat red and amber' / 'eurocat red' / 'eurocat amber' /
|
18
18
|
'eurocat green' / 'eurocat' /
|
19
|
-
'fasp red and amber' / 'fasp amber and red' /
|
20
|
-
'fasp amber' / 'fasp green' / 'fasp
|
19
|
+
'fasp red and amber' / 'fasp amber and red' /
|
20
|
+
'fasp amber and green' / 'fasp green and amber' / 'fasp red' /
|
21
|
+
'fasp amber' / 'fasp green' / 'fasp excluded' / 'fasp'
|
21
22
|
) word_break <Nodes::Patient::CategoryNode>
|
22
23
|
end
|
23
24
|
|
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__))
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
module Canql
|
3
|
+
module Canql # :nodoc: all
|
4
4
|
module Nodes
|
5
5
|
module BatchTypeNode
|
6
6
|
def to_type
|
@@ -39,6 +39,24 @@ module Canql #:nodoc: all
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
+
module BiochemNode
|
43
|
+
def normalise
|
44
|
+
'biochem'
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
module HesNode
|
49
|
+
def normalise
|
50
|
+
'hes'
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
module UssNode
|
55
|
+
def normalise
|
56
|
+
'uss'
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
42
60
|
module RddeathNode
|
43
61
|
def normalise
|
44
62
|
'rd_death'
|
@@ -50,5 +68,11 @@ module Canql #:nodoc: all
|
|
50
68
|
'umum'
|
51
69
|
end
|
52
70
|
end
|
71
|
+
|
72
|
+
module CADeathNode
|
73
|
+
def normalise
|
74
|
+
'ca_death'
|
75
|
+
end
|
76
|
+
end
|
53
77
|
end
|
54
78
|
end
|
@@ -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/nodes/patient.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
module Canql
|
3
|
+
module Canql # :nodoc: all
|
4
4
|
module Nodes
|
5
5
|
module Patient
|
6
6
|
module GenderNode
|
@@ -30,6 +30,7 @@ module Canql #:nodoc: all
|
|
30
30
|
if category.text_value.start_with?('eurocat ') || category.text_value.start_with?('fasp ')
|
31
31
|
filter_value = category.text_value.gsub(/( )/, '_').downcase.gsub(/(_and_)/, '_')
|
32
32
|
filter_value = 'fasp_red_amber' if filter_value == 'fasp_amber_red'
|
33
|
+
filter_value = 'fasp_amber_green' if filter_value == 'fasp_green_amber'
|
33
34
|
return filter_value
|
34
35
|
end
|
35
36
|
|
@@ -40,16 +41,16 @@ module Canql #:nodoc: all
|
|
40
41
|
module FieldExists
|
41
42
|
FIELDS = {
|
42
43
|
'date of birth': { patient: 'birthdate', mother: 'birthdate' },
|
43
|
-
|
44
|
+
dob: { patient: 'birthdate', mother: 'birthdate' },
|
44
45
|
'date of vital status': { patient: 'dateofvitalstatus', mother: 'dateofvitalstatus' },
|
45
46
|
'delivery postcode': { patient: 'delivery_postcode' },
|
46
47
|
'booking postcode': { patient: 'booking_postcode' },
|
47
48
|
'nhs number': { patient: 'nhsnumber', mother: 'nhsnumber' },
|
48
49
|
'birth weight': { patient: 'weight' },
|
49
50
|
'place of delivery': { patient: 'placeofdelivery' },
|
50
|
-
|
51
|
-
|
52
|
-
|
51
|
+
sex: { patient: 'sex' },
|
52
|
+
outcome: { patient: 'outcome' },
|
53
|
+
edd: { patient: 'expecteddeliverydate' },
|
53
54
|
'expected delivery date': { patient: 'expecteddeliverydate' },
|
54
55
|
'booking hospital': { patient: 'booking_hospital' },
|
55
56
|
'screening status': { patient: 'screeningstatus' },
|
@@ -65,7 +66,7 @@ module Canql #:nodoc: all
|
|
65
66
|
patient_field_list.text_values_for_marker(:patient_field_name), subject.to_sym
|
66
67
|
)
|
67
68
|
modifer = field_existance_modifier.text_value.strip
|
68
|
-
existance = modifer
|
69
|
+
existance = modifer == 'missing' ? 'fields_missing' : 'fields_populated'
|
69
70
|
{ "#{subject}.#{existance}" => { Canql::EQUALS => field_names } }
|
70
71
|
end
|
71
72
|
|
data/lib/canql/nodes.rb
CHANGED
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.7.1
|
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-
|
11
|
+
date: 2021-10-11 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
|