Skip to content

Commit

Permalink
updated populations to align with HQMF and QRDA
Browse files Browse the repository at this point in the history
  • Loading branch information
andrequina committed Dec 5, 2012
1 parent 51001a6 commit a31df93
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ gem 'health-data-standards', :git => 'https://github.com/projectcypress/health-d
#gem 'health-data-standards', :path => '../health-data-standards'
gem 'test-patient-generator', :git => 'https://github.com/pophealth/test-patient-generator.git', :branch => 'develop'
#gem 'test-patient-generator', :path => '../test-patient-generator'
gem 'quality-measure-engine', :git => 'http://github.com/pophealth/quality-measure-engine.git', :branch => 'develop'
gem 'quality-measure-engine', :git => 'http://github.com/pophealth/quality-measure-engine.git', :branch => 'population_match'
#gem 'quality-measure-engine', :path => '../quality-measure-engine'
#gem 'quality-measure-engine', '2.0.0'
gem 'qrda_generator', :git => 'http://github.com/eedrummer/qrda_generator.git'
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ GIT

GIT
remote: http://github.com/pophealth/quality-measure-engine.git
revision: 6c4b935063c89d8a31d1d9f12a0ed3b83cc0728d
branch: develop
revision: a1974aaa0c4cc527771aefb60a212815c0704000
branch: population_match
specs:
quality-measure-engine (2.1.0)
delayed_job_mongoid (~> 2.0.0)
Expand Down
10 changes: 5 additions & 5 deletions app/assets/javascripts/debug.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -101,31 +101,31 @@ populate_test_table = () ->

# TODO: this is not DRY
# colorize and checkmark table cells based on results
if e.population
if e.IPP
population_total += 1
cell = $(row).children(":nth-child(2)")
cell.css('background-color', '#EEE') #light gray
cell.html('✓')

if e.denominator
if e.DENOM
denominator_total += 1
cell = $(row).children(":nth-child(3)")
cell.css('background-color', '#99CCFF') #light blue
cell.html('✓')

if e.numerator
if e.NUMER
numerator_total += 1
cell = $(row).children(":nth-child(4)")
cell.css('background-color', '#CCFFCC') #light green
cell.html('✓')

if e.exclusions
if e.DENEX
exclusions_total += 1
cell = $(row).children(":nth-child(5)")
cell.css('background-color', '#FFCC99') #light orange
cell.html('✓')

if e.denexcep == true
if e.DENEXCEP
exceptions_total++
cell = $(row).children(":nth-child(6)")
cell.css('background-color', '#EEE')
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/measures_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ def generate_matrix

def matrix_data
select = {}
['population', 'denominator', 'numerator', 'denexcep', 'exclusions', 'first', 'last', 'gender', 'measure_id', 'birthdate', 'patient_id', 'sub_id', 'nqf_id'].each {|k| select['value.'+k]=1 }
['IPP', 'DENOM', 'NUMER', 'DENEXCEP', 'DENEX', 'MSRPOPL', 'values', 'first', 'last', 'gender', 'measure_id', 'birthdate', 'patient_id', 'sub_id', 'nqf_id'].each {|k| select['value.'+k]=1 }
render :json => MONGO_DB['patient_cache'].find({}).select(select)
end

Expand Down
10 changes: 5 additions & 5 deletions app/views/measures/matrix.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -262,19 +262,19 @@
matrix_column = (matrix[y] || matrix[matrix.push([]) - 1])

