From 1a8f474117e57225e955d405c4401502fe39bf0c Mon Sep 17 00:00:00 2001 From: David Czulada Date: Tue, 3 Mar 2026 09:50:20 -0500 Subject: [PATCH 1/4] this works? --- app/controllers/records_controller.rb | 2 +- .../controllers/measure_search_controller.js | 40 +++++-------------- app/views/records/index.html.erb | 2 +- 3 files changed, 12 insertions(+), 32 deletions(-) diff --git a/app/controllers/records_controller.rb b/app/controllers/records_controller.rb index 0f9e11fa2..806a5403d 100644 --- a/app/controllers/records_controller.rb +++ b/app/controllers/records_controller.rb @@ -173,7 +173,7 @@ def measures_for_source { label: label_str, value: val } end - end.flatten.to_json.html_safe + end.flatten.to_json end end end diff --git a/app/javascript/controllers/measure_search_controller.js b/app/javascript/controllers/measure_search_controller.js index ca5dd0379..ea97edb8c 100644 --- a/app/javascript/controllers/measure_search_controller.js +++ b/app/javascript/controllers/measure_search_controller.js @@ -1,6 +1,4 @@ import { Controller } from "@hotwired/stimulus"; -import $ from "jquery2"; -import "jquery-ui"; // Connects data-controller="measure-search" export default class extends Controller { @@ -23,41 +21,23 @@ export default class extends Controller { } initializeAutocomplete() { - const $input = $(this.inputTarget); - + const $ = window.jQuery; let source = []; try { source = JSON.parse(this.sourceValue || "[]"); } catch (e) { console.error("Bad source JSON", this.sourceValue, e); } - - $(document).ready(function () { - $input.autocomplete({ - delay: 500, - source: this.sourceValue, - select: (event, data) => { - $.get(data.item.value); - event.preventDefault(); - }, - focus: (event) => event.preventDefault, - }); + var availableTags = [{"label":"CMS349v7: HIV Screening","value":"/bundles/66797c1bdfe4bd02748db95e/records/by_measure?measure_id=2C928083-8907-CE68-0189-0DA36CC00327\u0026pop_set_key=PopulationSet_1"}]; + $( "#search_measures" ).autocomplete({ + delay: 500, + source: source, + select: (event, data) => { + $.get(data.item.value); + event.preventDefault(); + }, + focus: (event) => event.preventDefault }); - - const ac = $input.data("ui-autocomplete"); - if (!ac) return; - - ac._renderItem = function (ul, item) { - return $('
  • ').append(item.label).appendTo(ul); - }; - - ac._renderMenu = function (ul, items) { - const that = this; - $.each(items, function (_index, item) { - this._renderItemData(ul, item); - }); - $(ul).removeClass("ui-widget ui-widget-content").addClass("list-group"); - }; } bindKeyup() { diff --git a/app/views/records/index.html.erb b/app/views/records/index.html.erb index e1dd9ae2a..804ec1306 100644 --- a/app/views/records/index.html.erb +++ b/app/views/records/index.html.erb @@ -37,7 +37,7 @@
    { if (!$(this.inputTarget).val()) { - $("#records_list").html(this.allRecordsHtmlValue); - - if ($.rails?.refreshCSRFTokens) $.rails.refreshCSRFTokens(); + $("#records_list").html(this.allRecordsTemplateTarget.innerHTML); } }); } diff --git a/app/views/records/index.html.erb b/app/views/records/index.html.erb index 804ec1306..a85dd0732 100644 --- a/app/views/records/index.html.erb +++ b/app/views/records/index.html.erb @@ -37,20 +37,7 @@
    + data-measure-search-source-value="<%= ERB::Util.json_escape(@measure_dropdown) %>"> +
    <% if !@task && !@product_test %> From d86b3a638ec4fcdd3964ce56561281ca892d10cb Mon Sep 17 00:00:00 2001 From: David Czulada Date: Wed, 4 Mar 2026 15:26:06 -0500 Subject: [PATCH 3/4] update cucumber test --- features/step_definitions/record.rb | 5 ++--- features/step_definitions/record_list.rb | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/features/step_definitions/record.rb b/features/step_definitions/record.rb index 2783f60f1..550182e64 100644 --- a/features/step_definitions/record.rb +++ b/features/step_definitions/record.rb @@ -90,12 +90,11 @@ end And(/^the user selects a measure from the dropdown$/) do - byebug page.execute_script "$('#search_measures').trigger('focus')" page.execute_script "$('#search_measures').trigger('keydown')" - assert page.has_selector?('.ui-autocomplete .list-group-item'), 'no dropdown result' + assert page.has_selector?('.ui-autocomplete .ui-menu-item'), 'no dropdown result' - page.find('.ui-autocomplete .list-group-item', match: :first).click + page.find('.ui-autocomplete .ui-menu-item', match: :first).click end Then(/^the user should see results for that measure$/) do diff --git a/features/step_definitions/record_list.rb b/features/step_definitions/record_list.rb index d976f8b91..d61b7993e 100644 --- a/features/step_definitions/record_list.rb +++ b/features/step_definitions/record_list.rb @@ -15,7 +15,6 @@ # T H E N # Then(/^the user should see calculation results$/) do - byebug page.assert_text('Template Name') page.assert_text('IPOP') page.assert_selector('span.result-marker') From 74380cac9cc2aa42d4256d1998dff66e1a227ddd Mon Sep 17 00:00:00 2001 From: David Czulada Date: Fri, 6 Mar 2026 15:14:30 -0500 Subject: [PATCH 4/4] get unit tests to run successfully --- .github/workflows/ruby.yml | 18 +++++++++--------- .../bundles/minimal_bundle_qdm_5_6.zip | Bin 158747 -> 159555 bytes test/helpers/test_executions_helper_test.rb | 12 ++++++------ .../lib/cypress/cql_bundle_importer_test.rb | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 7e849439e..e0a3b41a5 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -233,7 +233,7 @@ jobs: - name: Run Rake test units run: | RUBYOPT="-W0" - bin/rails test test/unit/*.rb; + env IGNORE_ROLES=false bin/rails test test/unit/*.rb; - name: Upload code coverage to codecov.io uses: codecov/codecov-action@v3 with: @@ -273,7 +273,7 @@ jobs: - name: Run Rake test units lib run: | RUBYOPT="-W0" - bin/rails test test/unit/lib/*.rb; + env IGNORE_ROLES=false bin/rails test test/unit/lib/*.rb; - name: Upload code coverage to codecov.io uses: codecov/codecov-action@v3 with: @@ -282,7 +282,7 @@ jobs: - name: Run Rake test units lib cypress run: | RUBYOPT="-W0" - bin/rails test test/unit/lib/cypress/*.rb; + env IGNORE_ROLES=false bin/rails test test/unit/lib/cypress/*.rb; - name: Upload code coverage to codecov.io uses: codecov/codecov-action@v3 with: @@ -291,7 +291,7 @@ jobs: - name: Run Rake test units lib validators run: | RUBYOPT="-W0" - bin/rails test test/unit/lib/validators/*.rb; + env IGNORE_ROLES=false bin/rails test test/unit/lib/validators/*.rb; - name: Upload code coverage to codecov.io uses: codecov/codecov-action@v3 with: @@ -300,7 +300,7 @@ jobs: - name: Run Rake test models run: | RUBYOPT="-W0" - bin/rails test test/models; + env IGNORE_ROLES=false bin/rails test test/models; - name: Upload code coverage to codecov.io uses: codecov/codecov-action@v3 with: @@ -340,7 +340,7 @@ jobs: - name: Run Rake test:jobs run: | RUBYOPT="-W0" - bundle exec rake test:jobs; + env IGNORE_ROLES=false bundle exec rake test:jobs; - name: Upload code jobs coverage to codecov.io uses: codecov/codecov-action@v3 with: @@ -349,7 +349,7 @@ jobs: - name: Run Rake test:helpers run: | RUBYOPT="-W0" - bundle exec rake test:helpers; + env IGNORE_ROLES=false bundle exec rake test:helpers; - name: Upload code helpers coverage to codecov.io uses: codecov/codecov-action@v3 with: @@ -358,7 +358,7 @@ jobs: - name: Run Rake test:controllers run: | RUBYOPT="-W0" - bundle exec rake test:controllers; + env IGNORE_ROLES=false bundle exec rake test:controllers; - name: Upload controllers code coverage to codecov.io uses: codecov/codecov-action@v3 with: @@ -398,7 +398,7 @@ jobs: - name: Run Rake test run: | RUBYOPT="-W0" - bundle exec rake test:integration; + env IGNORE_ROLES=false bundle exec rake test:integration; - name: Upload code coverage to codecov.io uses: codecov/codecov-action@v3 with: diff --git a/test/fixtures/bundles/minimal_bundle_qdm_5_6.zip b/test/fixtures/bundles/minimal_bundle_qdm_5_6.zip index decc32f15b80b41fdaa84982e8039965e4afda9f..4ac72f458e115c14ff0005233b1420b4a02b9eb9 100644 GIT binary patch delta 4440 zcma)92{=^iAD%gk5>bW>Zno^%mk=T(>qNF}!_Z(P#@e{4iL!-mQVt2Zma=3i*+(QL z3ZV$ux#?Oj>B@Bd&$zipcj|x7Jm1Wj=lOo``~J>+-}}y&+RNNH$V@UfVPNEhQLhDm zcgOXcuW!sSLD*>=HXz6!7a$izWP!mMm*Ftj`fO{fov>{ck_GsU@i)wN*mjuHH!vKu zFtYlV&X$3`{ z!&`gdHW^pdRyhszQt=+*KKpepz~BJmc0vpsT}J5)-UoeO(<3hG=@WG4Q6ABuMuaK5 zAghMm4a^O0w}e`Z!c7pC4f(^-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~7bkrff9w!!yx z5{)C{LXvvET4|RvI-0UQ?MKQO-#96bSFk4DW-`w|=}mfg8ts-t4|^i@aoKMnRl3=H zi$1UMA4*T`^ohUVoSwm-8#J-0_wI04ua_FNGE3(rV_QP{-=9`l$_^MVmz_Uh#*N zdH3vnD==cyVl6_EnE-c>hH4;b7<|A&vV%gQ-iifBFStrLZIBp-{Wq)I2Go~}S(V6B V25UqJqK@4MO diff --git a/test/helpers/test_executions_helper_test.rb b/test/helpers/test_executions_helper_test.rb index 2b280a70a..3ed859872 100644 --- a/test/helpers/test_executions_helper_test.rb +++ b/test/helpers/test_executions_helper_test.rb @@ -205,11 +205,11 @@ def test_padding_cms_id end def test_ecqi_link - # test with a measure from the 2023 reporting period - bundle2022 = Bundle.create(version: '2022.5.0') - measure2022 = Measure.create(reporting_program_type: 'ep', cms_id: 'CMS161v11', bundle_id: bundle2022.id) - ecqi_url2022 = ecqi_link(measure2022.cms_id) - ecqi_request2022 = RestClient::Request.execute(method: :get, url: ecqi_url2022) - assert_equal 200, ecqi_request2022.code + # test with a measure from the 2025 reporting period + bundle2024 = Bundle.create(version: '2024.5.0') + measure2024 = Measure.create(reporting_program_type: 'ep', cms_id: 'CMS128v13', bundle_id: bundle2024.id) + ecqi_url2024 = ecqi_link(measure2024.cms_id) + ecqi_request2024 = RestClient::Request.execute(method: :get, url: ecqi_url2024) + assert_equal 200, ecqi_request2024.code end end diff --git a/test/unit/lib/cypress/cql_bundle_importer_test.rb b/test/unit/lib/cypress/cql_bundle_importer_test.rb index 6c05db4c3..20e63b15e 100644 --- a/test/unit/lib/cypress/cql_bundle_importer_test.rb +++ b/test/unit/lib/cypress/cql_bundle_importer_test.rb @@ -20,7 +20,7 @@ class CqlBundleImporterTest < ActiveSupport::TestCase Cypress::CqlBundleImporter.import(bundle_zip, Tracker.new) assert_equal (before_measure_count + 2), Measure.count # 21 valuesets from csv file, 3 direct reference codes - assert_equal (before_value_set_count + 25), ValueSet.count + assert_equal (before_value_set_count + 27), ValueSet.count assert_equal (before_patient_count + 1), Patient.count # only 2 individual results are saved assert_equal (before_results_count + 2), IndividualResult.count @@ -46,7 +46,7 @@ class CqlBundleImporterTest < ActiveSupport::TestCase Cypress::CqlBundleImporter.import(bundle_zip, Tracker.new, include_highlighting: true) assert_equal (before_measure_count + 2), Measure.count # 21 valuesets from csv file, 3 direct reference codes - assert_equal (before_value_set_count + 25), ValueSet.count + assert_equal (before_value_set_count + 27), ValueSet.count assert_equal (before_patient_count + 1), Patient.count # only 2 individual results are saved assert_equal (before_results_count + 2), IndividualResult.count