lib/health-data-standards/models/cqm/measure.rb in health-data-standards-3.2.7 vs lib/health-data-standards/models/cqm/measure.rb in health-data-standards-3.2.8

- old
+ new

@@ -69,19 +69,19 @@ def as_hqmf_model @hqmf ||= HQMF::Document.from_json(self.hqmf_document) end def smoking_gun_data(patient_cache_filter={}) - ::Measure.calculate_smoking_gun_data(self.hqmf_id, patient_cache_filter) + ::Measure.calculate_smoking_gun_data(self["bundle_id"], self.hqmf_id, patient_cache_filter) end # Calculate the smoking gun data for the given hqmf_id with the given patient_cache_filter # The filter will allow us to segment the cache by things like test_id required for Cypress. - def self.calculate_smoking_gun_data(hqmf_id, patient_cache_filter={}) + def self.calculate_smoking_gun_data(bundle_id, hqmf_id, patient_cache_filter={}) population_keys = ('a'..'zz').to_a values = {} - measure = Measure.top_level.where({hqmf_id: hqmf_id}).first + measure = Measure.top_level.where({hqmf_id: hqmf_id, bundle_id: bundle_id}).first sub_ids = [] hqmf_measure = measure.as_hqmf_model population_codes = [] if hqmf_measure.populations.length == 1 sub_ids = nil @@ -137,10 +137,10 @@ rescue value_set_oid = 'In QRDA Header (Non Null Value)' qrda_template = 'N/A' end # end begin recue description = "#{HQMF::DataCriteria.title_for_template_id(template).titleize}: #{data_criteria.title}" - result << {description: description, oid: value_set_oid, template: qrda_template} + result << {description: description, oid: value_set_oid, template: qrda_template, rationale: rationale[data_criteria.id]} if data_criteria.temporal_references data_criteria.temporal_references.each do |temporal_reference| if temporal_reference.reference.id != 'MeasurePeriod' result.concat loop_data_criteria(hqmf, hqmf.data_criteria(temporal_reference.reference.id), rationale) end #if temporal_reference.reference.id \ No newline at end of file