bonnie_bundler 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -79,6 +79,27 @@ class CQLLoaderTest < ActiveSupport::TestCase
79
79
  end
80
80
  end
81
81
 
82
+ test 'Loading measure with unique characters such as &amp; which should be displayed and stored as "&"' do
83
+ measure_export = File.new File.join('test', 'fixtures', 'TOB2_v5_5_Artifacts.zip')
84
+ VCR.use_cassette('valid_vsac_response_special_characters') do
85
+ dump_db
86
+ user = User.new
87
+ user.save
88
+
89
+ measure_details = {'episode_of_care' => false }
90
+ Measures::CqlLoader.load(measure_export, user, measure_details, { profile: APP_CONFIG['vsac']['default_profile'], include_draft: true }, get_ticket_granting_ticket).save
91
+ assert_equal 1, CqlMeasure.all.count
92
+ measure = CqlMeasure.all.first
93
+ define_name = measure.elm_annotations['TobaccoUseTreatmentProvidedorOfferedTOB2TobaccoUseTreatmentTOB2a']['statements'][36]['define_name']
94
+ clause_text = measure.elm_annotations['TobaccoUseTreatmentProvidedorOfferedTOB2TobaccoUseTreatmentTOB2a']['statements'][36]['children'][0]['children'][0]['children'][0]['text']
95
+
96
+ assert_not_equal 'Type of Tobacco Used - Cigar &amp; Pipe', define_name
97
+ assert_equal 'Type of Tobacco Used - Cigar & Pipe', define_name
98
+ assert !clause_text.include?('define "Type of Tobacco Used - Cigar &amp; Pipe"')
99
+ assert clause_text.include?('define "Type of Tobacco Used - Cigar & Pipe"')
100
+ end
101
+ end
102
+
82
103
  test 'Re-loading a measure with no VSAC credentials' do
83
104
  direct_reference_mat_export = File.new File.join('test', 'fixtures', 'CMS158_v5_4_Artifacts_Update.zip')
84
105
  VCR.use_cassette('valid_vsac_response_158_update') do
@@ -0,0 +1,34 @@
1
+ require 'test_helper'
2
+ require 'vcr_setup.rb'
3
+
4
+ class GetValueSetsFromMeasureModelTest < ActiveSupport::TestCase
5
+
6
+ test "Get value sets for measure" do
7
+ direct_reference_mat_export = File.new File.join('test', 'fixtures', 'CMS158_v5_4_Artifacts_Update.zip')
8
+
9
+ dump_db
10
+ user = User.new
11
+ user.save
12
+ measure_details = { 'episode_of_care'=> false }
13
+ VCR.use_cassette('valid_vsac_response_158_update') do
14
+ Measures::CqlLoader.load(direct_reference_mat_export, user, measure_details, { profile: APP_CONFIG['vsac']['default_profile'] }, get_ticket_granting_ticket).save
15
+ end
16
+
17
+ measure = CqlMeasure.all.first
18
+
19
+ # add a duplicate value set with a different version, and also with a matching version
20
+ expected_version = "DRAFT: " + measure.hqmf_set_id
21
+ a = Mongoid.default_client["health_data_standards_svs_value_sets"].find().first.except('_id')
22
+ b = Mongoid.default_client["health_data_standards_svs_value_sets"].find().first.except('_id')
23
+ a[:version] = "duplicate vs"
24
+ b[:version] = expected_version
25
+ Mongoid.default_client["health_data_standards_svs_value_sets"].insert_one(a)
26
+ Mongoid.default_client["health_data_standards_svs_value_sets"].insert_one(b)
27
+ Mongoid.default_client["health_data_standards_svs_value_sets"].insert_one(b)
28
+
29
+ assert_equal 12, measure.value_sets.count
30
+ assert_equal 9, measure.value_sets_by_oid.count
31
+ some_vs = measure.value_sets[0]
32
+ assert_equal some_vs[:display_name], measure.value_sets_by_oid[some_vs[:oid]][expected_version][:display_name]
33
+ end
34
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bonnie_bundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - The MITRE Corporation
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-13 00:00:00.000000000 Z
11
+ date: 2018-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: health-data-standards
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '4.0'
19
+ version: '4.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '4.0'
26
+ version: '4.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: quality-measure-engine
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -210,6 +210,7 @@ files:
210
210
  - test/fixtures/CMS158_v5_4_Artifacts_Update.zip
211
211
  - test/fixtures/DRAFT_CMS2_CQL.zip
212
212
  - test/fixtures/PVC2_v5_4_Unused_Support_Libraries.zip
213
+ - test/fixtures/TOB2_v5_5_Artifacts.zip
213
214
  - test/fixtures/bonnienesting01_fixed.zip
214
215
  - test/fixtures/vcr_cassettes/mat_5-4_cql_export_vsac_response.yml
215
216
  - test/fixtures/vcr_cassettes/multi_library_webcalls.yml
@@ -220,6 +221,7 @@ files:
220
221
  - test/fixtures/vcr_cassettes/valid_vsac_response_hospice.yml
221
222
  - test/fixtures/vcr_cassettes/valid_vsac_response_includes_draft.yml
222
223
  - test/fixtures/vcr_cassettes/valid_vsac_response_pvc_unused_libraries.yml
224
+ - test/fixtures/vcr_cassettes/valid_vsac_response_special_characters.yml
223
225
  - test/fixtures/vcr_cassettes/vs_loading_500_response.yml
224
226
  - test/fixtures/vcr_cassettes/vs_loading_draft_no_profile_version.yml
225
227
  - test/fixtures/vcr_cassettes/vs_loading_draft_profile.yml
@@ -254,6 +256,7 @@ files:
254
256
  - test/simplecov_init.rb
255
257
  - test/test_helper.rb
256
258
  - test/unit/cql_loader_test.rb
259
+ - test/unit/get_value_sets_from_measure_model_test.rb
257
260
  - test/unit/load_mat_export_test.rb
258
261
  - test/unit/measure_complexity_test.rb
259
262
  - test/unit/measure_diff_test.rb