hqmf2js 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. data/.gitignore +10 -0
  2. data/.travis.yml +17 -0
  3. data/Gemfile +41 -0
  4. data/Gemfile.lock +202 -0
  5. data/README.md +7 -0
  6. data/Rakefile +22 -0
  7. data/VERSION +1 -0
  8. data/app/assets/javascripts/hqmf_util.js.coffee +776 -0
  9. data/app/assets/javascripts/logging_utils.js.coffee +150 -0
  10. data/app/assets/javascripts/patient_api_extension.js.coffee +36 -0
  11. data/app/assets/javascripts/specifics.js.coffee +462 -0
  12. data/bin/hqmf2js.rb +25 -0
  13. data/config/warble.rb +144 -0
  14. data/hqmf2js.gemspec +20 -0
  15. data/lib/config/codes.xml +1935 -0
  16. data/lib/generator/characteristic.js.erb +19 -0
  17. data/lib/generator/codes_to_json.rb +81 -0
  18. data/lib/generator/converter.rb +60 -0
  19. data/lib/generator/data_criteria.js.erb +47 -0
  20. data/lib/generator/derived_data.js.erb +5 -0
  21. data/lib/generator/js.rb +263 -0
  22. data/lib/generator/measure_period.js.erb +18 -0
  23. data/lib/generator/patient_data.js.erb +22 -0
  24. data/lib/generator/population_criteria.js.erb +4 -0
  25. data/lib/generator/precondition.js.erb +14 -0
  26. data/lib/hqmf2js.rb +20 -0
  27. data/lib/hquery/engine.rb +4 -0
  28. data/lib/tasks/codes.rake +12 -0
  29. data/lib/tasks/coffee.rake +15 -0
  30. data/lib/tasks/convert.rake +47 -0
  31. data/lib/tasks/cover_me.rake +8 -0
  32. data/test/fixtures/NQF59New.xml +1047 -0
  33. data/test/fixtures/codes/codes.xls +0 -0
  34. data/test/fixtures/codes/codes.xml +1941 -0
  35. data/test/fixtures/i2b2.xml +305 -0
  36. data/test/fixtures/invalid/missing_id.xml +18 -0
  37. data/test/fixtures/invalid/unknown_criteria_type.xml +16 -0
  38. data/test/fixtures/invalid/unknown_demographic_entry.xml +16 -0
  39. data/test/fixtures/invalid/unknown_population_type.xml +9 -0
  40. data/test/fixtures/invalid/unknown_value_type.xml +18 -0
  41. data/test/fixtures/js/59New.js +366 -0
  42. data/test/fixtures/js/test1.js +356 -0
  43. data/test/fixtures/js/test2.js +366 -0
  44. data/test/fixtures/json/0043.json +6 -0
  45. data/test/fixtures/json/0043_hqmf1.json +1 -0
  46. data/test/fixtures/json/0043_hqmf2.json +172 -0
  47. data/test/fixtures/json/59New.json +1352 -0
  48. data/test/fixtures/patient_api.js +2823 -0
  49. data/test/fixtures/patients/francis_drake.json +1180 -0
  50. data/test/fixtures/patients/larry_vanderman.json +645 -0
  51. data/test/test_helper.rb +58 -0
  52. data/test/unit/codes_to_json_test.rb +38 -0
  53. data/test/unit/effective_date_test.rb +48 -0
  54. data/test/unit/hqmf_from_json_javascript_test.rb +108 -0
  55. data/test/unit/hqmf_javascript_test.rb +175 -0
  56. data/test/unit/library_function_test.rb +553 -0
  57. data/test/unit/specifics_test.rb +757 -0
  58. metadata +183 -0
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ hqmf2js.jar
2
+ coverage
3
+ coverage.data
4
+ vendor
5
+ .bundle
6
+ tmp
7
+ log/*.log
8
+ */.DS_Store
9
+ .DS_Store
10
+
data/.travis.yml ADDED
@@ -0,0 +1,17 @@
1
+ language: ruby
2
+
3
+ rvm:
4
+ - 1.9.2
5
+
6
+ script: bundle exec rake
7
+
8
+ notifications:
9
+ email:
10
+ recipients:
11
+ - healthcare-ci@googlegroups.com
12
+ on_failure: change
13
+
14
+ branches:
15
+ only:
16
+ - master
17
+ - develop
data/Gemfile ADDED
@@ -0,0 +1,41 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem 'rails'
4
+
5
+ group :assets do
6
+ gem 'sass-rails'
7
+ gem 'coffee-rails'
8
+ gem 'uglifier'
9
+ end
10
+
11
+ #gem "hquery-patient-api", :git => 'http://github.com/pophealth/patientapi.git', :branch => 'develop'
12
+ #gem 'hquery-patient-api', :path => '../patientapi'
13
+ gem 'hquery-patient-api', '~> 0.3.0'
14
+ #gem 'hqmf-parser', :git => 'https://github.com/pophealth/hqmf-parser.git', :branch => 'develop'
15
+ #gem 'hqmf-parser', :path => '../hqmf-parser'
16
+ gem 'hqmf-parser', '~> 1.0.2'
17
+ #gem "health-data-standards", :git => 'http://github.com/projectcypress/health-data-standards.git', :branch => 'develop'
18
+ gem "health-data-standards", '~> 2.1.2'
19
+
20
+ gem 'nokogiri'
21
+ gem 'sprockets'
22
+ gem 'coffee-script'
23
+ gem 'uglifier'
24
+ gem 'tilt'
25
+ gem 'rake'
26
+ gem 'pry'
27
+
28
+ group :test do
29
+ gem 'minitest'
30
+ gem 'turn', :require => false
31
+ gem 'cover_me', '~> 1.2.0'
32
+ gem 'awesome_print', :require => 'ap'
33
+
34
+ platforms :ruby do
35
+ gem "therubyracer", :require => 'v8'
36
+ end
37
+
38
+ platforms :jruby do
39
+ gem "therubyrhino"
40
+ end
41
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,202 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ actionmailer (3.2.3)
5
+ actionpack (= 3.2.3)
6
+ mail (~> 2.4.4)
7
+ actionpack (3.2.3)
8
+ activemodel (= 3.2.3)
9
+ activesupport (= 3.2.3)
10
+ builder (~> 3.0.0)
11
+ erubis (~> 2.7.0)
12
+ journey (~> 1.0.1)
13
+ rack (~> 1.4.0)
14
+ rack-cache (~> 1.2)
15
+ rack-test (~> 0.6.1)
16
+ sprockets (~> 2.1.2)
17
+ activemodel (3.2.3)
18
+ activesupport (= 3.2.3)
19
+ builder (~> 3.0.0)
20
+ activerecord (3.2.3)
21
+ activemodel (= 3.2.3)
22
+ activesupport (= 3.2.3)
23
+ arel (~> 3.0.2)
24
+ tzinfo (~> 0.3.29)
25
+ activeresource (3.2.3)
26
+ activemodel (= 3.2.3)
27
+ activesupport (= 3.2.3)
28
+ activesupport (3.2.3)
29
+ i18n (~> 0.6)
30
+ multi_json (~> 1.0)
31
+ ansi (1.4.2)
32
+ arel (3.0.2)
33
+ awesome_print (1.0.2)
34
+ builder (3.0.3)
35
+ choice (0.1.6)
36
+ coderay (1.0.6)
37
+ coffee-rails (3.2.2)
38
+ coffee-script (>= 2.2.0)
39
+ railties (~> 3.2.0)
40
+ coffee-script (2.2.0)
41
+ coffee-script-source
42
+ execjs
43
+ coffee-script-source (1.3.1)
44
+ configatron (2.9.1)
45
+ yamler (>= 0.1.0)
46
+ cover_me (1.2.0)
47
+ configatron
48
+ hashie
49
+ erubis (2.7.0)
50
+ execjs (1.3.0)
51
+ multi_json (~> 1.0)
52
+ faraday (0.8.4)
53
+ multipart-post (~> 1.1)
54
+ google-spreadsheet-ruby (0.1.8)
55
+ nokogiri (>= 1.4.3.1)
56
+ oauth (>= 0.3.6)
57
+ oauth2 (>= 0.5.0)
58
+ hashie (1.2.0)
59
+ health-data-standards (2.1.2)
60
+ builder (~> 3.0.0)
61
+ erubis (~> 2.7.0)
62
+ mongoid (~> 3.0.6)
63
+ nokogiri (~> 1.5.5)
64
+ rest-client (~> 1.6.7)
65
+ uuid (~> 2.3.5)
66
+ hike (1.2.1)
67
+ hqmf-parser (1.0.2)
68
+ google-spreadsheet-ruby (= 0.1.8)
69
+ roo (= 1.10.1)
70
+ rubyzip
71
+ spreadsheet (= 0.6.8)
72
+ hquery-patient-api (0.3.0)
73
+ httpauth (0.2.0)
74
+ i18n (0.6.1)
75
+ journey (1.0.3)
76
+ json (1.7.3)
77
+ jwt (0.1.5)
78
+ multi_json (>= 1.0)
79
+ libv8 (3.3.10.4)
80
+ log4r (1.1.10)
81
+ macaddr (1.6.1)
82
+ systemu (~> 2.5.0)
83
+ mail (2.4.4)
84
+ i18n (>= 0.4.0)
85
+ mime-types (~> 1.16)
86
+ treetop (~> 1.4.8)
87
+ method_source (0.7.1)
88
+ mime-types (1.18)
89
+ minitest (2.12.1)
90
+ mongoid (3.0.10)
91
+ activemodel (~> 3.1)
92
+ moped (~> 1.1)
93
+ origin (~> 1.0)
94
+ tzinfo (~> 0.3.22)
95
+ moped (1.2.7)
96
+ multi_json (1.3.6)
97
+ multipart-post (1.1.5)
98
+ nokogiri (1.5.5)
99
+ oauth (0.4.7)
100
+ oauth2 (0.8.0)
101
+ faraday (~> 0.8)
102
+ httpauth (~> 0.1)
103
+ jwt (~> 0.1.4)
104
+ multi_json (~> 1.0)
105
+ rack (~> 1.2)
106
+ origin (1.0.10)
107
+ polyglot (0.3.3)
108
+ pry (0.9.9.3)
109
+ coderay (~> 1.0.5)
110
+ method_source (~> 0.7.1)
111
+ slop (>= 2.4.4, < 3)
112
+ rack (1.4.1)
113
+ rack-cache (1.2)
114
+ rack (>= 0.4)
115
+ rack-ssl (1.3.2)
116
+ rack
117
+ rack-test (0.6.1)
118
+ rack (>= 1.0)
119
+ rails (3.2.3)
120
+ actionmailer (= 3.2.3)
121
+ actionpack (= 3.2.3)
122
+ activerecord (= 3.2.3)
123
+ activeresource (= 3.2.3)
124
+ activesupport (= 3.2.3)
125
+ bundler (~> 1.0)
126
+ railties (= 3.2.3)
127
+ railties (3.2.3)
128
+ actionpack (= 3.2.3)
129
+ activesupport (= 3.2.3)
130
+ rack-ssl (~> 1.3.2)
131
+ rake (>= 0.8.7)
132
+ rdoc (~> 3.4)
133
+ thor (~> 0.14.6)
134
+ rake (0.9.2.2)
135
+ rdoc (3.12)
136
+ json (~> 1.4)
137
+ rest-client (1.6.7)
138
+ mime-types (>= 1.16)
139
+ roo (1.10.1)
140
+ choice (>= 0.1.4)
141
+ google-spreadsheet-ruby (>= 0.1.5)
142
+ nokogiri (>= 1.5.0)
143
+ rubyzip (>= 0.9.4)
144
+ spreadsheet (> 0.6.4)
145
+ todonotes (>= 0.1.0)
146
+ ruby-ole (1.2.11.4)
147
+ rubyzip (0.9.9)
148
+ sass (3.1.15)
149
+ sass-rails (3.2.5)
150
+ railties (~> 3.2.0)
151
+ sass (>= 3.1.10)
152
+ tilt (~> 1.3)
153
+ slop (2.4.4)
154
+ spreadsheet (0.6.8)
155
+ ruby-ole (>= 1.0)
156
+ sprockets (2.1.2)
157
+ hike (~> 1.2)
158
+ rack (~> 1.0)
159
+ tilt (~> 1.1, != 1.3.0)
160
+ systemu (2.5.2)
161
+ therubyracer (0.10.2)
162
+ libv8 (~> 3.3.10)
163
+ thor (0.14.6)
164
+ tilt (1.3.3)
165
+ todonotes (0.1.0)
166
+ log4r
167
+ treetop (1.4.10)
168
+ polyglot
169
+ polyglot (>= 0.3.1)
170
+ turn (0.9.5)
171
+ ansi
172
+ tzinfo (0.3.33)
173
+ uglifier (1.2.4)
174
+ execjs (>= 0.3.0)
175
+ multi_json (>= 1.0.2)
176
+ uuid (2.3.5)
177
+ macaddr (~> 1.0)
178
+ yamler (0.1.0)
179
+
180
+ PLATFORMS
181
+ ruby
182
+
183
+ DEPENDENCIES
184
+ awesome_print
185
+ coffee-rails
186
+ coffee-script
187
+ cover_me (~> 1.2.0)
188
+ health-data-standards (~> 2.1.2)
189
+ hqmf-parser (~> 1.0.2)
190
+ hquery-patient-api (~> 0.3.0)
191
+ minitest
192
+ nokogiri
193
+ pry
194
+ rails
195
+ rake
196
+ sass-rails
197
+ sprockets
198
+ therubyracer
199
+ therubyrhino
200
+ tilt
201
+ turn
202
+ uglifier
data/README.md ADDED
@@ -0,0 +1,7 @@
1
+ This project is a library that will convert a declarative HQMF measure description into executable JavaScript suitable for use within the hQuery Gateway.
2
+
3
+
4
+ Project Practices
5
+ =================
6
+
7
+ Please try to follow our [Coding Style Guides](http://github.com/eedrummer/styleguide). Additionally, we will be using git in a pattern similar to [Vincent Driessen's workflow](http://nvie.com/posts/a-successful-git-branching-model/). While feature branches are encouraged, they are not required to work on the project.
data/Rakefile ADDED
@@ -0,0 +1,22 @@
1
+ require 'rake'
2
+ require 'rake/testtask'
3
+ require 'sprockets'
4
+ require 'tilt'
5
+ require 'fileutils'
6
+
7
+ require_relative 'lib/hqmf2js'
8
+
9
+ # Pull in any rake task defined in lib/tasks
10
+ Dir['lib/tasks/*.rake'].sort.each do |ext|
11
+ load ext
12
+ end
13
+
14
+ $LOAD_PATH << File.expand_path("../test",__FILE__)
15
+ desc "Run basic tests"
16
+ Rake::TestTask.new("test_units") { |t|
17
+ t.pattern = 'test/unit/*_test.rb'
18
+ t.verbose = true
19
+ t.warning = false
20
+ }
21
+
22
+ task :default => [:test_units,'cover_me:report']
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0