hqmf2js 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +15 -0
  2. data/.travis.yml +2 -5
  3. data/Gemfile +6 -4
  4. data/Gemfile.lock +83 -86
  5. data/Rakefile +9 -5
  6. data/app/assets/javascripts/hqmf_util.js.coffee +98 -23
  7. data/app/assets/javascripts/logging_utils.js.coffee +25 -16
  8. data/app/assets/javascripts/patient_api_extension.js.coffee +85 -0
  9. data/app/assets/javascripts/specifics.js.coffee +60 -14
  10. data/hqmf2js.gemspec +8 -8
  11. data/lib/assets/javascripts/libraries/map_reduce_utils.js +130 -0
  12. data/lib/generator/characteristic.js.erb +28 -17
  13. data/lib/generator/codes_to_json.rb +5 -5
  14. data/lib/generator/data_criteria.js.erb +5 -5
  15. data/lib/generator/execution.rb +144 -0
  16. data/lib/generator/js.rb +46 -21
  17. data/lib/generator/observation_criteria.js.erb +1 -1
  18. data/lib/generator/patient_data.js.erb +22 -19
  19. data/lib/generator/population_criteria.js.erb +6 -1
  20. data/lib/generator/precondition.js.erb +5 -7
  21. data/lib/hqmf2js.rb +1 -0
  22. data/test/fixtures/codes/codes.json +54 -0
  23. data/test/fixtures/json/0495.json +1014 -0
  24. data/test/fixtures/json/59New.json +148 -0
  25. data/test/fixtures/json/data_criteria/specific_occurrence.json +27 -0
  26. data/test/fixtures/json/data_criteria/temporals_with_anynonnull.json +27 -0
  27. data/test/fixtures/patients/larry_vanderman.json +4 -4
  28. data/test/simplecov.rb +19 -0
  29. data/test/test_helper.rb +1 -1
  30. data/test/unit/cmd_test.rb +92 -0
  31. data/test/unit/codes_to_json_test.rb +32 -0
  32. data/test/unit/erb_context_test.rb +64 -0
  33. data/test/unit/hqmf_from_json_javascript_test.rb +37 -2
  34. data/test/unit/hqmf_javascript_test.rb +18 -0
  35. data/test/unit/js_object_test.rb +27 -0
  36. data/test/unit/library_function_test.rb +22 -21
  37. data/test/unit/specifics_test.rb +7 -2
  38. metadata +16 -121
  39. data/lib/tasks/cover_me.rake +0 -8
@@ -231,8 +231,11 @@ class SpecificsTest < Test::Unit::TestCase
231
231
  var row1 = new Row('OccurrenceAEncounter',{'OccurrenceAEncounter':{'id':1},'OccurrenceBEncounter':{'id':20}});
232
232
  var row2 = new Row('OccurrenceAEncounter',{'OccurrenceAEncounter':{'id':2},'OccurrenceBEncounter':{'id':20}});
233
233
  var row3 = new Row('OccurrenceAEncounter',{'OccurrenceAEncounter':{'id':3},'OccurrenceBEncounter':{'id':30}});
234
+ var row4 = new Row('OccurrenceAEncounter',{'OccurrenceAEncounter':{'id':1},'OccurrenceBEncounter':'*'});
235
+ var row5 = new Row('OccurrenceAEncounter',{'OccurrenceAEncounter':{'id':2},'OccurrenceBEncounter':'*'});
236
+ var row6 = new Row('OccurrenceAEncounter',{'OccurrenceAEncounter':{'id':3},'OccurrenceBEncounter':'*'});
234
237
 
235
- var specific = new hqmf.SpecificOccurrence([row1,row2,row3]);
238
+ var specific = new hqmf.SpecificOccurrence([row1,row2,row3,row4,row5,row6]);
236
239
  specific.addIdentityRow();
237
240
 
238
241
  var pop = new Boolean(true);
@@ -252,7 +255,9 @@ class SpecificsTest < Test::Unit::TestCase
252
255
  @context.eval('hqmf.SpecificsManager.validate(pop)').must_equal true
253
256
  @context.eval('hqmf.SpecificsManager.countUnique(["OccurrenceAEncounter"], pop)').must_equal 3
254
257
  @context.eval('hqmf.SpecificsManager.countUnique(["OccurrenceBEncounter"], pop)').must_equal 2