categories = []
if (patient_cache_row.value.denexcep) {
if (patient_cache_row.value.DENEXCEP) {
categories.push(5)
}
if (patient_cache_row.value.exclusions) {
if (patient_cache_row.value.DENEX) {
categories.push(4)
}
if (patient_cache_row.value.numerator) {
if (patient_cache_row.value.NUMER || patient_cache_row.value.MSRPOPL) {
categories.push(3)
}
if (patient_cache_row.value.denominator && patient_cache_row.value.denominator > patient_cache_row.value.numerator) {
if (patient_cache_row.value.DENOM && patient_cache_row.value.DENOM > (patient_cache_row.value.NUMER || 0)) {
categories.push(2)
}
if (patient_cache_row.value.population && (patient_cache_row.value.population > (patient_cache_row.value.denominator + patient_cache_row.value.exclusions + patient_cache_row.value.denexcep))) {
if (patient_cache_row.value.IPP && (patient_cache_row.value.IPP > ((patient_cache_row.value.DENOM || 0) + (patient_cache_row.value.DENEX || 0) + (patient_cache_row.value.DENEXCEP || 0)+ (patient_cache_row.value.MSRPOPL || 0)))) {
categories.push(1)
}
if (categories.length == 0) categories.push(0)
Expand Down
16 changes: 8 additions & 8 deletions lib/assets/javascripts/libraries/map_reduce_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,35 @@
var root = this;

root.map = function(record, population, denominator, numerator, exclusion, denexcep, occurrenceId) {
var value = {population: 0, denominator: 0, numerator: 0, denexcep: 0,
exclusions: 0, antinumerator: 0, patient_id: record._id,
var value = {IPP: 0, DENOM: 0, NUMER: 0, DENEXCEP: 0,
DENEX: 0, antinumerator: 0, patient_id: record._id,
medical_record_id: record.medical_record_number,
first: record.first, last: record.last, gender: record.gender,
birthdate: record.birthdate, test_id: record.test_id,
provider_performances: record.provider_performances,
race: record.race, ethnicity: record.ethnicity, languages: record.languages};
var ipp = population()
if (hqmf.SpecificsManager.validate(ipp)) {
value.population = hqmf.SpecificsManager.countUnique(occurrenceId, ipp);
value.IPP = hqmf.SpecificsManager.countUnique(occurrenceId, ipp);
var exclusions = hqmf.SpecificsManager.intersectSpecifics(exclusion(), ipp);
var denom = hqmf.SpecificsManager.intersectSpecifics(denominator(), ipp);
if (hqmf.SpecificsManager.validate(exclusions)) {
value.exclusions = hqmf.SpecificsManager.countUnique(occurrenceId, exclusions);
value.DENEX = hqmf.SpecificsManager.countUnique(occurrenceId, exclusions);
denom = hqmf.SpecificsManager.exclude(occurrenceId, denom, exclusions);
}
if (hqmf.SpecificsManager.validate(denom)) {
var numer = hqmf.SpecificsManager.intersectSpecifics(numerator(), denom);
if (hqmf.SpecificsManager.validate(numer)) {
value.numerator = hqmf.SpecificsManager.countUnique(occurrenceId, numer);
value.NUMER = hqmf.SpecificsManager.countUnique(occurrenceId, numer);
}
var excep = hqmf.SpecificsManager.intersectSpecifics(denexcep(), denom);
if (hqmf.SpecificsManager.validate(excep)) {
excep = hqmf.SpecificsManager.exclude(occurrenceId, excep, numer);
value.denexcep = hqmf.SpecificsManager.countUnique(occurrenceId, excep);
value.DENEXCEP = hqmf.SpecificsManager.countUnique(occurrenceId, excep);
denom = hqmf.SpecificsManager.exclude(occurrenceId, denom, excep);
}
value.denominator = hqmf.SpecificsManager.countUnique(occurrenceId, denom);
value.antinumerator = value.denominator-value.numerator;
value.DENOM = hqmf.SpecificsManager.countUnique(occurrenceId, denom);
value.antinumerator = value.DENOM-value.NUMER;
}
}

Expand Down
12 changes: 6 additions & 6 deletions test/unit/lib/measures/calculator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ class CalculatorTest < ActiveSupport::TestCase
assert_equal MONGO_DB["system.js"].find({}).count(), Measures::Calculator.library_functions.size

patient_result = MONGO_DB["patient_cache"].find({}).first["value"]
assert_equal patient_result["population"], 1
assert_equal patient_result["denominator"], 0
assert_equal patient_result["numerator"], 0
assert_equal patient_result["denexcep"], 0
assert_equal patient_result["exclusions"], 0
assert_equal patient_result["antinumerator"], 0
assert_equal patient_result[QME::QualityReport::POPULATION], 1
assert_equal patient_result[QME::QualityReport::DENOMINATOR], 0
assert_equal patient_result[QME::QualityReport::NUMERATOR], 0
assert_equal patient_result[QME::QualityReport::EXCEPTIONS], 0
assert_equal patient_result[QME::QualityReport::EXCLUSIONS], 0
assert_equal patient_result[QME::QualityReport::ANTINUMERATOR], 0
end

test "library functions" do
Expand Down
4 changes: 2 additions & 2 deletions test/unit/lib/measures/exporter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ class ExporterTest < ActiveSupport::TestCase

assert_equal bundled_results.size, 2

expected_by_patient = ["population", "denominator", "numerator", "denexcep", "exclusions", "antinumerator", "patient_id", "medical_record_id", "first", "last", "gender", "birthdate", "test_id", "provider_performances", "race", "ethnicity", "languages", "logger", "measure_id", "nqf_id", "effective_date"]
expected_by_patient = ["IPP", "DENOM", "NUMER", "DENEXCEP", "DENEX", "antinumerator", "patient_id", "medical_record_id", "first", "last", "gender", "birthdate", "test_id", "provider_performances", "race", "ethnicity", "languages", "logger", "measure_id", "nqf_id", "effective_date"]
by_patient = JSON.parse(bundled_results["by_patient.json"]).first["value"]
assert_equal by_patient.keys.size, expected_by_patient.size
expected_by_patient.each {|field| assert by_patient.include? field}

expected_by_measure = ["measure_id", "sub_id", "nqf_id", "population_ids", "effective_date", "test_id", "filters", "providers", "population", "denominator", "numerator", "antinumerator", "exclusions", "denexcep", "considered", "execution_time"]
expected_by_measure = ["measure_id", "sub_id", "nqf_id", "population_ids", "effective_date", "test_id", "filters", "providers", "IPP", "DENOM", "NUMER", "antinumerator", "DENEX", "DENEXCEP", "considered", "execution_time"]
by_measure = JSON.parse(bundled_results["by_measure.json"]).first
assert_equal by_measure.keys.size, expected_by_measure.size
expected_by_measure.each {|field| assert by_measure.include? field}
Expand Down

0 comments on commit a31df93

Please sign in to comment.