Class: CQM::IndividualResult

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Timestamps
Defined in:
app/models/cqm/individual_result.rb

Overview

IndividualResult stores the patient-level (population/clause) results for a patient/measure combination

Instance Method Summary collapse

Instance Method Details

#clause_results_by_clauseObject

Convert the stored array into a hash between clause and result



42
43
44
45
46
47
48
49
# File 'app/models/cqm/individual_result.rb', line 42

def clause_results_by_clause
  clause_results_hash = {}
  clause_results.each do |result|
    clause_results_hash[result['library_name']] = {} unless clause_results_hash[result['library_name']]
    clause_results_hash[result['library_name']][result['localId']] = result
  end
  return clause_results_hash
end

#statement_results_by_statementObject



51
52
53
54
55
56
57
58
# File 'app/models/cqm/individual_result.rb', line 51

def statement_results_by_statement
  statement_results_hash = {}
  statement_results.each do |result|
    statement_results_hash[result['library_name']] = {} unless statement_results_hash[result['library_name']]
    statement_results_hash[result['library_name']][result['statement_name']] = result
  end
  return statement_results_hash
end