Class: CQM::Measure

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

Overview

Measure contains the information necessary to represent the CQL version of a Clinical Quality Measure, As needed by the Bonnie & Cypress applications

Constant Summary collapse

IPP =
'IPP'.freeze
DENOM =
'DENOM'.freeze
NUMER =
'NUMER'.freeze
NUMEX =
'NUMEX'.freeze
DENEXCEP =
'DENEXCEP'.freeze
DENEX =
'DENEX'.freeze
MSRPOPL =
'MSRPOPL'.freeze
OBSERV =
'OBSERV'.freeze
MSRPOPLEX =
'MSRPOPLEX'.freeze
STRAT =
'STRAT'.freeze
ALL_POPULATION_CODES =
[STRAT, IPP, DENOM, DENEX, NUMER, NUMEX, DENEXCEP, MSRPOPL, OBSERV, MSRPOPLEX].freeze
CQL_SKIP_STATEMENTS =
['SDE Ethnicity', 'SDE Payer', 'SDE Race', 'SDE Sex'].freeze

Instance Method Summary collapse

Instance Method Details

#all_data_criteriaObject



103
104
105
# File 'app/models/cqm/measure.rb', line 103

def all_data_criteria
  as_hqmf_model.all_data_criteria
end

#all_stratificationsObject



78
79
80
# File 'app/models/cqm/measure.rb', line 78

def all_stratifications
  population_sets.flat_map(&:stratifications)
end

#as_hqmf_modelObject

Returns the hqmf-parser’s ruby implementation of an HQMF document. Rebuild from population_criteria, data_criteria, and measure_period JSON



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'app/models/cqm/measure.rb', line 84

def as_hqmf_model
  json = {
    'id' => hqmf_id,
    'title' => title,
    'description' => description,
    'population_criteria' => population_criteria,
    'data_criteria' => data_criteria,
    'source_data_criteria' => source_data_criteria,
    'measure_period' => measure_period,
    'attributes' => measure_attributes,
    'populations' => populations,
    'hqmf_id' => hqmf_id,
    'hqmf_set_id' => hqmf_set_id,
    'hqmf_version_number' => hqmf_version_number,
    'cms_id' => cms_id
  }
  HQMF::Document.from_json(json)
end