255
- @context.eval('hqmf.SpecificsManager.countUnique(["OccurrenceAEncounter", "OccurrenceBEncounter"], pop)').must_equal 5
258
+ # this should be 3 and not 5 because we are doing a multiple encounter episode check. The OccurrenceB rows should be dropped since
259
+ # we cannot have multiple values defined on a single row for a multi encounter episode check for unique.
260
+ @context.eval('hqmf.SpecificsManager.countUnique(["OccurrenceAEncounter", "OccurrenceBEncounter"], pop)').must_equal 3
256
261
  @context.eval('hqmf.SpecificsManager.countUnique(null, pop)').must_equal 1
257
262
  end
258
263
 
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hqmf2js
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
5
- prerelease:
4
+ version: 1.3.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Marc Hadley
@@ -11,120 +10,8 @@ authors:
11
10
  autorequire:
12
11
  bindir: bin
13
12
  cert_chain: []
14
- date: 2013-04-23 00:00:00.000000000 Z
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
17
- name: nokogiri
18
- requirement: !ruby/object:Gem::Requirement
19
- none: false
20
- requirements:
21
- - - ~>
22
- - !ruby/object:Gem::Version
23
- version: 1.5.5
24
- type: :runtime
25
- prerelease: false
26
- version_requirements: !ruby/object:Gem::Requirement
27
- none: false
28
- requirements:
29
- - - ~>
30
- - !ruby/object:Gem::Version
31
- version: 1.5.5
32
- - !ruby/object:Gem::Dependency
33
- name: tilt
34
- requirement: !ruby/object:Gem::Requirement
35
- none: false
36
- requirements:
37
- - - ~>
38
- - !ruby/object:Gem::Version
39
- version: 1.3.3
40
- type: :runtime
41
- prerelease: false
42
- version_requirements: !ruby/object:Gem::Requirement
43
- none: false
44
- requirements:
45
- - - ~>
46
- - !ruby/object:Gem::Version
47
- version: 1.3.3
48
- - !ruby/object:Gem::Dependency
49
- name: coffee-script
50
- requirement: !ruby/object:Gem::Requirement
51
- none: false
52
- requirements:
53
- - - ~>
54
- - !ruby/object:Gem::Version
55
- version: 2.2.0
56
- type: :runtime
57
- prerelease: false
58
- version_requirements: !ruby/object:Gem::Requirement
59
- none: false
60
- requirements:
61
- - - ~>
62
- - !ruby/object:Gem::Version
63
- version: 2.2.0
64
- - !ruby/object:Gem::Dependency
65
- name: sprockets
66
- requirement: !ruby/object:Gem::Requirement
67
- none: false
68
- requirements:
69
- - - ~>
70
- - !ruby/object:Gem::Version
71
- version: 2.2.2
72
- type: :runtime
73
- prerelease: false
74
- version_requirements: !ruby/object:Gem::Requirement
75
- none: false
76
- requirements:
77
- - - ~>
78
- - !ruby/object:Gem::Version
79
- version: 2.2.2
80
- - !ruby/object:Gem::Dependency
81
- name: awesome_print
82
- requirement: !ruby/object:Gem::Requirement
83
- none: false
84
- requirements:
85
- - - ~>
86
- - !ruby/object:Gem::Version
87
- version: 1.1.0
88
- type: :development
89
- prerelease: false
90
- version_requirements: !ruby/object:Gem::Requirement
91
- none: false
92
- requirements:
93
- - - ~>
94
- - !ruby/object:Gem::Version
95
- version: 1.1.0
96
- - !ruby/object:Gem::Dependency
97
- name: health-data-standards
98
- requirement: !ruby/object:Gem::Requirement
99
- none: false
100
- requirements:
101
- - - ~>
102
- - !ruby/object:Gem::Version
103
- version: 3.1.1
104
- type: :runtime
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- none: false
108
- requirements:
109
- - - ~>
110
- - !ruby/object:Gem::Version
111
- version: 3.1.1
112
- - !ruby/object:Gem::Dependency
113
- name: hquery-patient-api
114
- requirement: !ruby/object:Gem::Requirement
115
- none: false
116
- requirements:
117
- - - ~>
118
- - !ruby/object:Gem::Version
119
- version: 1.0.2
120
- type: :runtime
121
- prerelease: false
122
- version_requirements: !ruby/object:Gem::Requirement
123
- none: false
124
- requirements:
125
- - - ~>
126
- - !ruby/object:Gem::Version
127
- version: 1.0.2
13
+ date: 2014-03-25 00:00:00.000000000 Z
14
+ dependencies: []
128
15
  description: A library for converting HQMF files to executable JavaScript suitable
