Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure RV and SDE calculations are not impacted by randomazation #1888

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions lib/validators/calculating_augmented_records.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,17 @@ def validate_calculated_results(rec, options)

def compare_results(results, record, options)
passed = true
sde_passed = true
@measures.each do |measure|
# compare results to patient as it was initially calculated for product test (use original product patient id before cloning)
orig_results = CQM::IndividualResult.where(patient_id: options[:orig_product_patient].id, measure_id: measure.id)
orig_results.each do |orig_result|
new_result = results.select do |arr|
arr.measure_id == measure.id.to_s &&
arr.patient_id == record.id.to_s &&
arr.population_set_key == orig_result['population_set_key']
arr.measure_id == measure.id.to_s && arr.patient_id == record.id.to_s && arr.population_set_key == orig_result['population_set_key']
end.first
issue_list = []
orig_result.compare_sde_results(new_result, issue_list)
sde_passed = issue_list.blank?
measure.population_keys.each do |pop_id|
if orig_result[pop_id] != new_result[pop_id]
passed = false
Expand All @@ -50,7 +52,7 @@ def compare_results(results, record, options)
end
end
end
passed
passed && sde_passed
end
end
end
Loading