bonnie_bundler 2.0.3 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +6 -6
- data/bonnie-bundler.gemspec +1 -1
- data/lib/bonnie_bundler.rb +1 -0
- data/lib/measures/loading/cql_loader.rb +25 -12
- data/lib/measures/loading/exceptions.rb +0 -2
- data/lib/measures/loading/value_set_loader.rb +77 -97
- data/lib/util/vsac_api.rb +274 -0
- data/test/fixtures/PVC2_v5_4_Unused_Support_Libraries.zip +0 -0
- data/test/fixtures/vcr_cassettes/valid_vsac_response_pvc_unused_libraries.yml +4286 -0
- data/test/fixtures/vcr_cassettes/vs_loading_500_response.yml +633 -0
- data/test/fixtures/vcr_cassettes/vs_loading_empty_concept_list.yml +174 -0
- data/test/fixtures/vcr_cassettes/vs_loading_meausre_defined_no_backup_profile.yml +1237 -0
- data/test/fixtures/vcr_cassettes/vs_loading_release.yml +17035 -0
- data/test/fixtures/vcr_cassettes/vsac_auth_bad_credentials.yml +57 -0
- data/test/fixtures/vcr_cassettes/vsac_auth_bad_ticket.yml +57 -0
- data/test/fixtures/vcr_cassettes/vsac_auth_good_credentials.yml +57 -0
- data/test/fixtures/vcr_cassettes/vsac_auth_good_credentials_and_simple_call.yml +177 -0
- data/test/fixtures/vcr_cassettes/vsac_util_get_profiles.yml +74 -0
- data/test/fixtures/vcr_cassettes/vsac_util_get_program_details_CMS_Hybrid.yml +57 -0
- data/test/fixtures/vcr_cassettes/vsac_util_get_program_details_CMS_eCQM.yml +64 -0
- data/test/fixtures/vcr_cassettes/vsac_util_get_program_details_HL7_C-CDA.yml +58 -0
- data/test/fixtures/vcr_cassettes/vsac_util_get_program_details_invalid.yml +53 -0
- data/test/fixtures/vcr_cassettes/vsac_util_get_programs.yml +64 -0
- data/test/fixtures/vcr_cassettes/vsac_vs_include_draft_no_profile.yml +57 -0
- data/test/fixtures/vcr_cassettes/vsac_vs_include_draft_with_profile.yml +177 -0
- data/test/fixtures/vcr_cassettes/vsac_vs_no_options.yml +177 -0
- data/test/fixtures/vcr_cassettes/vsac_vs_not_found.yml +164 -0
- data/test/fixtures/vcr_cassettes/vsac_vs_release.yml +4802 -0
- data/test/fixtures/vcr_cassettes/vsac_vs_version.yml +370 -0
- data/test/test_helper.rb +9 -4
- data/test/unit/cql_loader_test.rb +42 -15
- data/test/unit/load_mat_export_test.rb +10 -13
- data/test/unit/measure_complexity_test.rb +1 -1
- data/test/unit/measure_diff_test.rb +4 -4
- data/test/unit/storing_mat_export_package_test.rb +1 -1
- data/test/unit/value_set_loading_test.rb +58 -16
- data/test/unit/vsac_api_auth_test.rb +129 -0
- data/test/unit/vsac_api_test.rb +77 -0
- data/test/unit/vsac_api_util_test.rb +139 -0
- metadata +29 -3
@@ -0,0 +1,139 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
require 'vcr_setup.rb'
|
3
|
+
|
4
|
+
# Tests that ensure VSAC utility functions fetch and parse correct data.
|
5
|
+
class VSACAPIUtilTest < ActiveSupport::TestCase
|
6
|
+
setup do
|
7
|
+
@api = Util::VSAC::VSACAPI.new(config: APP_CONFIG['vsac'])
|
8
|
+
end
|
9
|
+
|
10
|
+
test 'get_profile_names' do
|
11
|
+
VCR.use_cassette("vsac_util_get_profiles") do
|
12
|
+
expected_profiles = ["Most Recent Code System Versions in VSAC",
|
13
|
+
"eCQM Update 2018-05-04",
|
14
|
+
"C-CDA R2.1 2018-02-01",
|
15
|
+
"CMS 2018 IQR Voluntary Hybrid Reporting",
|
16
|
+
"eCQM Update 2018 EP-EC and EH",
|
17
|
+
"eCQM Update 4Q2017 EH",
|
18
|
+
"C-CDA R2.1 2017-06-09",
|
19
|
+
"eCQM Update 2017-05-05",
|
20
|
+
"MU2 Update 2017-01-06",
|
21
|
+
"C-CDA R1.1 2016-06-23",
|
22
|
+
"MU2 Update 2016-04-01",
|
23
|
+
"MU2 Update 2015-05-01",
|
24
|
+
"MU2 EP Update 2014-05-30",
|
25
|
+
"MU2 EH Update 2014-04-01",
|
26
|
+
"MU2 EP Update 2013-06-14",
|
27
|
+
"MU2 EH Update 2013-04-01",
|
28
|
+
"MU2 Update 2012-12-21",
|
29
|
+
"MU2 Update 2012-10-25"]
|
30
|
+
|
31
|
+
assert_equal expected_profiles, @api.get_profile_names
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
test 'get_program_names' do
|
36
|
+
VCR.use_cassette("vsac_util_get_programs") do
|
37
|
+
expected_programs = ["CMS Hybrid", "CMS eCQM", "HL7 C-CDA"]
|
38
|
+
|
39
|
+
assert_equal expected_programs, @api.get_program_names
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
test 'get_program_details with default constant program' do
|
44
|
+
VCR.use_cassette("vsac_util_get_program_details_CMS_eCQM") do
|
45
|
+
program_info = @api.get_program_details
|
46
|
+
|
47
|
+
assert_equal "CMS eCQM", program_info['name']
|
48
|
+
assert_equal 14, program_info['release'].count
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
test 'get_program_details with default config program' do
|
53
|
+
VCR.use_cassette("vsac_util_get_program_details_CMS_Hybrid") do
|
54
|
+
# Clone the config and add a program that will be used as the default program
|
55
|
+
config = APP_CONFIG['vsac'].clone
|
56
|
+
config[:program] = "CMS Hybrid"
|
57
|
+
configuredApi = Util::VSAC::VSACAPI.new(config: config)
|
58
|
+
program_info = configuredApi.get_program_details
|
59
|
+
|
60
|
+
assert_equal "CMS Hybrid", program_info['name']
|
61
|
+
assert_equal 1, program_info['release'].count
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
test 'get_program_details with provided program' do
|
66
|
+
VCR.use_cassette("vsac_util_get_program_details_HL7_C-CDA") do
|
67
|
+
program_info = @api.get_program_details('HL7 C-CDA')
|
68
|
+
|
69
|
+
assert_equal "HL7 C-CDA", program_info['name']
|
70
|
+
assert_equal 3, program_info['release'].count
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
test 'get_program_details for invalid program' do
|
75
|
+
VCR.use_cassette("vsac_util_get_program_details_invalid") do
|
76
|
+
assert_raise Util::VSAC::VSACProgramNotFoundError do
|
77
|
+
@api.get_program_details('Fake Program')
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
test 'get_program_release_names with default constant program' do
|
83
|
+
VCR.use_cassette("vsac_util_get_program_details_CMS_eCQM") do
|
84
|
+
expected_releases = ["eCQM Update 2018-05-04",
|
85
|
+
"eCQM Update 2018 EP-EC and EH",
|
86
|
+
"eCQM Update 4Q2017 EH",
|
87
|
+
"eCQM Update 2017-05-05",
|
88
|
+
"MU2 Update 2017-01-06",
|
89
|
+
"MU2 Update 2016-04-01",
|
90
|
+
"MU2 Update 2015-05-01",
|
91
|
+
"MU2 EP Update 2014-07-01",
|
92
|
+
"MU2 EP Update 2014-05-30",
|
93
|
+
"MU2 EH Update 2014-04-01",
|
94
|
+
"MU2 EP Update 2013-06-14",
|
95
|
+
"MU2 EH Update 2013-04-01",
|
96
|
+
"MU2 Update 2012-12-21",
|
97
|
+
"MU2 Update 2012-10-25"]
|
98
|
+
|
99
|
+
releases = @api.get_program_release_names
|
100
|
+
|
101
|
+
assert_equal expected_releases, releases
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
test 'get_program_release_names with default config program' do
|
106
|
+
VCR.use_cassette("vsac_util_get_program_details_CMS_Hybrid") do
|
107
|
+
# Clone the config and add a program that will be used as the default program
|
108
|
+
config = APP_CONFIG['vsac'].clone
|
109
|
+
config[:program] = "CMS Hybrid"
|
110
|
+
configuredApi = Util::VSAC::VSACAPI.new(config: config)
|
111
|
+
|
112
|
+
expected_releases = ["CMS 2018 IQR Voluntary Hybrid Reporting"]
|
113
|
+
|
114
|
+
releases = configuredApi.get_program_release_names
|
115
|
+
|
116
|
+
assert_equal expected_releases, releases
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
test 'get_program_release_names with provided program' do
|
121
|
+
VCR.use_cassette("vsac_util_get_program_details_HL7_C-CDA") do
|
122
|
+
expected_releases = ["C-CDA R2.1 2018-02-01",
|
123
|
+
"C-CDA R2.1 2017-06-09",
|
124
|
+
"C-CDA R1.1 2016-06-23"]
|
125
|
+
|
126
|
+
releases = @api.get_program_release_names('HL7 C-CDA')
|
127
|
+
|
128
|
+
assert_equal expected_releases, releases
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
test 'get_program_release_names for invalid program' do
|
133
|
+
VCR.use_cassette("vsac_util_get_program_details_invalid") do
|
134
|
+
assert_raise Util::VSAC::VSACProgramNotFoundError do
|
135
|
+
@api.get_program_release_names('Fake Program')
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
139
|
+
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.0
|
4
|
+
version: 2.1.0
|
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-
|
11
|
+
date: 2018-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: health-data-standards
|
@@ -203,11 +203,13 @@ files:
|
|
203
203
|
- lib/measures/mongo_hash_key_wrapper.rb
|
204
204
|
- lib/models/cql_measure.rb
|
205
205
|
- lib/models/measure.rb
|
206
|
+
- lib/util/vsac_api.rb
|
206
207
|
- test/fixtures/BCS_v5_0_Artifacts.zip
|
207
208
|
- test/fixtures/CMS134v6.zip
|
208
209
|
- test/fixtures/CMS158_v5_4_Artifacts.zip
|
209
210
|
- test/fixtures/CMS158_v5_4_Artifacts_Update.zip
|
210
211
|
- test/fixtures/DRAFT_CMS2_CQL.zip
|
212
|
+
- test/fixtures/PVC2_v5_4_Unused_Support_Libraries.zip
|
211
213
|
- test/fixtures/bonnienesting01_fixed.zip
|
212
214
|
- test/fixtures/vcr_cassettes/mat_5-4_cql_export_vsac_response.yml
|
213
215
|
- test/fixtures/vcr_cassettes/multi_library_webcalls.yml
|
@@ -217,12 +219,33 @@ files:
|
|
217
219
|
- test/fixtures/vcr_cassettes/valid_vsac_response_158_update.yml
|
218
220
|
- test/fixtures/vcr_cassettes/valid_vsac_response_hospice.yml
|
219
221
|
- test/fixtures/vcr_cassettes/valid_vsac_response_includes_draft.yml
|
222
|
+
- test/fixtures/vcr_cassettes/valid_vsac_response_pvc_unused_libraries.yml
|
223
|
+
- test/fixtures/vcr_cassettes/vs_loading_500_response.yml
|
220
224
|
- test/fixtures/vcr_cassettes/vs_loading_draft_no_profile_version.yml
|
221
225
|
- test/fixtures/vcr_cassettes/vs_loading_draft_profile.yml
|
222
226
|
- test/fixtures/vcr_cassettes/vs_loading_draft_verion.yml
|
227
|
+
- test/fixtures/vcr_cassettes/vs_loading_empty_concept_list.yml
|
228
|
+
- test/fixtures/vcr_cassettes/vs_loading_meausre_defined_no_backup_profile.yml
|
223
229
|
- test/fixtures/vcr_cassettes/vs_loading_no_profile_version.yml
|
224
230
|
- test/fixtures/vcr_cassettes/vs_loading_profile.yml
|
231
|
+
- test/fixtures/vcr_cassettes/vs_loading_release.yml
|
225
232
|
- test/fixtures/vcr_cassettes/vs_loading_version.yml
|
233
|
+
- test/fixtures/vcr_cassettes/vsac_auth_bad_credentials.yml
|
234
|
+
- test/fixtures/vcr_cassettes/vsac_auth_bad_ticket.yml
|
235
|
+
- test/fixtures/vcr_cassettes/vsac_auth_good_credentials.yml
|
236
|
+
- test/fixtures/vcr_cassettes/vsac_auth_good_credentials_and_simple_call.yml
|
237
|
+
- test/fixtures/vcr_cassettes/vsac_util_get_profiles.yml
|
238
|
+
- test/fixtures/vcr_cassettes/vsac_util_get_program_details_CMS_Hybrid.yml
|
239
|
+
- test/fixtures/vcr_cassettes/vsac_util_get_program_details_CMS_eCQM.yml
|
240
|
+
- test/fixtures/vcr_cassettes/vsac_util_get_program_details_HL7_C-CDA.yml
|
241
|
+
- test/fixtures/vcr_cassettes/vsac_util_get_program_details_invalid.yml
|
242
|
+
- test/fixtures/vcr_cassettes/vsac_util_get_programs.yml
|
243
|
+
- test/fixtures/vcr_cassettes/vsac_vs_include_draft_no_profile.yml
|
244
|
+
- test/fixtures/vcr_cassettes/vsac_vs_include_draft_with_profile.yml
|
245
|
+
- test/fixtures/vcr_cassettes/vsac_vs_no_options.yml
|
246
|
+
- test/fixtures/vcr_cassettes/vsac_vs_not_found.yml
|
247
|
+
- test/fixtures/vcr_cassettes/vsac_vs_release.yml
|
248
|
+
- test/fixtures/vcr_cassettes/vsac_vs_version.yml
|
226
249
|
- test/fixtures/vs_loading/DocofMeds_v5_1_Artifacts.zip
|
227
250
|
- test/fixtures/vs_loading/DocofMeds_v5_1_Artifacts_Version.zip
|
228
251
|
- test/fixtures/vs_loading/DocofMeds_v5_1_Artifacts_With_Profiles.zip
|
@@ -235,6 +258,9 @@ files:
|
|
235
258
|
- test/unit/mongo_hash_key_wrapper_test.rb
|
236
259
|
- test/unit/storing_mat_export_package_test.rb
|
237
260
|
- test/unit/value_set_loading_test.rb
|
261
|
+
- test/unit/vsac_api_auth_test.rb
|
262
|
+
- test/unit/vsac_api_test.rb
|
263
|
+
- test/unit/vsac_api_util_test.rb
|
238
264
|
- test/vcr_setup.rb
|
239
265
|
homepage: http://github.com/projecttacoma/bonnie_bundler
|
240
266
|
licenses:
|
@@ -256,7 +282,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
256
282
|
version: '0'
|
257
283
|
requirements: []
|
258
284
|
rubyforge_project:
|
259
|
-
rubygems_version: 2.6.
|
285
|
+
rubygems_version: 2.6.12
|
260
286
|
signing_key:
|
261
287
|
specification_version: 4
|
262
288
|
summary: A Gem for creating and managing bonnie bundles
|