diff --git a/.github/ci.yml b/.github/ci.yml new file mode 100644 index 00000000..c3aa8623 --- /dev/null +++ b/.github/ci.yml @@ -0,0 +1,33 @@ +name: Continuous Integration +on: + pull_request: + branches: [master, bonnie_version] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + ruby-version: [2.5, 2.7.2] + mongodb-version: [4.0.18, 4.4] + + steps: + - uses: actions/checkout@v2 + - name: Use Ruby ${{ matrix.ruby-version }} + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + - name: Install dependencies + run: bundle install + - name: Start MongoDB + uses: supercharge/mongodb-github-action@1.3.0 + with: + mongodb-version: ${{ matrix.mongodb-version }} + - name: Run audit + run: bundle exec bundle-audit check --update + - name: Run tests + run: bundle exec rake test + - name: Run rubocop + run: rubocop diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 316d4290..00000000 --- a/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -language: ruby -rvm: - - 2.3.8 - -services: - - mongodb - -env: - - "JRUBY_OPTS=-J-Xmx1024m" - -before_install: - - gem install bundler -v '< 2' - -before_script: - - gem install rubocop -v 0.52.1 - -script: - - bundle exec bundle-audit check --update - - bundle exec rake test - - rubocop - -notifications: - email: - recipients: - - healthcare-ci@googlegroups.com - on_failure: change - slack: - secure: XQQmNQsUEx8KI1YqwU3DKq9eKaNNupDy3aC8ojN2T4f2AEcB/xvILNTB4N9pTV/jHhkhXjSkFG6RjJjI8jWSEF5nqF0Ue26GodgWUHDCA5Be1jC/z2Wa+9/oJIdSEGb9hgZZTuNe8IL3X1FBvF62JHkgAVJTI+zcImDtTtrH88E= - -cache: bundler -sudo: false diff --git a/Gemfile b/Gemfile index b77591fc..c8b9c651 100644 --- a/Gemfile +++ b/Gemfile @@ -4,8 +4,7 @@ gemspec :development_group => :test gem 'mongoid', '~> 6.4.2' -# gem 'cqm-models', '~> 3.0.0' -# gem 'cqm-models', git: 'https://github.com/projecttacoma/cqm-models.git', branch: 'MAT-1708' +gem 'cqm-models', git: 'https://github.com/projecttacoma/cqm-models.git', branch: 'master' # gem 'cqm-models', :path => '../cqm-models' group :development, :test do diff --git a/Gemfile.lock b/Gemfile.lock index b7d4dba4..7c81dd7b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,10 +1,16 @@ +GIT + remote: https://github.com/projecttacoma/cqm-models.git + revision: c1b6383b0e91bdb968aa16ed390065e3ea47c72c + branch: master + specs: + cqm-models (4.0.0) + PATH remote: . specs: cqm-parsers (0.2.1.1) activesupport (~> 5.2.1) builder (~> 3.1) - cqm-models (~> 3.0.6) erubis (~> 2.7.0) highline (~> 1.7.0) log4r (~> 1.1.10) @@ -21,64 +27,59 @@ PATH GEM remote: https://rubygems.org/ specs: - activemodel (5.2.4.3) - activesupport (= 5.2.4.3) - activesupport (5.2.4.3) + activemodel (5.2.6) + activesupport (= 5.2.6) + activesupport (5.2.6) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) - addressable (2.5.2) - public_suffix (>= 2.0.2, < 4.0) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) ansi (1.5.0) - ast (2.4.0) - awesome_print (1.8.0) - bson (4.10.0) + ast (2.4.2) + awesome_print (1.9.2) + bson (4.12.0) builder (3.2.4) - bundler-audit (0.6.0) - bundler (~> 1.2) - thor (~> 0.18) + bundler-audit (0.8.0) + bundler (>= 1.2.0, < 3) + thor (~> 1.0) byebug (6.0.2) cane (2.3.0) parallel - codecov (0.2.5) - colorize - json - simplecov - coderay (1.1.2) - colorize (0.8.1) - concurrent-ruby (1.1.6) - cqm-models (3.0.6) - crack (0.4.3) - safe_yaml (~> 1.0.0) - docile (1.3.1) + codecov (0.5.2) + simplecov (>= 0.15, < 0.22) + coderay (1.1.3) + concurrent-ruby (1.1.8) + crack (0.4.5) + rexml + docile (1.3.5) erubis (2.7.0) - ethon (0.12.0) - ffi (>= 1.3.0) + ethon (0.14.0) + ffi (>= 1.15.0) factory_girl (4.1.0) activesupport (>= 3.0.0) - ffi (1.14.2) - hashdiff (0.3.7) + ffi (1.15.0) + hashdiff (1.0.1) highline (1.7.10) - i18n (1.8.5) + i18n (1.8.10) concurrent-ruby (~> 1.0) - json (2.3.1) log4r (1.1.10) log_switch (1.0.0) macaddr (1.7.2) systemu (~> 2.6.5) memoist (0.9.3) - method_source (0.8.2) + method_source (0.9.2) mini_portile2 (2.4.0) - minitest (5.14.1) - minitest-reporters (1.3.5) + minitest (5.14.4) + minitest-reporters (1.4.3) ansi builder minitest (>= 5.0) ruby-progressbar - mongo (2.13.0) + mongo (2.14.0) bson (>= 4.8.2, < 5.0.0) - mongoid (6.4.5) + mongoid (6.4.8) activemodel (>= 5.1, < 6.0.0) mongo (>= 2.5.1, < 3.0.0) mongoid-tree (2.1.1) @@ -86,19 +87,19 @@ GEM mustache (1.1.1) nokogiri (1.10.10) mini_portile2 (~> 2.4.0) - parallel (1.17.0) - parser (2.6.2.0) - ast (~> 2.4.0) - powerpack (0.1.2) - pry (0.10.4) + parallel (1.20.1) + parser (2.7.2.0) + ast (~> 2.4.1) + powerpack (0.1.3) + pry (0.12.2) coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) - pry-nav (0.2.4) - pry (>= 0.9.10, < 0.11.0) - public_suffix (3.0.3) + method_source (~> 0.9.0) + pry-nav (0.3.0) + pry (>= 0.9.10, < 0.13.0) + public_suffix (4.0.6) rainbow (3.0.0) - rake (12.3.3) + rake (13.0.3) + rexml (3.2.5) rubocop (0.52.1) parallel (~> 1.10) parser (>= 2.4.0.2, < 3.0) @@ -106,38 +107,39 @@ GEM rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) unicode-display_width (~> 1.0, >= 1.0.1) - ruby-progressbar (1.10.0) + ruby-progressbar (1.11.0) rubyzip (1.3.0) - safe_yaml (1.0.4) - simplecov (0.16.1) + simplecov (0.21.2) docile (~> 1.1) - json (>= 1.8, < 3) - simplecov-html (~> 0.10.0) - simplecov-html (0.10.2) - slop (3.6.0) + simplecov-html (~> 0.11) + simplecov_json_formatter (~> 0.1) + simplecov-html (0.12.3) + simplecov_json_formatter (0.1.3) + sync (0.5.0) systemu (2.6.5) tailor (1.1.5) log_switch (>= 0.3.0) term-ansicolor (>= 1.0.5) text-table (>= 1.2.2) - term-ansicolor (1.6.0) + term-ansicolor (1.7.1) tins (~> 1.0) text-table (1.2.4) - thor (0.20.0) + thor (1.1.0) thread_safe (0.3.6) - tins (1.16.3) + tins (1.29.0) + sync typhoeus (1.4.0) ethon (>= 0.9.0) - tzinfo (1.2.7) + tzinfo (1.2.9) thread_safe (~> 0.1) - unicode-display_width (1.4.0) + unicode-display_width (1.7.0) uuid (2.3.9) macaddr (~> 1.0) - vcr (3.0.3) - webmock (3.4.2) + vcr (6.0.0) + webmock (3.12.2) addressable (>= 2.3.6) crack (>= 0.3.2) - hashdiff + hashdiff (>= 0.4.0, < 2.0.0) zip-zip (0.3) rubyzip (>= 1.0.0) @@ -150,6 +152,7 @@ DEPENDENCIES byebug (~> 6.0.2) cane (~> 2.3.0) codecov + cqm-models! cqm-parsers! factory_girl (~> 4.1.0) minitest (~> 5.3) diff --git a/cqm-parsers.gemspec b/cqm-parsers.gemspec index da4d9c1d..c859df82 100644 --- a/cqm-parsers.gemspec +++ b/cqm-parsers.gemspec @@ -11,7 +11,7 @@ Gem::Specification.new do |s| s.version = '0.2.1.1' - s.add_dependency 'cqm-models', '~> 3.0.6' + # s.add_dependency 'cqm-models', '~> 3.0.6' s.add_dependency 'mustache' s.add_dependency 'erubis', '~> 2.7.0' s.add_dependency 'mongoid', '~> 6.4.2' diff --git a/lib/util/hqmfr2cql_template_oid_map.json b/lib/util/hqmfr2cql_template_oid_map.json index bb5d9b2d..d16f99c5 100644 --- a/lib/util/hqmfr2cql_template_oid_map.json +++ b/lib/util/hqmfr2cql_template_oid_map.json @@ -219,10 +219,6 @@ "definition":"care_goal", "status":"", "negation":false}, - "2.16.840.1.113883.10.20.28.4.13":{ - "definition":"device", - "status":"applied", - "negation":false}, "2.16.840.1.113883.10.20.28.4.11":{ "definition":"device_adverse_event", "status":"", diff --git a/test/fixtures/measureloading/CMS144_v5_8_Artifacts_20191104.zip b/test/fixtures/measureloading/CMS144_v5_8_Artifacts_20191104.zip deleted file mode 100644 index 8a931f93..00000000 Binary files a/test/fixtures/measureloading/CMS144_v5_8_Artifacts_20191104.zip and /dev/null differ diff --git a/test/fixtures/measureloading/CMS144v610-Artifacts.zip b/test/fixtures/measureloading/CMS144v610-Artifacts.zip new file mode 100644 index 00000000..6823992a Binary files /dev/null and b/test/fixtures/measureloading/CMS144v610-Artifacts.zip differ diff --git a/test/unit/hqmf/1.0/document_v1_test.rb b/test/unit/hqmf/1.0/document_v1_test.rb index 0c969409..74fe7466 100644 --- a/test/unit/hqmf/1.0/document_v1_test.rb +++ b/test/unit/hqmf/1.0/document_v1_test.rb @@ -32,7 +32,7 @@ def test_attributes attr = @doc.attribute('F8D5AD22-F49E-4181-B886-E5B12BEA8966e') assert_equal 'MSRED', attr.code assert_equal '00001231', attr.value - assert_equal nil, attr.unit + assert_nil attr.unit assert_equal 'Measurement end date', attr.name attr = @doc.attribute_for_code('MSRTP') @@ -59,7 +59,7 @@ def test_population_criteria assert_equal '64', ipp.preconditions[0].comparison.restrictions[0].range.low.value assert_equal 'a', ipp.preconditions[0].comparison.restrictions[0].range.low.unit assert_equal true, ipp.preconditions[0].comparison.restrictions[0].range.low.inclusive? - assert_equal nil, ipp.preconditions[0].comparison.restrictions[0].range.high + assert_nil ipp.preconditions[0].comparison.restrictions[0].range.high den = @doc.population_criteria_for_code('DENOM') assert_equal 1, den.preconditions.length @@ -72,7 +72,7 @@ def test_population_criteria num = @doc.population_criteria_for_code('NUMER') assert_equal 1, num.preconditions.length assert_equal 'AND', num.preconditions[0].conjunction - assert_equal nil, num.preconditions[0].comparison + assert_nil num.preconditions[0].comparison assert_equal 2, num.preconditions[0].preconditions.length assert_equal 1, num.preconditions[0].restrictions.length assert_equal 'DURING', num.preconditions[0].restrictions[0].type diff --git a/test/unit/hqmf/1.0/nqf_0002_test.rb b/test/unit/hqmf/1.0/nqf_0002_test.rb index dbe8e2f9..549c609b 100644 --- a/test/unit/hqmf/1.0/nqf_0002_test.rb +++ b/test/unit/hqmf/1.0/nqf_0002_test.rb @@ -1,7 +1,7 @@ require_relative '../../../test_helper' module HQMF1 - class NQF0002Test < Minitest::Test + class NQF0002Test < Minitest::Test def setup path = File.expand_path("../../../../fixtures/1.0/0002/0002.xml", __FILE__) @hqmf_contents = File.open(path).read @@ -14,8 +14,8 @@ def test_to_json_0002 all_criteria = json[:data_criteria] refute_nil all_criteria - all_criteria.length.must_equal 11 - all_criteria.length.must_equal hqmf.all_data_criteria.length + _(all_criteria.length).must_equal 11 + _(all_criteria.length).must_equal hqmf.all_data_criteria.length ["PATIENT_CHARACTERISTIC_BIRTH_DATE","ENCOUNTER_ENCOUNTER_AMBULATORY_INCLUDING_PEDIATRICS","LABORATORY_TEST_PERFORMED_GROUP_A_STREPTOCOCCUS_TEST", "DIAGNOSIS_ACTIVE_PHARYNGITIS","MEDICATION_ACTIVE_PHARYNGITIS_ANTIBIOTICS","MEDICATION_DISPENSED_PHARYNGITIS_ANTIBIOTICS", @@ -38,66 +38,66 @@ def test_to_json_0002 end population_criteria = logic["NUMER"][:preconditions] - population_criteria.size.must_equal 2 + _(population_criteria.size).must_equal 2 refute_nil population_criteria[0][:comparison] assert_nil(population_criteria[0][:preconditions]) assert_nil(population_criteria[0][:restrictions]) - population_criteria[0][:comparison][:restrictions].size.must_equal 1 + _(population_criteria[0][:comparison][:restrictions].size).must_equal 1 refute_nil population_criteria[1][:comparison] assert_nil(population_criteria[1][:preconditions]) assert_nil(population_criteria[1][:restrictions]) - population_criteria[1][:comparison][:restrictions].size.must_equal 1 + _(population_criteria[1][:comparison][:restrictions].size).must_equal 1 - population_criteria[0][:comparison][:restrictions][0][:type].must_equal "EAS" + _(population_criteria[0][:comparison][:restrictions][0][:type]).must_equal "EAS" assert population_criteria[0][:comparison][:restrictions][0][:negation] population_criteria = logic["IPP"][:preconditions] - population_criteria.size.must_equal 2 + _(population_criteria.size).must_equal 2 refute_nil population_criteria[0][:comparison] - population_criteria[0][:conjunction].must_equal "AND" + _(population_criteria[0][:conjunction]).must_equal "AND" assert_nil(population_criteria[0][:preconditions]) assert_nil(population_criteria[0][:restrictions]) - population_criteria[0][:comparison][:data_criteria_id].must_equal "E929E9CB-E788-47C3-A467-4AB732D0606C" - population_criteria[0][:comparison][:title].must_equal "Patient Characteristic: birth date" - population_criteria[0][:comparison][:restrictions].size.must_equal 1 - population_criteria[0][:comparison][:restrictions][0][:type].must_equal "SBS" + _(population_criteria[0][:comparison][:data_criteria_id]).must_equal "E929E9CB-E788-47C3-A467-4AB732D0606C" + _(population_criteria[0][:comparison][:title]).must_equal "Patient Characteristic: birth date" + _(population_criteria[0][:comparison][:restrictions].size).must_equal 1 + _(population_criteria[0][:comparison][:restrictions][0][:type]).must_equal "SBS" assert !population_criteria[0][:comparison][:restrictions][0][:negation] - population_criteria[0][:comparison][:restrictions][0][:target_id].must_equal "D578142D-F78F-4BF4-8194-82015DE21A7F" - population_criteria[0][:comparison][:restrictions][0][:range][:low][:value].must_equal "2" - population_criteria[0][:comparison][:restrictions][0][:range][:low][:unit].must_equal "a" - population_criteria[0][:comparison][:restrictions][0][:range][:low][:inclusive?].must_equal true + _(population_criteria[0][:comparison][:restrictions][0][:target_id]).must_equal "D578142D-F78F-4BF4-8194-82015DE21A7F" + _(population_criteria[0][:comparison][:restrictions][0][:range][:low][:value]).must_equal "2" + _(population_criteria[0][:comparison][:restrictions][0][:range][:low][:unit]).must_equal "a" + _(population_criteria[0][:comparison][:restrictions][0][:range][:low][:inclusive?]).must_equal true refute_nil population_criteria[1][:comparison] - population_criteria[1][:conjunction].must_equal "AND" + _(population_criteria[1][:conjunction]).must_equal "AND" assert_nil(population_criteria[1][:preconditions]) assert_nil(population_criteria[1][:restrictions]) - population_criteria[1][:comparison][:data_criteria_id].must_equal "E929E9CB-E788-47C3-A467-4AB732D0606C" - population_criteria[1][:comparison][:title].must_equal "Patient Characteristic: birth date" - population_criteria[1][:comparison][:restrictions].size.must_equal 1 - population_criteria[1][:comparison][:restrictions][0][:type].must_equal "SBS" - population_criteria[1][:comparison][:restrictions][0][:target_id].must_equal "D578142D-F78F-4BF4-8194-82015DE21A7F" - population_criteria[1][:comparison][:restrictions][0][:range][:high][:value].must_equal "17" - population_criteria[1][:comparison][:restrictions][0][:range][:high][:unit].must_equal "a" - population_criteria[1][:comparison][:restrictions][0][:range][:high][:inclusive?].must_equal true + _(population_criteria[1][:comparison][:data_criteria_id]).must_equal "E929E9CB-E788-47C3-A467-4AB732D0606C" + _(population_criteria[1][:comparison][:title]).must_equal "Patient Characteristic: birth date" + _(population_criteria[1][:comparison][:restrictions].size).must_equal 1 + _(population_criteria[1][:comparison][:restrictions][0][:type]).must_equal "SBS" + _(population_criteria[1][:comparison][:restrictions][0][:target_id]).must_equal "D578142D-F78F-4BF4-8194-82015DE21A7F" + _(population_criteria[1][:comparison][:restrictions][0][:range][:high][:value]).must_equal "17" + _(population_criteria[1][:comparison][:restrictions][0][:range][:high][:unit]).must_equal "a" + _(population_criteria[1][:comparison][:restrictions][0][:range][:high][:inclusive?]).must_equal true population_criteria = logic["DENOM"][:preconditions] - population_criteria.size.must_equal 4 + _(population_criteria.size).must_equal 4 - population_criteria[0][:conjunction].must_equal "AND" - population_criteria[0][:comparison][:data_criteria_id].must_equal "CA71325F-084A-4F5A-9214-229D925F836D" - population_criteria[0][:comparison][:title].must_equal "Encounter: Encounter ambulatory including pediatrics" - population_criteria[0][:comparison][:restrictions].size.must_equal 1 - population_criteria[0][:comparison][:restrictions][0][:type].must_equal "DURING" - population_criteria[0][:comparison][:restrictions][0][:target_id].must_equal "D578142D-F78F-4BF4-8194-82015DE21A7F" + _(population_criteria[0][:conjunction]).must_equal "AND" + _(population_criteria[0][:comparison][:data_criteria_id]).must_equal "CA71325F-084A-4F5A-9214-229D925F836D" + _(population_criteria[0][:comparison][:title]).must_equal "Encounter: Encounter ambulatory including pediatrics" + _(population_criteria[0][:comparison][:restrictions].size).must_equal 1 + _(population_criteria[0][:comparison][:restrictions][0][:type]).must_equal "DURING" + _(population_criteria[0][:comparison][:restrictions][0][:target_id]).must_equal "D578142D-F78F-4BF4-8194-82015DE21A7F" assert !population_criteria[2][:negation] - population_criteria[2][:preconditions][0][:conjunction].must_equal "OR" - population_criteria[2][:preconditions][0][:comparison][:restrictions].size.must_equal 1 - population_criteria[2][:preconditions][0][:comparison][:restrictions][0][:type].must_equal "DURING" - population_criteria[2][:preconditions][0][:comparison][:restrictions][0][:target_id].must_equal "D578142D-F78F-4BF4-8194-82015DE21A7F" + _(population_criteria[2][:preconditions][0][:conjunction]).must_equal "OR" + _(population_criteria[2][:preconditions][0][:comparison][:restrictions].size).must_equal 1 + _(population_criteria[2][:preconditions][0][:comparison][:restrictions][0][:type]).must_equal "DURING" + _(population_criteria[2][:preconditions][0][:comparison][:restrictions][0][:target_id]).must_equal "D578142D-F78F-4BF4-8194-82015DE21A7F" assert population_criteria[3][:negation] @@ -107,10 +107,9 @@ def test_to_json_0002 def check_data_criteria(all_criteria, key, values) data_criteria = all_criteria[key] - data_criteria[:id].must_equal values[:id] - data_criteria[:title].must_equal values[:title] - data_criteria[:code_list_id].must_equal values[:code_list_id] + _(data_criteria[:id]).must_equal values[:id] + _(data_criteria[:title]).must_equal values[:title] + _(data_criteria[:code_list_id]).must_equal values[:code_list_id] end - end end diff --git a/test/unit/hqmf/1.0/nqf_0033_test.rb b/test/unit/hqmf/1.0/nqf_0033_test.rb index c726ad3e..935f5eb4 100644 --- a/test/unit/hqmf/1.0/nqf_0033_test.rb +++ b/test/unit/hqmf/1.0/nqf_0033_test.rb @@ -1,13 +1,13 @@ require_relative '../../../test_helper' module HQMF1 - + # 0033 has patient characteristic gender, so it is used to verify the backfilling of the gender as part of the conversion class NQF0033Test < Minitest::Test def setup path = File.expand_path("../../../../fixtures/1.0/0033/0033.xml", __FILE__) @hqmf_contents = File.open(path).read - + @codes = { "2.16.840.1.113883.3.560.100.2" => {"HL7"=>["F"]}, "2.16.840.1.113883.1.11.1" => {"HL7" => ["M","F","UN"]}, @@ -34,20 +34,20 @@ def setup '2.16.840.1.113883.3.464.0003.11.02.0007' => {}, '2.16.840.1.113883.3.464.0003.10.02.0051' => {} } - + end - + def test_patient_criteria_backfill hqmf = HQMF::Parser::V1Parser.new.parse(@hqmf_contents) hqmf.backfill_patient_characteristics_with_codes(@codes) - + gender_female = hqmf.data_criteria(hqmf.all_data_criteria.map(&:id).grep(/PatientCharacteristicGenderAdministrativeGenderFemale/).first) - gender_female.value.code.must_equal "F" - gender_female.value.system.must_equal "Administrative Sex" - gender_female.value.type.must_equal "CD" + _(gender_female.value.code).must_equal "F" + _(gender_female.value.system).must_equal "Administrative Sex" + _(gender_female.value.type).must_equal "CD" end - - + + end end diff --git a/test/unit/hqmf/model/nqf_0002_test.rb b/test/unit/hqmf/model/nqf_0002_test.rb index 505fdbb6..d4d07451 100644 --- a/test/unit/hqmf/model/nqf_0002_test.rb +++ b/test/unit/hqmf/model/nqf_0002_test.rb @@ -1,7 +1,7 @@ require_relative '../../../test_helper' module HQMFModel - class NQF0002Test < Minitest::Test + class NQF0002Test < Minitest::Test def setup path = File.expand_path("../../../../fixtures/1.0/0002/0002.xml", __FILE__) @hqmf_contents = File.open(path).read @@ -27,14 +27,14 @@ def test_to_json_0002 json = hqmf.to_json - json[:id].must_equal "0002" - json[:title].must_equal "Appropriate Testing for Children with Pharyngitis" + _(json[:id]).must_equal "0002" + _(json[:title]).must_equal "Appropriate Testing for Children with Pharyngitis" refute_nil json[:description] all_criteria = json[:data_criteria] refute_nil all_criteria - all_criteria.length.must_equal 30 - all_criteria.length.must_equal hqmf.all_data_criteria.length + _(all_criteria.length).must_equal 30 + _(all_criteria.length).must_equal hqmf.all_data_criteria.length [:PatientCharacteristicBirthDate, :EncounterEncounterAmbulatoryIncludingPediatrics, :LaboratoryTestPerformedGroupAStreptococcusTest, :DiagnosisActivePharyngitis, :MedicationActivePharyngitisAntibiotics, :MedicationDispensedPharyngitisAntibiotics, @@ -237,8 +237,8 @@ def test_to_json_0002 end population_criteria = logic[:NUMER] - population_criteria[:conjunction?].must_equal true - population_criteria[:preconditions].size.must_equal 1 + _(population_criteria[:conjunction?]).must_equal true + _(population_criteria[:preconditions].size).must_equal 1 numerator = {conjunction?:true, @@ -347,14 +347,14 @@ def test_finders model = HQMF::Parser::V1Parser.new.parse(@hqmf_contents) model.backfill_patient_characteristics_with_codes(codes) - model.all_data_criteria.size.must_equal 30 + _(model.all_data_criteria.size).must_equal 30 model.all_data_criteria.map(&:id).each do |key| refute_nil model.data_criteria(key) end - model.all_population_criteria.size.must_equal 4 + _(model.all_population_criteria.size).must_equal 4 ["NUMER", "DENOM", "IPP"].each do |key| refute_nil model.population_criteria(key) @@ -421,7 +421,7 @@ def data_criteria_matches(expected, actual) def test_all_code_set_oids hqmf = HQMF::Parser::V1Parser.new.parse(@hqmf_contents) oids = hqmf.all_code_set_oids - oids.length.must_equal 9 + _(oids.length).must_equal 9 end end diff --git a/test/unit/hqmf/model/population_criteria_test.rb b/test/unit/hqmf/model/population_criteria_test.rb index 58f72143..da8a5690 100644 --- a/test/unit/hqmf/model/population_criteria_test.rb +++ b/test/unit/hqmf/model/population_criteria_test.rb @@ -1,7 +1,7 @@ require_relative '../../../test_helper' module HQMFModel - class PopulationCriteriaTest < Minitest::Test + class PopulationCriteriaTest < Minitest::Test def setup end @@ -15,7 +15,7 @@ def test_conjunction_code } ['IPP','DENOM','NUMER','DENEXCEP'].each do |id| - HQMF::PopulationCriteria.new(id, id, id, []).conjunction_code.must_equal expected[id] + expect(HQMF::PopulationCriteria.new(id, id, id, []).conjunction_code).must_equal expected[id] end assert_raises(RuntimeError) { diff --git a/test/unit/measure-loader/cql_loader_test.rb b/test/unit/measure-loader/cql_loader_test.rb index caf9d1ba..bd37ae1e 100644 --- a/test/unit/measure-loader/cql_loader_test.rb +++ b/test/unit/measure-loader/cql_loader_test.rb @@ -339,16 +339,19 @@ def test_no_value_set_loader end def test_extract_fields_from_single_code_reference_data_criteria - measure_file = File.new File.join(@fixtures_path, 'CMS144_v5_8_Artifacts_20191104.zip') + measure_file = File.new File.join(@fixtures_path, 'CMS144v610-Artifacts.zip') loader = Measures::CqlLoader.new(measure_file, @measure_details) measures = loader.extract_measures measure = measures[0] # value sets should only contain the fake drc generated valuesets - assert_equal ["drc-c48426f721cede4d865df946157d5e2dc90bd32763ffcb982ca45b3bd97a29db", "drc-7d7da17150a47034168a1372592dc014b452ce8d960b2ecd2b7f426cf4912dc3"], measure.value_sets.map(&:oid) + assert_equal ["drc-c48426f721cede4d865df946157d5e2dc90bd32763ffcb982ca45b3bd97a29db", + "drc-6c1bdcd47568e8c9154d6fb664e50e9f101cfd349258a8fc1483098e590f9683", + "drc-7d7da17150a47034168a1372592dc014b452ce8d960b2ecd2b7f426cf4912dc3"], measure.value_sets.map(&:oid) # source data criteria that rely on drc should still work assert_equal 1, measure.source_data_criteria.select { |sdc| sdc.description == "Allergy/Intolerance: Substance with beta adrenergic receptor antagonist mechanism of action (substance)" }.count assert_equal 1, measure.source_data_criteria.select { |sdc| sdc.description == "Patient Characteristic Birthdate: Birth date" }.count + assert_equal 1, measure.source_data_criteria.select { |sdc| sdc.description == "Diagnosis: Left ventricular systolic dysfunction (disorder)" }.count end def test_negated_source_criteria_with_drc