-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1889 from projectcypress/master
Merge 7/31
- Loading branch information
Showing
26 changed files
with
2,221 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# frozen_string_literal: true | ||
|
||
class FilterTestSetupJob < ApplicationJob | ||
queue_as :filter_test_setup | ||
include Job::Status | ||
def perform(product) | ||
product = Product.find(product) | ||
add_filtering_tests(product) | ||
end | ||
|
||
def add_filtering_tests(product) | ||
measure = ApplicationController.helpers.pick_measure_for_filtering_test(product.measure_ids, product.bundle) | ||
product.reload_relations | ||
|
||
return if product.product_tests.filtering_tests.any? | ||
|
||
# TODO: R2P: check new criteria names | ||
criteria = %w[races ethnicities genders payers age].shuffle | ||
filter_tests = [] | ||
filter_tests.push(build_filtering_test(product, measure, criteria[0, 2]), build_filtering_test(product, measure, criteria[2, 2])) | ||
filter_tests << build_filtering_test(product, measure, ['providers'], 'NPI, TIN & Provider Location') | ||
filter_tests << build_filtering_test(product, measure, ['providers'], 'NPI & TIN', incl_addr: false) | ||
criteria = ApplicationController.helpers.measure_has_snomed_dx_criteria?(measure) ? ['problems'] : criteria.values_at(4, (0..3).to_a.sample) | ||
filter_tests << build_filtering_test(product, measure, criteria) | ||
generate_filter_patients(filter_tests) | ||
end | ||
|
||
def build_filtering_test(product, measure, criteria, display_name = '', incl_addr: true) | ||
# construct options hash from criteria array and create the test | ||
options = { 'filters' => criteria.to_h { |c| [c, []] } } | ||
product.product_tests.create({ name: measure.description, product:, measure_ids: [measure.hqmf_id], cms_id: measure.cms_id, | ||
incl_addr:, display_name:, options: }, FilteringTest) | ||
end | ||
|
||
def generate_filter_patients(filter_tests) | ||
return unless filter_tests | ||
|
||
test = filter_tests.pop | ||
test.generate_patients | ||
test.save | ||
test.queued | ||
ProductTestSetupJob.perform_later(test) | ||
patients = test.patients | ||
filter_tests.each do |ft| | ||
patients.collect do |p| | ||
p2 = p.clone | ||
p2.correlation_id = ft.id | ||
p2.save | ||
p2 | ||
end | ||
ft.save | ||
ft.queued | ||
ProductTestSetupJob.perform_later(ft) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,6 @@ | ||
<% encounter_ids = individual_result.episode_results&.keys %> | ||
<% individual_result.collect_risk_variables.each do |key, rv_value| %> | ||
<% next if rv_value[:values].empty? %> | ||
<ul><%= key %> | ||
<% rv_value[:values].each do |encounter_id, values| %> | ||
<% if values.is_a? Hash %> | ||
<% if values.values.compact.empty? %> | ||
<ul>No Values Reported</ul> | ||
<% else %> | ||
<ul><%= "Encounter #{encounter_ids.index(encounter_id) + 1}" %></ul> | ||
<% values.each do |key, value| %> | ||
<% next unless value %> | ||
<ul><%= "#{key} - #{value}"%></ul> | ||
<% end %> | ||
<% end %> | ||
<% else %> | ||
<% if encounter_id == "Other" %> | ||
<ul><%= values%></ul> | ||
<% else %> | ||
<ul><%= "Encounter #{encounter_ids.index(encounter_id) + 1}"%> <%= " - #{values}" if values != 'Encounter, Performed' %></ul> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
<pre class="pre-code"><%= JSON.pretty_generate(rv_value) %></pre> | ||
</ul> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module Cypress | ||
class Application | ||
VERSION = '7.3.0'.freeze | ||
VERSION = '7.3.1'.freeze | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.