129
16
  for use with the hQuery Gateway
130
17
  email: hquery-talk@googlegroups.com
@@ -149,12 +36,14 @@ files:
149
36
  - bin/hqmf2js.rb
150
37
  - config/warble.rb
151
38
  - hqmf2js.gemspec
39
+ - lib/assets/javascripts/libraries/map_reduce_utils.js
152
40
  - lib/config/codes.xml
153
41
  - lib/generator/characteristic.js.erb
154
42
  - lib/generator/codes_to_json.rb
155
43
  - lib/generator/converter.rb
156
44
  - lib/generator/data_criteria.js.erb
157
45
  - lib/generator/derived_data.js.erb
46
+ - lib/generator/execution.rb
158
47
  - lib/generator/js.rb
159
48
  - lib/generator/measure_period.js.erb
160
49
  - lib/generator/observation_criteria.js.erb
@@ -166,8 +55,8 @@ files:
166
55
  - lib/tasks/codes.rake
167
56
  - lib/tasks/coffee.rake
168
57
  - lib/tasks/convert.rake
169
- - lib/tasks/cover_me.rake
170
58
  - test/fixtures/NQF59New.xml
59
+ - test/fixtures/codes/codes.json
171
60
  - test/fixtures/codes/codes.xls
172
61
  - test/fixtures/codes/codes.xml
173
62
  - test/fixtures/i2b2.xml
@@ -182,40 +71,46 @@ files:
182
71
  - test/fixtures/json/0043.json
183
72
  - test/fixtures/json/0043_hqmf1.json
184
73
  - test/fixtures/json/0043_hqmf2.json
74
+ - test/fixtures/json/0495.json
185
75
  - test/fixtures/json/59New.json
76
+ - test/fixtures/json/data_criteria/specific_occurrence.json
77
+ - test/fixtures/json/data_criteria/temporals_with_anynonnull.json
186
78
  - test/fixtures/patients/francis_drake.json
187
79
  - test/fixtures/patients/larry_vanderman.json
80
+ - test/simplecov.rb
188
81
  - test/test_helper.rb
82
+ - test/unit/cmd_test.rb
189
83
  - test/unit/codes_to_json_test.rb
190
84
  - test/unit/custom_calculations_test.rb
191
85
  - test/unit/effective_date_test.rb
86
+ - test/unit/erb_context_test.rb
192
87
  - test/unit/hqmf_from_json_javascript_test.rb
193
88
  - test/unit/hqmf_javascript_test.rb
89
+ - test/unit/js_object_test.rb
194
90
  - test/unit/library_function_test.rb
195
91
  - test/unit/specifics_test.rb
196
92
  homepage: http://github.com/hquery/hqmf2js
197
93
  licenses: []
94
+ metadata: {}
198
95
  post_install_message:
199
96
  rdoc_options: []
200
97
  require_paths:
201
98
  - lib
202
99
  required_ruby_version: !ruby/object:Gem::Requirement
203
- none: false
204
100
  requirements:
205
101
  - - ! '>='
206
102
  - !ruby/object:Gem::Version
207
103
  version: '0'
208
104
  required_rubygems_version: !ruby/object:Gem::Requirement
209
- none: false
210
105
  requirements:
211
106
  - - ! '>='
212
107
  - !ruby/object:Gem::Version
213
108
  version: '0'
214
109
  requirements: []
215
110
  rubyforge_project:
216
- rubygems_version: 1.8.24
111
+ rubygems_version: 2.2.2
217
112
  signing_key:
218
- specification_version: 3
113
+ specification_version: 4
219
114
  summary: A library for converting HQMF files to JavaScript
220
115
  test_files: []
221
116
  has_rdoc:
@@ -1,8 +0,0 @@
1
- namespace :cover_me do
2
-
3
- task :report do
4
- require 'cover_me'
5
- CoverMe.complete!
6
- end
7
-
8
- end