canql 1.3.0 → 1.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 +4 -4
- data/README.md +1 -1
- data/code_safety.yml +8 -8
- data/lib/canql/grammars/e_base_records.treetop +16 -5
- data/lib/canql/nodes/dates.rb +1 -1
- data/lib/canql/nodes/e_base_records.rb +7 -0
- data/lib/canql/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 908424649a7d28653da8efecfbadc19b5d7fe4d3
|
4
|
+
data.tar.gz: 43ac92a2d6a232e5ea830314cdee6f1c9fd62463
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a68ca31580f89e796ef63917ce02ef7d40c52e5f07ce006977f641f8a1a15943e4f68fe9d61f021959cb9a09e1ab5fed5de14826ff8abf568a711e33524f3ae2
|
7
|
+
data.tar.gz: fdb25b3ebb45c2e1957dc42c51f45e66b0fba9507f6fc990336bae6796e5a1fda3963573d789c41589e558c3db108b17240f9d37f84ebb6926f2779b9fc9292f
|
data/README.md
CHANGED
@@ -50,7 +50,7 @@ would output:
|
|
50
50
|
|
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 Cases Due between 20/06/2015 and 25/06/2015 and Born on 22/06/2015 and that Died on 07/07/2015 with Prenatal Anomalies and Postnatal Tests and Missing Postcode and Date of Birth and
|
53
|
+
> First 27 Male Liveborn Thames Cases Due between 20/06/2015 and 25/06/2015 and Born on 22/06/2015 and that Died on 07/07/2015 with Prenatal Anomalies and Postnatal Tests and Missing Postcode and Date of Birth and Check 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
|
54
54
|
|
55
55
|
Please see the tests for many more examples.
|
56
56
|
|
data/code_safety.yml
CHANGED
@@ -31,7 +31,7 @@ file safety:
|
|
31
31
|
README.md:
|
32
32
|
comments:
|
33
33
|
reviewed_by: timgentry
|
34
|
-
safe_revision:
|
34
|
+
safe_revision: 3951ebc4b8d0a4cf30f3ce048a4ce33ffccdbd26
|
35
35
|
Rakefile:
|
36
36
|
comments:
|
37
37
|
reviewed_by: timgentry
|
@@ -82,7 +82,7 @@ file safety:
|
|
82
82
|
lib/canql/grammars/e_base_records.treetop:
|
83
83
|
comments:
|
84
84
|
reviewed_by: timgentry
|
85
|
-
safe_revision:
|
85
|
+
safe_revision: 1c30c1e78d86b74d747204ea40ae709ceaaf66b5
|
86
86
|
lib/canql/grammars/main.treetop:
|
87
87
|
comments: It is a known issue that this is potentially susceptible to certain
|
88
88
|
kinds of DoS attack
|
@@ -122,11 +122,11 @@ file safety:
|
|
122
122
|
lib/canql/nodes/dates.rb:
|
123
123
|
comments:
|
124
124
|
reviewed_by: timgentry
|
125
|
-
safe_revision:
|
125
|
+
safe_revision: 9b72e0c6f96aaa8b8d45e137bed846d76d357028
|
126
126
|
lib/canql/nodes/e_base_records.rb:
|
127
127
|
comments:
|
128
128
|
reviewed_by: timgentry
|
129
|
-
safe_revision:
|
129
|
+
safe_revision: 1c30c1e78d86b74d747204ea40ae709ceaaf66b5
|
130
130
|
lib/canql/nodes/main.rb:
|
131
131
|
comments:
|
132
132
|
reviewed_by: timgentry
|
@@ -154,7 +154,7 @@ file safety:
|
|
154
154
|
lib/canql/version.rb:
|
155
155
|
comments:
|
156
156
|
reviewed_by: timgentry
|
157
|
-
safe_revision:
|
157
|
+
safe_revision: 578a3f31d507cb2c73ea37c3cec14731a364f73c
|
158
158
|
test/canql_test.rb:
|
159
159
|
comments:
|
160
160
|
reviewed_by: timgentry
|
@@ -174,7 +174,7 @@ file safety:
|
|
174
174
|
test/nodes/e_base_rescords_test.rb:
|
175
175
|
comments:
|
176
176
|
reviewed_by: timgentry
|
177
|
-
safe_revision:
|
177
|
+
safe_revision: 1c30c1e78d86b74d747204ea40ae709ceaaf66b5
|
178
178
|
test/nodes/main_test.rb:
|
179
179
|
comments:
|
180
180
|
reviewed_by: timgentry
|
@@ -182,7 +182,7 @@ file safety:
|
|
182
182
|
test/nodes/patient_test.rb:
|
183
183
|
comments:
|
184
184
|
reviewed_by: timgentry
|
185
|
-
safe_revision:
|
185
|
+
safe_revision: 9b72e0c6f96aaa8b8d45e137bed846d76d357028
|
186
186
|
test/nodes/registry_test.rb:
|
187
187
|
comments:
|
188
188
|
reviewed_by: timgentry
|
@@ -194,7 +194,7 @@ file safety:
|
|
194
194
|
test/parser_test.rb:
|
195
195
|
comments:
|
196
196
|
reviewed_by: timgentry
|
197
|
-
safe_revision:
|
197
|
+
safe_revision: 3951ebc4b8d0a4cf30f3ce048a4ce33ffccdbd26
|
198
198
|
test/test_helper.rb:
|
199
199
|
comments:
|
200
200
|
reviewed_by: timgentry
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Canql
|
2
2
|
grammar EBaseRecords
|
3
3
|
rule action_or_ebr
|
4
|
-
and_keyword? action_and_ebr / actions / e_base_records
|
4
|
+
and_keyword? action_and_ebr / all_or_none_actions / actions / e_base_records
|
5
5
|
end
|
6
6
|
|
7
7
|
rule action_and_ebr
|
@@ -41,13 +41,24 @@ module Canql
|
|
41
41
|
end
|
42
42
|
|
43
43
|
rule accepted_action
|
44
|
-
|
45
|
-
'
|
46
|
-
|
44
|
+
'check' / 'coding_clinic' / 'coding_group' / 'complete' / 'reg_group' /
|
45
|
+
'scr_check' / 'scr_checked' / 'search' / 'technical'
|
46
|
+
end
|
47
|
+
|
48
|
+
rule all_or_none_actions
|
49
|
+
all_or_none_action_type action_keyword <Nodes::AllOrNoneActionsNode>
|
50
|
+
end
|
51
|
+
|
52
|
+
rule all_or_none_action_type
|
53
|
+
space all_or_none_action word_break
|
54
|
+
end
|
55
|
+
|
56
|
+
rule all_or_none_action
|
57
|
+
'no outstanding' / 'an outstanding'
|
47
58
|
end
|
48
59
|
|
49
60
|
rule action_keyword
|
50
|
-
space 'action' word_break
|
61
|
+
space 'action' 's'? word_break
|
51
62
|
end
|
52
63
|
|
53
64
|
rule at_keyword
|
data/lib/canql/nodes/dates.rb
CHANGED
@@ -48,7 +48,7 @@ module Canql #:nodoc: all
|
|
48
48
|
|
49
49
|
module ChronicDateNode
|
50
50
|
def to_daterange
|
51
|
-
chronic = Chronic.parse(text_value.to_s,
|
51
|
+
chronic = Chronic.parse(text_value.to_s, guess: false)
|
52
52
|
if chronic.instance_of?(Chronic::Span)
|
53
53
|
Daterange.new(chronic.begin, chronic.end - 1.day)
|
54
54
|
else
|
@@ -30,6 +30,13 @@ module Canql #:nodoc: all
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
+
module AllOrNoneActionsNode
|
34
|
+
def meta_data_item
|
35
|
+
action_type = all_or_none_action_type.text_value.upcase.strip
|
36
|
+
{ 'action.actioninitiated' => { Canql::ALL => action_type == 'AN OUTSTANDING' } }
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
33
40
|
module ActionsNode
|
34
41
|
def meta_data_item
|
35
42
|
{ 'action.actioninitiated' => { Canql::EQUALS => action_type.text_value.upcase.strip } }
|
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: 1.
|
4
|
+
version: 1.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: 2017-
|
11
|
+
date: 2017-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ndr_support
|