hqmf2js 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 +5 -13
- data/.travis.yml +1 -1
- data/Gemfile +1 -25
- data/Gemfile.lock +170 -146
- data/app/assets/javascripts/crosswalk.js.coffee +17 -19
- data/app/assets/javascripts/custom_calculations.js.coffee +44 -17
- data/app/assets/javascripts/hqmf_util.js.coffee +559 -161
- data/app/assets/javascripts/logging_utils.js.coffee +6 -4
- data/app/assets/javascripts/patient_api_extension.js.coffee +41 -9
- data/app/assets/javascripts/specifics.js.coffee +163 -69
- data/hqmf2js.gemspec +7 -12
- data/lib/assets/javascripts/libraries/map_reduce_utils.js +151 -64
- data/lib/generator/characteristic.js.erb +23 -12
- data/lib/generator/codes_to_json.rb +1 -1
- data/lib/generator/data_criteria.js.erb +15 -3
- data/lib/generator/derived_data.js.erb +5 -0
- data/lib/generator/execution.rb +41 -11
- data/lib/generator/js.rb +74 -41
- data/lib/generator/patient_data.js.erb +1 -1
- data/lib/hqmf2js.rb +0 -1
- data/lib/hquery/engine.rb +3 -1
- data/lib/tasks/convert.rake +20 -12
- data/test/fixtures/NQF59New.json +1423 -0
- data/test/fixtures/fulfills.xml +917 -0
- data/test/fixtures/patients/larry_vanderman.json +573 -654
- data/test/{simplecov.rb → simplecov_init.rb} +0 -0
- data/test/test_helper.rb +2 -3
- data/test/unit/cmd_test.rb +145 -19
- data/test/unit/codes_to_json_test.rb +12 -12
- data/test/unit/custom_calculations_test.rb +2 -6
- data/test/unit/effective_date_test.rb +3 -4
- data/test/unit/erb_context_test.rb +12 -12
- data/test/unit/filter_by_reference_test.rb +39 -0
- data/test/unit/hqmf_from_json_javascript_test.rb +2 -1
- data/test/unit/hqmf_javascript_test.rb +12 -13
- data/test/unit/js_object_test.rb +2 -2
- data/test/unit/library_function_test.rb +210 -42
- data/test/unit/specifics_test.rb +402 -321
- metadata +57 -15
- data/config/warble.rb +0 -144
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
ZGRlMTYwNmRmODBlZjNkNmQwY2E1Yjg4NmY2YmMwZjIxMjNmYjNkZA==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 6b37462ee793775f39e1c4f8643e1c42742975a0
|
4
|
+
data.tar.gz: e5ddf36cee338dca7c37b5a58c1a9a72f91e97d6
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
NDkwZjhhMjMyMGZkZWNjYzk1ZDI0OWFlYjdiYzFmMzU5YmU2MTM3YWMxMGQ5
|
11
|
-
ZDcyMmZiNTdlMTdmMGZhZWVjYmI0YWFiNmUwNzM2MzhlYzcyNjY=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
YTg5ZDhiZjZlOTYxNzY5ZTlkNjI3NDI2NGQzM2M4YzVkZDEwMTAxZDJmYjQ5
|
14
|
-
ZjJkNWFkZmY3N2UyZDZhYWI1NWY5ZjJkOWU2OGMzZjA4NjhjOTM5ZGM3MjRj
|
15
|
-
MDYzODYwMDAyODU2ZWNhMjhmMWIzMDJjNDAxN2ZmNzNkZjcxZDQ=
|
6
|
+
metadata.gz: acc7bb75ffe1f3462232e19540a0dfadc41d837abf631d060b09f625f8cadfe11e22f29824084092b3162fd43fac76d2e0c702c42a1f07df2e384306b36d8a74
|
7
|
+
data.tar.gz: 94b2caf1516a4aa58d1b21ac561229d064bd4cdf87e90b4afb83b364dce10fcaa3bcf0806078e1212fb0eaf0a5393eda63874ac4d6551f0b9bdefae0c60ccea5
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -1,23 +1,7 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
|
+
gemspec
|
2
3
|
|
3
|
-
gem 'rails', '3.2.14'
|
4
|
-
|
5
|
-
group :assets do
|
6
|
-
gem 'sass-rails'
|
7
|
-
gem 'coffee-rails'
|
8
|
-
gem 'uglifier'
|
9
|
-
end
|
10
|
-
|
11
|
-
gem 'hquery-patient-api', '1.0.4'
|
12
|
-
gem 'health-data-standards', :git => 'https://github.com/projectcypress/health-data-standards.git', :branch => 'master'
|
13
|
-
|
14
|
-
gem 'nokogiri'
|
15
|
-
gem 'sprockets'
|
16
|
-
gem 'coffee-script'
|
17
|
-
gem 'uglifier'
|
18
|
-
gem 'tilt'
|
19
4
|
gem 'rake'
|
20
|
-
gem 'pry'
|
21
5
|
|
22
6
|
group :test do
|
23
7
|
gem 'simplecov', :require => false
|
@@ -25,12 +9,4 @@ group :test do
|
|
25
9
|
gem 'minitest'
|
26
10
|
gem 'turn', :require => false
|
27
11
|
gem 'awesome_print', :require => 'ap'
|
28
|
-
|
29
|
-
platforms :ruby do
|
30
|
-
gem "therubyracer", :require => 'v8'
|
31
|
-
end
|
32
|
-
|
33
|
-
platforms :jruby do
|
34
|
-
gem "therubyrhino"
|
35
|
-
end
|
36
12
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,179 +1,203 @@
|
|
1
|
-
|
2
|
-
remote:
|
3
|
-
revision: 7a5673f90ab59b1350e22a71aefc1de5b569d98b
|
4
|
-
branch: master
|
1
|
+
PATH
|
2
|
+
remote: .
|
5
3
|
specs:
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
log4r (~> 1.1.10)
|
11
|
-
memoist (~> 0.9.1)
|
12
|
-
mongoid (~> 3.1.4)
|
13
|
-
mongoid-tree (~> 1.0.4)
|
14
|
-
nokogiri (= 1.6.0)
|
15
|
-
rest-client (~> 1.6.7)
|
16
|
-
rubyzip (= 0.9.9)
|
17
|
-
uuid (~> 2.3.7)
|
4
|
+
hqmf2js (1.4.0)
|
5
|
+
health-data-standards (~> 4.0)
|
6
|
+
hquery-patient-api (~> 1.1)
|
7
|
+
rails (~> 4.2)
|
18
8
|
|
19
9
|
GEM
|
20
10
|
remote: http://rubygems.org/
|
21
11
|
specs:
|
22
|
-
actionmailer (
|
23
|
-
actionpack (=
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
12
|
+
actionmailer (4.2.10)
|
13
|
+
actionpack (= 4.2.10)
|
14
|
+
actionview (= 4.2.10)
|
15
|
+
activejob (= 4.2.10)
|
16
|
+
mail (~> 2.5, >= 2.5.4)
|
17
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
18
|
+
actionpack (4.2.10)
|
19
|
+
actionview (= 4.2.10)
|
20
|
+
activesupport (= 4.2.10)
|
21
|
+
rack (~> 1.6)
|
22
|
+
rack-test (~> 0.6.2)
|
23
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
24
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
25
|
+
actionview (4.2.10)
|
26
|
+
activesupport (= 4.2.10)
|
27
|
+
builder (~> 3.1)
|
29
28
|
erubis (~> 2.7.0)
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
activemodel (
|
36
|
-
activesupport (=
|
37
|
-
builder (~> 3.
|
38
|
-
activerecord (
|
39
|
-
activemodel (=
|
40
|
-
activesupport (=
|
41
|
-
arel (~>
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
coderay (1.0.8)
|
54
|
-
coffee-rails (3.2.2)
|
55
|
-
coffee-script (>= 2.2.0)
|
56
|
-
railties (~> 3.2.0)
|
57
|
-
coffee-script (2.2.0)
|
29
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
30
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
31
|
+
activejob (4.2.10)
|
32
|
+
activesupport (= 4.2.10)
|
33
|
+
globalid (>= 0.3.0)
|
34
|
+
activemodel (4.2.10)
|
35
|
+
activesupport (= 4.2.10)
|
36
|
+
builder (~> 3.1)
|
37
|
+
activerecord (4.2.10)
|
38
|
+
activemodel (= 4.2.10)
|
39
|
+
activesupport (= 4.2.10)
|
40
|
+
arel (~> 6.0)
|
41
|
+
activesupport (4.2.10)
|
42
|
+
i18n (~> 0.7)
|
43
|
+
minitest (~> 5.1)
|
44
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
45
|
+
tzinfo (~> 1.1)
|
46
|
+
ansi (1.5.0)
|
47
|
+
arel (6.0.4)
|
48
|
+
awesome_print (1.8.0)
|
49
|
+
bson (4.2.2)
|
50
|
+
builder (3.2.3)
|
51
|
+
coffee-script (2.4.1)
|
58
52
|
coffee-script-source
|
59
53
|
execjs
|
60
|
-
coffee-script-source (1.
|
54
|
+
coffee-script-source (1.12.2)
|
55
|
+
concurrent-ruby (1.0.5)
|
56
|
+
crass (1.0.2)
|
57
|
+
docile (1.1.5)
|
58
|
+
domain_name (0.5.20170404)
|
59
|
+
unf (>= 0.0.5, < 1.0.0)
|
61
60
|
erubis (2.7.0)
|
62
|
-
execjs (
|
63
|
-
|
61
|
+
execjs (2.7.0)
|
62
|
+
globalid (0.4.1)
|
63
|
+
activesupport (>= 4.2.0)
|
64
|
+
health-data-standards (4.0.0)
|
65
|
+
activesupport (~> 4.2.0)
|
66
|
+
builder (~> 3.1)
|
67
|
+
erubis (~> 2.7.0)
|
68
|
+
highline (~> 1.7.0)
|
69
|
+
log4r (~> 1.1.10)
|
70
|
+
memoist (~> 0.9.1)
|
71
|
+
mongoid (~> 5.0.0)
|
72
|
+
mongoid-tree (~> 2.0.0)
|
73
|
+
nokogiri (~> 1.8.1)
|
74
|
+
protected_attributes (~> 1.0.5)
|
75
|
+
rest-client (~> 1.8.0)
|
76
|
+
rubyzip (~> 1.2.1)
|
77
|
+
uuid (~> 2.3.7)
|
78
|
+
zip-zip (~> 0.3)
|
79
|
+
highline (1.7.8)
|
64
80
|
hike (1.2.3)
|
65
|
-
hquery-patient-api (1.
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
81
|
+
hquery-patient-api (1.1.1)
|
82
|
+
coffee-script (~> 2.4)
|
83
|
+
libv8 (~> 3.16.14)
|
84
|
+
sprockets (~> 2.2)
|
85
|
+
therubyracer (~> 0.12)
|
86
|
+
tilt (~> 1.4)
|
87
|
+
uglifier (~> 2.7)
|
88
|
+
http-cookie (1.0.3)
|
89
|
+
domain_name (~> 0.5)
|
90
|
+
i18n (0.9.1)
|
91
|
+
concurrent-ruby (~> 1.0)
|
92
|
+
json (2.1.0)
|
93
|
+
libv8 (3.16.14.19)
|
70
94
|
log4r (1.1.10)
|
71
|
-
|
95
|
+
loofah (2.1.1)
|
96
|
+
crass (~> 1.0.2)
|
97
|
+
nokogiri (>= 1.5.9)
|
98
|
+
macaddr (1.7.1)
|
72
99
|
systemu (~> 2.6.2)
|
73
|
-
mail (2.
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
multi_json (1.
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
rack (1.4.5)
|
99
|
-
rack-cache (1.2)
|
100
|
-
rack (>= 0.4)
|
101
|
-
rack-ssl (1.3.4)
|
102
|
-
rack
|
103
|
-
rack-test (0.6.2)
|
100
|
+
mail (2.7.0)
|
101
|
+
mini_mime (>= 0.1.1)
|
102
|
+
memoist (0.9.3)
|
103
|
+
mime-types (2.99.3)
|
104
|
+
mini_mime (1.0.0)
|
105
|
+
mini_portile2 (2.3.0)
|
106
|
+
minitest (5.10.3)
|
107
|
+
mongo (2.4.3)
|
108
|
+
bson (>= 4.2.1, < 5.0.0)
|
109
|
+
mongoid (5.0.2)
|
110
|
+
activemodel (~> 4.0)
|
111
|
+
mongo (~> 2.1)
|
112
|
+
origin (~> 2.1)
|
113
|
+
tzinfo (>= 0.3.37)
|
114
|
+
mongoid-tree (2.0.1)
|
115
|
+
mongoid (>= 4.0, < 6.0)
|
116
|
+
multi_json (1.12.2)
|
117
|
+
netrc (0.11.0)
|
118
|
+
nokogiri (1.8.1)
|
119
|
+
mini_portile2 (~> 2.3.0)
|
120
|
+
origin (2.3.1)
|
121
|
+
protected_attributes (1.0.9)
|
122
|
+
activemodel (>= 4.0.1, < 5.0)
|
123
|
+
rack (1.6.8)
|
124
|
+
rack-test (0.6.3)
|
104
125
|
rack (>= 1.0)
|
105
|
-
rails (
|
106
|
-
actionmailer (=
|
107
|
-
actionpack (=
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
126
|
+
rails (4.2.10)
|
127
|
+
actionmailer (= 4.2.10)
|
128
|
+
actionpack (= 4.2.10)
|
129
|
+
actionview (= 4.2.10)
|
130
|
+
activejob (= 4.2.10)
|
131
|
+
activemodel (= 4.2.10)
|
132
|
+
activerecord (= 4.2.10)
|
133
|
+
activesupport (= 4.2.10)
|
134
|
+
bundler (>= 1.3.0, < 2.0)
|
135
|
+
railties (= 4.2.10)
|
136
|
+
sprockets-rails
|
137
|
+
rails-deprecated_sanitizer (1.0.3)
|
138
|
+
activesupport (>= 4.2.0.alpha)
|
139
|
+
rails-dom-testing (1.0.8)
|
140
|
+
activesupport (>= 4.2.0.beta, < 5.0)
|
141
|
+
nokogiri (~> 1.6)
|
142
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
143
|
+
rails-html-sanitizer (1.0.3)
|
144
|
+
loofah (~> 2.0)
|
145
|
+
railties (4.2.10)
|
146
|
+
actionpack (= 4.2.10)
|
147
|
+
activesupport (= 4.2.10)
|
117
148
|
rake (>= 0.8.7)
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
rubyzip (
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
multi_json (~> 1.0)
|
133
|
-
simplecov-html (~> 0.7.1)
|
134
|
-
simplecov-html (0.7.1)
|
135
|
-
slop (3.3.3)
|
136
|
-
sprockets (2.2.2)
|
149
|
+
thor (>= 0.18.1, < 2.0)
|
150
|
+
rake (12.2.1)
|
151
|
+
ref (2.0.0)
|
152
|
+
rest-client (1.8.0)
|
153
|
+
http-cookie (>= 1.0.2, < 2.0)
|
154
|
+
mime-types (>= 1.16, < 3.0)
|
155
|
+
netrc (~> 0.7)
|
156
|
+
rubyzip (1.2.1)
|
157
|
+
simplecov (0.15.1)
|
158
|
+
docile (~> 1.1.0)
|
159
|
+
json (>= 1.8, < 3)
|
160
|
+
simplecov-html (~> 0.10.0)
|
161
|
+
simplecov-html (0.10.2)
|
162
|
+
sprockets (2.12.4)
|
137
163
|
hike (~> 1.2)
|
138
164
|
multi_json (~> 1.0)
|
139
165
|
rack (~> 1.0)
|
140
166
|
tilt (~> 1.1, != 1.3.0)
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
167
|
+
sprockets-rails (0.0.1)
|
168
|
+
sprockets (>= 1.0.2)
|
169
|
+
systemu (2.6.5)
|
170
|
+
therubyracer (0.12.3)
|
171
|
+
libv8 (~> 3.16.14.15)
|
172
|
+
ref
|
173
|
+
thor (0.20.0)
|
174
|
+
thread_safe (0.3.6)
|
145
175
|
tilt (1.4.1)
|
146
|
-
treetop (1.4.15)
|
147
|
-
polyglot
|
148
|
-
polyglot (>= 0.3.1)
|
149
176
|
turn (0.9.6)
|
150
177
|
ansi
|
151
|
-
tzinfo (
|
152
|
-
|
178
|
+
tzinfo (1.2.4)
|
179
|
+
thread_safe (~> 0.1)
|
180
|
+
uglifier (2.7.2)
|
153
181
|
execjs (>= 0.3.0)
|
154
|
-
|
155
|
-
|
182
|
+
json (>= 1.8.0)
|
183
|
+
unf (0.1.4)
|
184
|
+
unf_ext
|
185
|
+
unf_ext (0.0.7.4)
|
186
|
+
uuid (2.3.8)
|
156
187
|
macaddr (~> 1.0)
|
188
|
+
zip-zip (0.3)
|
189
|
+
rubyzip (>= 1.0.0)
|
157
190
|
|
158
191
|
PLATFORMS
|
159
192
|
ruby
|
160
193
|
|
161
194
|
DEPENDENCIES
|
162
195
|
awesome_print
|
163
|
-
|
164
|
-
coffee-script
|
165
|
-
health-data-standards!
|
166
|
-
hquery-patient-api (= 1.0.4)
|
196
|
+
hqmf2js!
|
167
197
|
minitest
|
168
|
-
nokogiri
|
169
|
-
pry
|
170
|
-
rails (= 3.2.14)
|
171
198
|
rake
|
172
|
-
sass-rails
|
173
199
|
simplecov
|
174
|
-
sprockets
|
175
|
-
therubyracer
|
176
|
-
therubyrhino
|
177
|
-
tilt
|
178
200
|
turn
|
179
|
-
|
201
|
+
|
202
|
+
BUNDLED WITH
|
203
|
+
1.15.4
|
@@ -47,26 +47,24 @@ hQuery.CodedEntry::includesCodeFrom = (codeSet) ->
|
|
47
47
|
oneTrue
|
48
48
|
|
49
49
|
instrumentTrueCrosswalk = (hqmfjs) ->
|
50
|
-
#
|
51
|
-
|
52
|
-
|
50
|
+
# Wrap all of the data criteria functions generated from HQMF
|
51
|
+
_.each(_.functions(hqmfjs), (method) ->
|
52
|
+
if method != 'initializeSpecifics'
|
53
|
+
hqmfjs[method] = _.wrap(hqmfjs[method], (func) ->
|
53
54
|
|
54
|
-
|
55
|
+
args = Array.prototype.slice.call(arguments,1)
|
55
56
|
|
56
|
-
|
57
|
-
# tmp_results = results
|
58
|
-
# tmp_results = [results] unless _.isArray(tmp_results)
|
57
|
+
isDataCriteria = method.match(/precondition_[0-9]+/)
|
59
58
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
# )
|
59
|
+
if isDataCriteria
|
60
|
+
tmpCrosswalk = $.extend(true, {}, CrosswalkManager.matchedSystems)
|
61
|
+
|
62
|
+
result = func.apply(this, args)
|
63
|
+
|
64
|
+
if isDataCriteria && result.isFalse()
|
65
|
+
CrosswalkManager.matchedSystems = tmpCrosswalk
|
66
|
+
|
67
|
+
return result;
|
68
|
+
);
|
69
|
+
);
|
72
70
|
@instrumentTrueCrosswalk = instrumentTrueCrosswalk
|