canql 1.3.0 → 1.4.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
  SHA1:
3
- metadata.gz: fcf2d37654027295939edf58f998fcc355b899da
4
- data.tar.gz: 5f13b67d937e9e5f7517f06a7cd7d296d82e87df
3
+ metadata.gz: 908424649a7d28653da8efecfbadc19b5d7fe4d3
4
+ data.tar.gz: 43ac92a2d6a232e5ea830314cdee6f1c9fd62463
5
5
  SHA512:
6
- metadata.gz: d8adc584f9bc0c2a66c80217875d838591b38838e2a9a1ef1da96b42445877db37f4b3a829f2b67601e1a3d6d616592738d62844a1b2f9e91ff6b29e714bb6ae
7
- data.tar.gz: 0d591c714d021a59182f9fbd129734fd59e07496c9bfeb24f586614f894ae9ce655fbb5559294e3d75ab83a9bcc6b971a299f77c340fe1f37bbf7cb5c4986255
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 Wait 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 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: cb1bd5162935d259f67a42044cbe5644fe6a76f8
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: 41d8f146c456e7bf252784476438574a9d283408
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: 2346abb4435bf95cbe9b4d8c124123b9fefe60d6
125
+ safe_revision: 9b72e0c6f96aaa8b8d45e137bed846d76d357028
126
126
  lib/canql/nodes/e_base_records.rb:
127
127
  comments:
128
128
  reviewed_by: timgentry
129
- safe_revision: d6f1ccac606735190d30c962b7681ed12aec374a
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: b67d28ae2648219607e40dc77d6aef846a64f647
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: d6f1ccac606735190d30c962b7681ed12aec374a
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: 0bf684b681372d16145cae8c6bb831f1bb96f442
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: a923656606f581c220ea7af16196f2c68b5248f2
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
- 'wait' / 'proforma' / 'transfer' / 'notes' / 'child' /
45
- 'qa' / 'tag' / 'qc' / 'query' /
46
- 'moreinfo' / 'search' / 'check' / 'gpsearch'
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
@@ -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, context: :past, guess: false)
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
@@ -2,5 +2,5 @@
2
2
 
3
3
  # This stores the current version of the Canql gem
4
4
  module Canql
5
- VERSION = '1.3.0'
5
+ VERSION = '1.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: 1.3.0
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-05-26 00:00:00.000000000 Z
11
+ date: 2017-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ndr_support