Skip to content

Commit

Permalink
Updates to correct failed Cypress 6.3 C4 tests for 2022 Reporting period
Browse files Browse the repository at this point in the history
  • Loading branch information
peter li committed Dec 6, 2022
1 parent f5bae2f commit 71f8c50
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/cypress/expected_results_calculator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def aggregate_results_for_measures(measures, individual_results = nil)
# If individual_results are provided, use the results for the measure being aggregated
measure_individual_results = individual_results.select { |res| res['measure_id'] == measure.id.to_s } if individual_results
# If individual_results are provided, use them. Otherwise, look them up in the database by measure id and correlation_id
measure_individual_results ||= CQM::IndividualResult.where('measure_id' => measure._id, correlation_id: @correlation_id)
measure_individual_results ||= CQM::IndividualResult.where('measure_id' => measure._id, correlation_id: @correlation_id, 'extendedData.manual_exclusion': {'$in': [nil, false]})

aggregate_results_for_measure(measure, measure_individual_results)
end
Expand All @@ -62,7 +62,7 @@ def aggregate_results_for_measures(measures, individual_results = nil)
def aggregate_results_for_measure(measure, individual_results = nil)
# If individual_results are provided, use them. Otherwise, look them up in the database by measure id and correlation_id
begin
individual_results ||= CQM::IndividualResult.where('measure_id' => measure._id, correlation_id: @correlation_id)
individual_results ||= CQM::IndividualResult.where('measure_id' => measure._id, correlation_id: @correlation_id, 'extendedData.manual_exclusion': {'$in': [nil, false]})
rescue Exception => e
Delayed::Worker.logger.info(e.message)
Delayed::Worker.logger.info(e.backtrace.inspect)
Expand Down Expand Up @@ -172,7 +172,7 @@ def create_query_cache_object(result, measure)
if population_set.stratifications.length > 0
population_set.stratifications.each do |stratification|
sub_id = stratification.stratification_id
qco = result[measure.hqmf_id]
qco = result[measure.hqmf_id].clone
qco_saved = nil
qco['result'] = {}
if qco[sub_id].present?
Expand All @@ -196,7 +196,7 @@ def create_query_cache_object(result, measure)
# if there are only multiple populations but not stratifications
else
sub_id = population_set.population_set_id
qco = result[measure.hqmf_id]
qco = result[measure.hqmf_id].clone
qco_saved = nil
qco['result'] = {}
if qco[sub_id].present?
Expand All @@ -222,7 +222,7 @@ def create_query_cache_object(result, measure)
elsif measure.population_sets.length == 1 && measure.population_sets[0].stratifications.length > 0
measure.population_sets[0].stratifications.each do |stratification|
sub_id = stratification.stratification_id
qco = result[measure.hqmf_id]
qco = result[measure.hqmf_id].clone
qco_saved = nil
qco['result'] = {}
if qco[sub_id].present?
Expand Down

0 comments on commit 71f8c50

Please sign in to comment.