quality-measure-engine 3.0.0.beta.2 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -7
- data/lib/qme/quality_measure.rb +2 -1
- data/lib/qme/quality_report.rb +37 -28
- data/lib/qme/version.rb +1 -1
- data/lib/quality-measure-engine.rb +0 -1
- data/quality-measure-engine.gemspec +0 -2
- data/test/unit/qme/map/map_reduce_executor_test.rb +12 -0
- data/test/unit/qme/quality_measure_test.rb +1 -1
- metadata +5 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2af206454a8b465c2207f525604a84827d18e6d1
|
4
|
+
data.tar.gz: fc9aad778f5014c59771570e77b60332f1dc8eaf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c33fd660df2f2de767c24324826642a9d4f51c52035b847191e0b7250791a4d7618e0443c9e6a0aa35c5ca6cbb5bf1c1272a481375f019d2fa6f97efcd7a0bea
|
7
|
+
data.tar.gz: d9794593aca2991df48f09266443724c29c80cfeef51f1486269f599a93e637a3f734741146341e490c6ada740202c01d9019f29be883484233fc357e016d2ce
|
data/Gemfile.lock
CHANGED
@@ -1,12 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
quality-measure-engine (3.0.0
|
4
|
+
quality-measure-engine (3.0.0)
|
5
5
|
delayed_job_mongoid (~> 2.0.0)
|
6
6
|
mongoid (~> 3.1.4)
|
7
7
|
moped (~> 1.5.1)
|
8
|
-
nokogiri (~> 1.6.0)
|
9
|
-
rubyXL (~> 1.2.10)
|
10
8
|
rubyzip (~> 0.9.9)
|
11
9
|
|
12
10
|
GEM
|
@@ -62,7 +60,6 @@ GEM
|
|
62
60
|
treetop (~> 1.4.8)
|
63
61
|
method_source (0.8.2)
|
64
62
|
mime-types (1.24)
|
65
|
-
mini_portile (0.5.2)
|
66
63
|
minitest (4.7.5)
|
67
64
|
mongoid (3.1.6)
|
68
65
|
activemodel (~> 3.2)
|
@@ -71,8 +68,6 @@ GEM
|
|
71
68
|
tzinfo (~> 0.3.29)
|
72
69
|
moped (1.5.2)
|
73
70
|
multi_json (1.8.2)
|
74
|
-
nokogiri (1.6.0)
|
75
|
-
mini_portile (~> 0.5.0)
|
76
71
|
origin (1.1.0)
|
77
72
|
polyglot (0.3.3)
|
78
73
|
pry (0.9.12.2)
|
@@ -112,7 +107,6 @@ GEM
|
|
112
107
|
rake (10.1.0)
|
113
108
|
rdoc (3.12.2)
|
114
109
|
json (~> 1.4)
|
115
|
-
rubyXL (1.2.10)
|
116
110
|
rubyzip (0.9.9)
|
117
111
|
simplecov (0.7.1)
|
118
112
|
multi_json (~> 1.0)
|
data/lib/qme/quality_measure.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module QME
|
2
2
|
class QualityMeasure
|
3
|
-
|
3
|
+
|
4
4
|
include Mongoid::Document
|
5
5
|
store_in collection: 'measures'
|
6
6
|
|
@@ -13,5 +13,6 @@ module QME
|
|
13
13
|
field :map_fn, type: String
|
14
14
|
field :population_ids, type: Hash
|
15
15
|
field :parameters, type: Hash, default: {}
|
16
|
+
|
16
17
|
end
|
17
18
|
end
|
data/lib/qme/quality_report.rb
CHANGED
@@ -153,36 +153,45 @@ module QME
|
|
153
153
|
end
|
154
154
|
|
155
155
|
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
156
|
+
def patient_cache_matcher
|
157
|
+
match = {'value.measure_id' => self.measure_id,
|
158
|
+
'value.sub_id' => self.sub_id,
|
159
|
+
'value.effective_date' => self.effective_date,
|
160
|
+
'value.test_id' => test_id,
|
161
|
+
'value.manual_exclusion' => {'$in' => [nil, false]}}
|
162
|
+
|
163
|
+
if(filters)
|
164
|
+
if (filters['races'] && filters['races'].size > 0)
|
165
|
+
match['value.race.code'] = {'$in' => filters['races']}
|
166
|
+
end
|
167
|
+
if (filters['ethnicities'] && filters['ethnicities'].size > 0)
|
168
|
+
match['value.ethnicity.code'] = {'$in' => filters['ethnicities']}
|
169
|
+
end
|
170
|
+
if (filters['genders'] && filters['genders'].size > 0)
|
171
|
+
match['value.gender'] = {'$in' => filters['genders']}
|
172
|
+
end
|
173
|
+
if (filters['providers'] && filters['providers'].size > 0)
|
174
|
+
providers = filters['providers'].map { |pv| Moped::BSON::ObjectId(pv) }
|
175
|
+
match['value.provider_performances.provider_id'] = {'$in' => providers}
|
176
|
+
end
|
177
|
+
if (filters['languages'] && filters['languages'].size > 0)
|
178
|
+
match["value.languages"] = {'$in' => filters['languages']}
|
179
|
+
end
|
179
180
|
end
|
181
|
+
match
|
180
182
|
end
|
181
|
-
match
|
182
|
-
end
|
183
|
-
|
184
183
|
|
184
|
+
protected
|
185
|
+
|
186
|
+
#In the older version of QME QualityReport was not treated as apersisted object. As
|
187
|
+
# a result anytime you wanted to get the cached results for a calculation you would create
|
188
|
+
# a new QR object which would then go to the db and see if the calculation was performed or
|
189
|
+
# not yet and then return the results. now that QR objects are persisted you need to go through
|
190
|
+
# the find_or_create by method to ensure that duplicate entries are not being created. Protecting
|
191
|
+
# this method causes an exception to be thrown for anyone attempting to use this version of QME with the
|
192
|
+
# sematics of the older version to highlight the issue
|
193
|
+
def initialize(attrs = nil, options = nil)
|
194
|
+
super(attrs, options)
|
195
|
+
end
|
185
196
|
end
|
186
|
-
|
187
|
-
|
188
197
|
end
|
data/lib/qme/version.rb
CHANGED
@@ -21,8 +21,6 @@ Gem::Specification.new do |gem|
|
|
21
21
|
gem.add_dependency 'mongoid', '~> 3.1.4'
|
22
22
|
gem.add_dependency 'rubyzip', '~> 0.9.9'
|
23
23
|
gem.add_dependency 'delayed_job_mongoid', '~> 2.0.0'
|
24
|
-
gem.add_dependency 'nokogiri', '~> 1.6.0'
|
25
|
-
gem.add_dependency 'rubyXL', '~> 1.2.10'
|
26
24
|
|
27
25
|
gem.add_development_dependency "minitest", "~> 4.1.0"
|
28
26
|
gem.add_development_dependency "simplecov", "~> 0.7.1"
|
@@ -97,4 +97,16 @@ class MapReduceExecutorTest < MiniTest::Unit::TestCase
|
|
97
97
|
assert_equal 0, QME::PatientCache.count
|
98
98
|
assert result[QME::QualityReport::NUMERATOR]
|
99
99
|
end
|
100
|
+
|
101
|
+
def test_get_patient_result_with_bundle_id
|
102
|
+
measure_id = "2E679CD2-3FEC-4A75-A75A-61403E5EFEE8"
|
103
|
+
bundle_id = get_db()['bundles'].find.first
|
104
|
+
get_db()['measures'].find('id' => measure_id).update(:$set => {'bundle_id' => bundle_id})
|
105
|
+
executor = QME::MapReduce::Executor.new(measure_id, nil,
|
106
|
+
'effective_date' => Time.gm(2011, 1, 15).to_i, 'bundle_id' => bundle_id)
|
107
|
+
result = executor.get_patient_result("12345")
|
108
|
+
assert_equal 0, get_db['patient_cache'].find().count
|
109
|
+
assert result[QME::QualityReport::NUMERATOR]
|
110
|
+
end
|
111
|
+
|
100
112
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quality-measure-engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.0
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marc Hadley
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2014-
|
15
|
+
date: 2014-03-25 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: moped
|
@@ -70,34 +70,6 @@ dependencies:
|
|
70
70
|
- - "~>"
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: 2.0.0
|
73
|
-
- !ruby/object:Gem::Dependency
|
74
|
-
name: nokogiri
|
75
|
-
requirement: !ruby/object:Gem::Requirement
|
76
|
-
requirements:
|
77
|
-
- - "~>"
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
version: 1.6.0
|
80
|
-
type: :runtime
|
81
|
-
prerelease: false
|
82
|
-
version_requirements: !ruby/object:Gem::Requirement
|
83
|
-
requirements:
|
84
|
-
- - "~>"
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
version: 1.6.0
|
87
|
-
- !ruby/object:Gem::Dependency
|
88
|
-
name: rubyXL
|
89
|
-
requirement: !ruby/object:Gem::Requirement
|
90
|
-
requirements:
|
91
|
-
- - "~>"
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
version: 1.2.10
|
94
|
-
type: :runtime
|
95
|
-
prerelease: false
|
96
|
-
version_requirements: !ruby/object:Gem::Requirement
|
97
|
-
requirements:
|
98
|
-
- - "~>"
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
version: 1.2.10
|
101
73
|
- !ruby/object:Gem::Dependency
|
102
74
|
name: minitest
|
103
75
|
requirement: !ruby/object:Gem::Requirement
|
@@ -207,12 +179,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
207
179
|
version: '0'
|
208
180
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
209
181
|
requirements:
|
210
|
-
- - "
|
182
|
+
- - ">="
|
211
183
|
- !ruby/object:Gem::Version
|
212
|
-
version:
|
184
|
+
version: '0'
|
213
185
|
requirements: []
|
214
186
|
rubyforge_project:
|
215
|
-
rubygems_version: 2.
|
187
|
+
rubygems_version: 2.0.14
|
216
188
|
signing_key:
|
217
189
|
specification_version: 4
|
218
190
|
summary: This library can run JavaScript based clinical quality measures on a repository
|