onc_certification_g10_test_kit 3.0.1 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/inferno/terminology/expected_manifest.yml +36 -693
- data/lib/inferno/terminology/fhir_package_manager.rb +16 -14
- data/lib/inferno/terminology/loader.rb +24 -2
- data/lib/inferno/terminology/tasks/download_umls.rb +2 -1
- data/lib/inferno/terminology/tasks/expand_value_set_to_file.rb +1 -1
- data/lib/inferno/terminology/tasks/run_umls_jar.rb +2 -1
- data/lib/inferno/terminology/value_set.rb +58 -56
- data/lib/onc_certification_g10_test_kit/base_token_refresh_group.rb +2 -0
- data/lib/onc_certification_g10_test_kit/bulk_data_group_export_stu1.rb +2 -0
- data/lib/onc_certification_g10_test_kit/bulk_data_group_export_stu2.rb +1 -1
- data/lib/onc_certification_g10_test_kit/bulk_data_group_export_validation.rb +7 -4
- data/lib/onc_certification_g10_test_kit/bulk_export_validation_tester.rb +2 -11
- data/lib/onc_certification_g10_test_kit/configuration_checker.rb +22 -0
- data/lib/onc_certification_g10_test_kit/export_kick_off_performer.rb +3 -2
- data/lib/onc_certification_g10_test_kit/g10_options.rb +46 -0
- data/lib/onc_certification_g10_test_kit/incorrectly_permitted_tls_versions_messages_setup_test.rb +34 -0
- data/lib/onc_certification_g10_test_kit/limited_scope_grant_test.rb +3 -1
- data/lib/onc_certification_g10_test_kit/multi_patient_api_stu1.rb +11 -0
- data/lib/onc_certification_g10_test_kit/multi_patient_api_stu2.rb +10 -0
- data/lib/onc_certification_g10_test_kit/onc_program_procedure.yml +1502 -658
- data/lib/onc_certification_g10_test_kit/profile_selector.rb +34 -24
- data/lib/onc_certification_g10_test_kit/resource_access_test.rb +1 -2
- data/lib/onc_certification_g10_test_kit/restricted_resource_type_access_group.rb +2 -2
- data/lib/onc_certification_g10_test_kit/short_id_manager.rb +46 -0
- data/lib/onc_certification_g10_test_kit/short_id_map.yml +1536 -0
- data/lib/onc_certification_g10_test_kit/single_patient_api_group.rb +7 -0
- data/lib/onc_certification_g10_test_kit/single_patient_us_core_4_api_group.rb +7 -0
- data/lib/onc_certification_g10_test_kit/single_patient_us_core_5_api_group.rb +9 -2
- data/lib/onc_certification_g10_test_kit/smart_app_launch_invalid_aud_group.rb +2 -2
- data/lib/onc_certification_g10_test_kit/smart_ehr_practitioner_app_group.rb +61 -6
- data/lib/onc_certification_g10_test_kit/smart_invalid_token_refresh_test.rb +37 -0
- data/lib/onc_certification_g10_test_kit/smart_limited_app_group.rb +3 -2
- data/lib/onc_certification_g10_test_kit/smart_scopes_test.rb +4 -2
- data/lib/onc_certification_g10_test_kit/smart_standalone_patient_app_group.rb +60 -4
- data/lib/onc_certification_g10_test_kit/unrestricted_resource_type_access_group.rb +7 -4
- data/lib/onc_certification_g10_test_kit/version.rb +1 -1
- data/lib/onc_certification_g10_test_kit/visual_inspection_and_attestations_group.rb +88 -2
- data/lib/onc_certification_g10_test_kit/well_known_capabilities_test.rb +4 -2
- data/lib/onc_certification_g10_test_kit.rb +25 -20
- metadata +15 -10
@@ -11,28 +11,30 @@ module Inferno
|
|
11
11
|
class << self
|
12
12
|
REGISTRY_SERVER_URL = 'https://packages.fhir.org'.freeze
|
13
13
|
REQUIRED_VSAC_VALUE_SET_URLS = [
|
14
|
-
'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1186.8',
|
15
|
-
'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1099.30',
|
16
|
-
'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1010.6',
|
17
|
-
'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1010.4',
|
18
|
-
'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.11.20.9.38',
|
19
|
-
'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.1066',
|
20
|
-
'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.1.11.10267',
|
21
|
-
'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1099.27',
|
22
|
-
'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.88.12.80.17',
|
23
|
-
'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1010.5',
|
24
|
-
'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1021.32',
|
25
14
|
'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836',
|
26
15
|
'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.1.11.14914',
|
27
16
|
'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837',
|
28
17
|
'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.877',
|
29
18
|
'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1',
|
30
|
-
'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1186.1',
|
31
|
-
'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.88.12.80.17',
|
32
19
|
'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1021.102',
|
33
20
|
'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1021.103',
|
34
|
-
'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1186.2',
|
35
21
|
'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.2074.1.1.3'
|
22
|
+
# The ValueSets below are needed when building all of the terminology
|
23
|
+
# rather than only the terminology for required bindings.
|
24
|
+
# 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1186.8',
|
25
|
+
# 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1099.30',
|
26
|
+
# 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1010.6',
|
27
|
+
# 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1010.4',
|
28
|
+
# 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.11.20.9.38',
|
29
|
+
# 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.1066',
|
30
|
+
# 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.1.11.10267',
|
31
|
+
# 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1099.27',
|
32
|
+
# 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.88.12.80.17',
|
33
|
+
# 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1010.5',
|
34
|
+
# 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1021.32',
|
35
|
+
# 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1186.1',
|
36
|
+
# 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.88.12.80.17',
|
37
|
+
# 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1186.2'
|
36
38
|
].freeze
|
37
39
|
|
38
40
|
# Get the FHIR Package from the registry.
|
@@ -57,7 +57,6 @@ module Inferno
|
|
57
57
|
code_systems << 'urn:oid:2.16.840.1.113883.6.13'
|
58
58
|
end
|
59
59
|
code_systems << 'urn:oid:2.16.840.1.113883.6.101' if code_systems.include? 'http://nucc.org/provider-taxonomy'
|
60
|
-
code_systems << 'urn:oid:2.16.840.1.113883.6.101' if code_systems.include? 'http://hl7.org/fhir/questionnaire-answers-status'
|
61
60
|
code_systems.uniq!
|
62
61
|
end
|
63
62
|
|
@@ -184,11 +183,34 @@ module Inferno
|
|
184
183
|
File.write(metadata_path, metadata.to_yaml)
|
185
184
|
end
|
186
185
|
|
186
|
+
def value_sets_to_load
|
187
|
+
@value_sets_to_load ||=
|
188
|
+
YAML.load_file(File.join('resources', 'value_sets.yml'))
|
189
|
+
end
|
190
|
+
|
191
|
+
# Run this method in an inferno console to update the list of value set
|
192
|
+
# bindings. This is not done automatically during the build because
|
193
|
+
# Inferno isn't loaded during the build process.
|
194
|
+
def save_new_value_set_list
|
195
|
+
all_metadata =
|
196
|
+
USCoreTestKit::USCoreV311::USCoreTestSuite.metadata +
|
197
|
+
USCoreTestKit::USCoreV400::USCoreTestSuite.metadata +
|
198
|
+
USCoreTestKit::USCoreV501::USCoreTestSuite.metadata
|
199
|
+
|
200
|
+
all_metadata =
|
201
|
+
all_metadata
|
202
|
+
.flat_map { |metadata| metadata.bindings.map { |bind| bind.merge(profile_url: metadata.profile_url) } }
|
203
|
+
.select { |metadata| metadata[:strength] == 'required' }
|
204
|
+
.uniq
|
205
|
+
|
206
|
+
File.write(File.join('resources', 'value_sets.yml'), all_metadata.to_yaml)
|
207
|
+
end
|
208
|
+
|
187
209
|
# NOTE: resources/value_sets.yml controls which value sets get loaded.
|
188
210
|
# It is currently manually generated from the US Core metadata.
|
189
211
|
def get_value_sets(strengths)
|
190
212
|
expected_vs_urls =
|
191
|
-
|
213
|
+
value_sets_to_load
|
192
214
|
.select { |vs| strengths.include? vs[:strength] }
|
193
215
|
.map! { |vs| vs[:system] }
|
194
216
|
.compact
|
@@ -11,7 +11,8 @@ module Inferno
|
|
11
11
|
UMLS_FILE_URLS = {
|
12
12
|
'2019' => 'https://download.nlm.nih.gov/umls/kss/2019AB/umls-2019AB-full.zip',
|
13
13
|
'2020' => 'https://download.nlm.nih.gov/umls/kss/2020AB/umls-2020AB-full.zip',
|
14
|
-
'2021' => 'https://download.nlm.nih.gov/umls/kss/2021AA/umls-2021AA-full.zip'
|
14
|
+
'2021' => 'https://download.nlm.nih.gov/umls/kss/2021AA/umls-2021AA-full.zip',
|
15
|
+
'2022' => 'https://download.nlm.nih.gov/umls/kss/2022AA/umls-2022AA-full.zip'
|
15
16
|
}.freeze
|
16
17
|
TICKET_GRANTING_TICKET_URL = 'https://utslogin.nlm.nih.gov/cas/v1/api-key'.freeze
|
17
18
|
|
@@ -16,7 +16,7 @@ module Inferno
|
|
16
16
|
# Before writing the JSON to a file at the end
|
17
17
|
end_vs = nil if type == 'json'
|
18
18
|
|
19
|
-
%w[
|
19
|
+
%w[2022].each do |version|
|
20
20
|
Loader.register_umls_db File.join(TEMP_DIR, version, 'umls.db')
|
21
21
|
Loader.load_value_sets_from_directory(PACKAGE_DIR, true)
|
22
22
|
vs = Repositories::ValueSets.new.find(value_set_url)
|
@@ -32,9 +32,9 @@ module Inferno
|
|
32
32
|
|
33
33
|
# UMLS Vocabulary: https://www.nlm.nih.gov/research/umls/sourcereleasedocs/index.html
|
34
34
|
SAB = {
|
35
|
-
'http://
|
36
|
-
abbreviation: '
|
37
|
-
name: '
|
35
|
+
'http://unitsofmeasure.org' => {
|
36
|
+
abbreviation: 'NCI_UCUM',
|
37
|
+
name: 'Unified Code for Units of Measure (UCUM)'
|
38
38
|
}.freeze,
|
39
39
|
'http://loinc.org' => {
|
40
40
|
abbreviation: 'LNC',
|
@@ -43,59 +43,61 @@ module Inferno
|
|
43
43
|
'http://snomed.info/sct' => {
|
44
44
|
abbreviation: 'SNOMEDCT_US',
|
45
45
|
name: 'Systematized Nomenclature of Medicine-Clinical Terms (SNOMED CT), US Edition'
|
46
|
-
}.freeze
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
'
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
'
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
'
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
'
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
'
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
'
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
'
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
'
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
'
|
96
|
-
|
97
|
-
|
98
|
-
|
46
|
+
}.freeze
|
47
|
+
# The systems below are needed if building all terminology rather than
|
48
|
+
# only the required bindings.
|
49
|
+
# 'http://www.nlm.nih.gov/research/umls/rxnorm' => {
|
50
|
+
# abbreviation: 'RXNORM',
|
51
|
+
# name: 'RxNorm Vocabulary'
|
52
|
+
# }.freeze,
|
53
|
+
# 'http://www.cms.gov/Medicare/Coding/ICD10' => {
|
54
|
+
# abbreviation: 'ICD10PCS',
|
55
|
+
# name: 'ICD-10 Procedure Coding System (ICD-10-PCS)'
|
56
|
+
# }.freeze,
|
57
|
+
# 'http://hl7.org/fhir/sid/cvx' => {
|
58
|
+
# abbreviation: 'CVX',
|
59
|
+
# name: 'Vaccines Administered (CVX)'
|
60
|
+
# }.freeze,
|
61
|
+
# 'http://hl7.org/fhir/sid/icd-10-cm' => {
|
62
|
+
# abbreviation: 'ICD10CM',
|
63
|
+
# name: 'International Classification of Diseases, Tenth Revision, Clinical Modification (ICD-10-CM)'
|
64
|
+
# }.freeze,
|
65
|
+
# 'http://hl7.org/fhir/sid/icd-9-cm' => {
|
66
|
+
# abbreviation: 'ICD9CM',
|
67
|
+
# name: 'International Classification of Diseases, Ninth Revision, Clinical Modification (ICD-9-CM)'
|
68
|
+
# }.freeze,
|
69
|
+
# 'urn:oid:2.16.840.1.113883.6.101' => {
|
70
|
+
# abbreviation: 'NUCCHCPT',
|
71
|
+
# name: 'National Uniform Claim Committee - Health Care Provider Taxonomy (NUCCHCPT)'
|
72
|
+
# },
|
73
|
+
# 'http://nucc.org/provider-taxonomy' => {
|
74
|
+
# abbreviation: 'NUCCHCPT',
|
75
|
+
# name: 'National Uniform Claim Committee - Health Care Provider Taxonomy (NUCCHCPT)'
|
76
|
+
# }.freeze,
|
77
|
+
# 'http://www.ama-assn.org/go/cpt' => {
|
78
|
+
# abbreviation: 'CPT',
|
79
|
+
# name: 'Current Procedural Terminology (CPT)'
|
80
|
+
# }.freeze,
|
81
|
+
# 'http://www.cms.gov/Medicare/Coding/HCPCSReleaseCodeSets' => {
|
82
|
+
# abbreviation: 'HCPCS',
|
83
|
+
# name: 'Healthcare Common Procedure Coding System (HCPCS)'
|
84
|
+
# }.freeze,
|
85
|
+
# 'urn:oid:2.16.840.1.113883.6.285' => {
|
86
|
+
# abbreviation: 'HCPCS',
|
87
|
+
# name: 'Healthcare Common Procedure Coding System (HCPCS)'
|
88
|
+
# }.freeze,
|
89
|
+
# 'urn:oid:2.16.840.1.113883.6.13' => {
|
90
|
+
# abbreviation: 'CDT',
|
91
|
+
# name: 'Code on Dental Procedures and Nomenclature (CDT)'
|
92
|
+
# }.freeze,
|
93
|
+
# 'http://ada.org/cdt' => {
|
94
|
+
# abbreviation: 'CDT',
|
95
|
+
# name: 'Code on Dental Procedures and Nomenclature (CDT)'
|
96
|
+
# },
|
97
|
+
# 'http://www.ada.org/cdt' => {
|
98
|
+
# abbreviation: 'CDT',
|
99
|
+
# name: 'Code on Dental Procedures and Nomenclature (CDT)'
|
100
|
+
# }
|
99
101
|
}.freeze
|
100
102
|
|
101
103
|
CODE_SYS = {
|
@@ -221,6 +221,7 @@ module ONCCertificationG10TestKit
|
|
221
221
|
assert request.response_header('content-type')&.value&.include?('application/json'),
|
222
222
|
'Content-Type not application/json'
|
223
223
|
|
224
|
+
assert_valid_json(response[:body])
|
224
225
|
response_body = JSON.parse(response[:body])
|
225
226
|
|
226
227
|
['transactionTime', 'request', 'requiresAccessToken', 'output', 'error'].each do |key|
|
@@ -255,6 +256,7 @@ module ONCCertificationG10TestKit
|
|
255
256
|
run do
|
256
257
|
assert status_response.present?, 'Bulk Data Server status response not found'
|
257
258
|
|
259
|
+
assert_valid_json(status_response)
|
258
260
|
status_output = JSON.parse(status_response)['output']
|
259
261
|
assert status_output, 'Bulk Data Server status response does not contain output'
|
260
262
|
|
@@ -32,7 +32,7 @@ module ONCCertificationG10TestKit
|
|
32
32
|
|
33
33
|
run do
|
34
34
|
['application/fhir+ndjson', 'application/ndjson', 'ndjson'].each do |format|
|
35
|
-
perform_export_kick_off_request(params:
|
35
|
+
perform_export_kick_off_request(params: { _outputFormat: format })
|
36
36
|
assert_response_status(202)
|
37
37
|
|
38
38
|
delete_export_kick_off_request
|
@@ -578,7 +578,7 @@ module ONCCertificationG10TestKit
|
|
578
578
|
for missing data elements and value set verification.
|
579
579
|
DESCRIPTION
|
580
580
|
|
581
|
-
required_suite_options
|
581
|
+
required_suite_options G10Options::US_CORE_5_REQUIREMENT
|
582
582
|
|
583
583
|
include BulkExportValidationTester
|
584
584
|
|
@@ -598,7 +598,8 @@ module ONCCertificationG10TestKit
|
|
598
598
|
conform to the US Core RelatedPerson profile. This includes checking
|
599
599
|
for missing data elements and value set verification.
|
600
600
|
DESCRIPTION
|
601
|
-
|
601
|
+
|
602
|
+
required_suite_options G10Options::US_CORE_5_REQUIREMENT
|
602
603
|
|
603
604
|
include BulkExportValidationTester
|
604
605
|
|
@@ -620,7 +621,8 @@ module ONCCertificationG10TestKit
|
|
620
621
|
data elements and value set verification. This test is omitted if bulk
|
621
622
|
data export does not return any QuestionnaireResponse resources.
|
622
623
|
DESCRIPTION
|
623
|
-
|
624
|
+
|
625
|
+
required_suite_options G10Options::US_CORE_5_REQUIREMENT
|
624
626
|
|
625
627
|
include BulkExportValidationTester
|
626
628
|
|
@@ -642,7 +644,8 @@ module ONCCertificationG10TestKit
|
|
642
644
|
data elements and value set verification. This test is omitted if bulk
|
643
645
|
data export does not return any resources.
|
644
646
|
DESCRIPTION
|
645
|
-
|
647
|
+
|
648
|
+
required_suite_options G10Options::US_CORE_5_REQUIREMENT
|
646
649
|
|
647
650
|
include BulkExportValidationTester
|
648
651
|
|
@@ -4,6 +4,7 @@ module ONCCertificationG10TestKit
|
|
4
4
|
module BulkExportValidationTester
|
5
5
|
include USCoreTestKit::MustSupportTest
|
6
6
|
include ProfileSelector
|
7
|
+
include G10Options
|
7
8
|
|
8
9
|
attr_reader :metadata
|
9
10
|
|
@@ -11,17 +12,6 @@ module ONCCertificationG10TestKit
|
|
11
12
|
MIN_RESOURCE_COUNT = 2
|
12
13
|
OMIT_KLASS = ['Medication', 'Location', 'QuestionnaireResponse', 'PractitionerRole'].freeze
|
13
14
|
|
14
|
-
def versioned_us_core_module
|
15
|
-
case suite_options[:us_core_version]
|
16
|
-
when 'us_core_5'
|
17
|
-
USCoreTestKit::USCoreV501
|
18
|
-
when 'us_core_4'
|
19
|
-
USCoreTestKit::USCoreV400
|
20
|
-
else
|
21
|
-
USCoreTestKit::USCoreV311
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
15
|
def metadata_list
|
26
16
|
@metadata_list ||=
|
27
17
|
versioned_us_core_module::USCoreTestSuite
|
@@ -197,6 +187,7 @@ module ONCCertificationG10TestKit
|
|
197
187
|
skip_if (requires_access_token == 'true' && bearer_token.blank?),
|
198
188
|
'Could not verify this functionality when Bearer Token is required and not provided'
|
199
189
|
|
190
|
+
assert_valid_json(status_output)
|
200
191
|
file_list = JSON.parse(status_output).select { |file| file['type'] == resource_type }
|
201
192
|
if file_list.empty?
|
202
193
|
message = "No #{resource_type} resource file item returned by server."
|
@@ -42,6 +42,19 @@ module ONCCertificationG10TestKit
|
|
42
42
|
}]
|
43
43
|
end
|
44
44
|
|
45
|
+
def code_system_version_messages
|
46
|
+
path = File.join('resources', 'terminology', 'validators', 'bloom', 'metadata.yml')
|
47
|
+
return '' unless File.exist? path
|
48
|
+
|
49
|
+
cs_metadata = YAML.load_file(path)
|
50
|
+
message = "Terminology was generated based on the following code system versions:\n"
|
51
|
+
cs_metadata.each do |_url, metadata|
|
52
|
+
message += "* #{metadata[:name]}: version #{metadata[:versions].join(', ')}\n"
|
53
|
+
end
|
54
|
+
|
55
|
+
message
|
56
|
+
end
|
57
|
+
|
45
58
|
def terminology_messages # rubocop:disable Metrics/CyclomaticComplexity
|
46
59
|
success_messages = []
|
47
60
|
warning_messages = []
|
@@ -64,6 +77,15 @@ module ONCCertificationG10TestKit
|
|
64
77
|
end
|
65
78
|
end
|
66
79
|
|
80
|
+
code_system_messages = code_system_version_messages
|
81
|
+
|
82
|
+
if code_system_version_messages.present?
|
83
|
+
messages << {
|
84
|
+
type: 'info',
|
85
|
+
message: code_system_messages
|
86
|
+
}
|
87
|
+
end
|
88
|
+
|
67
89
|
if success_messages.present?
|
68
90
|
messages << {
|
69
91
|
type: 'info',
|
@@ -1,13 +1,14 @@
|
|
1
1
|
module ONCCertificationG10TestKit
|
2
2
|
module ExportKickOffPerformer
|
3
|
-
def perform_export_kick_off_request(use_token: true, params:
|
3
|
+
def perform_export_kick_off_request(use_token: true, params: {})
|
4
4
|
skip_if use_token && bearer_token.blank?, 'Could not verify this functionality when bearer token is not set'
|
5
5
|
|
6
6
|
headers = { accept: 'application/fhir+json', prefer: 'respond-async' }
|
7
7
|
headers.merge!({ authorization: "Bearer #{bearer_token}" }) if use_token
|
8
8
|
|
9
9
|
url = "Group/#{group_id}/$export"
|
10
|
-
|
10
|
+
param_str = params.map { |k, v| URI.encode_www_form(k => v) }.join('&')
|
11
|
+
url.concat("?#{param_str}") unless param_str.empty?
|
11
12
|
get(url, client: :bulk_server, name: :export, headers: headers)
|
12
13
|
end
|
13
14
|
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module ONCCertificationG10TestKit
|
2
|
+
module G10Options
|
3
|
+
US_CORE_3 = 'us_core_3'.freeze
|
4
|
+
US_CORE_4 = 'us_core_4'.freeze
|
5
|
+
US_CORE_5 = 'us_core_5'.freeze
|
6
|
+
|
7
|
+
BULK_DATA_1 = 'multi_patient_api_stu1'.freeze
|
8
|
+
BULK_DATA_2 = 'multi_patient_api_stu2'.freeze
|
9
|
+
|
10
|
+
SMART_1 = 'smart_app_launch_1'.freeze
|
11
|
+
SMART_2 = 'smart_app_launch_2'.freeze
|
12
|
+
|
13
|
+
US_CORE_3_REQUIREMENT = { us_core_version: US_CORE_3 }.freeze
|
14
|
+
US_CORE_4_REQUIREMENT = { us_core_version: US_CORE_4 }.freeze
|
15
|
+
US_CORE_5_REQUIREMENT = { us_core_version: US_CORE_5 }.freeze
|
16
|
+
|
17
|
+
BULK_DATA_1_REQUIREMENT = { multi_patient_version: BULK_DATA_1 }.freeze
|
18
|
+
BULK_DATA_2_REQUIREMENT = { multi_patient_version: BULK_DATA_2 }.freeze
|
19
|
+
|
20
|
+
SMART_1_REQUIREMENT = { smart_app_launch_version: SMART_1 }.freeze
|
21
|
+
SMART_2_REQUIREMENT = { smart_app_launch_version: SMART_2 }.freeze
|
22
|
+
|
23
|
+
def us_core_version
|
24
|
+
suite_options[:us_core_version]
|
25
|
+
end
|
26
|
+
|
27
|
+
def using_us_core_3?
|
28
|
+
us_core_version == US_CORE_3
|
29
|
+
end
|
30
|
+
|
31
|
+
def using_us_core_5?
|
32
|
+
us_core_version == US_CORE_5
|
33
|
+
end
|
34
|
+
|
35
|
+
def versioned_us_core_module
|
36
|
+
case us_core_version
|
37
|
+
when US_CORE_5
|
38
|
+
USCoreTestKit::USCoreV501
|
39
|
+
when US_CORE_4
|
40
|
+
USCoreTestKit::USCoreV400
|
41
|
+
else
|
42
|
+
USCoreTestKit::USCoreV311
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
data/lib/onc_certification_g10_test_kit/incorrectly_permitted_tls_versions_messages_setup_test.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
module ONCCertificationG10TestKit
|
2
|
+
class IncorrectlyPermittedTLSVersionsMessagesSetupTest < Inferno::Test
|
3
|
+
id :g10_incorrectly_permitted_tls_versions_messages_setup
|
4
|
+
title 'Handle TLS Warning Messages'
|
5
|
+
|
6
|
+
input :incorrectly_permitted_tls_versions_messages
|
7
|
+
output :unique_incorrectly_permitted_tls_versions_messages,
|
8
|
+
:tls_documentation_required
|
9
|
+
|
10
|
+
run do
|
11
|
+
pass_if incorrectly_permitted_tls_versions_messages.blank?
|
12
|
+
|
13
|
+
warning do
|
14
|
+
new_warning_messages = incorrectly_permitted_tls_versions_messages&.split("\n")
|
15
|
+
|
16
|
+
pass_if new_warning_messages.blank?
|
17
|
+
|
18
|
+
raw_previous_warning_messages =
|
19
|
+
Inferno::Repositories::SessionData.new.load(
|
20
|
+
test_session_id: test_session_id,
|
21
|
+
name: 'unique_incorrectly_permitted_tls_versions_messages'
|
22
|
+
)
|
23
|
+
|
24
|
+
previous_warning_messages =
|
25
|
+
raw_previous_warning_messages.blank? ? [] : raw_previous_warning_messages.split("\n")
|
26
|
+
|
27
|
+
warning_messages = (previous_warning_messages + new_warning_messages).uniq
|
28
|
+
|
29
|
+
output unique_incorrectly_permitted_tls_versions_messages: warning_messages.join("\n"),
|
30
|
+
tls_documentation_required: 'true'
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
module ONCCertificationG10TestKit
|
2
2
|
class LimitedScopeGrantTest < Inferno::Test
|
3
|
+
include G10Options
|
4
|
+
|
3
5
|
title 'OAuth token exchange response grants scope that is limited to those selected by user'
|
4
6
|
description %(
|
5
7
|
The ONC certification criteria requires that patients are capable of
|
@@ -33,7 +35,7 @@ module ONCCertificationG10TestKit
|
|
33
35
|
(POSSIBLE_RESOURCES + ['Encounter', 'ServiceRequest']).freeze
|
34
36
|
|
35
37
|
def possible_resources
|
36
|
-
return V5_POSSIBLE_RESOURCES if
|
38
|
+
return V5_POSSIBLE_RESOURCES if using_us_core_5?
|
37
39
|
|
38
40
|
POSSIBLE_RESOURCES
|
39
41
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require_relative 'bulk_data_authorization'
|
2
2
|
require_relative 'bulk_data_group_export_stu1'
|
3
3
|
require_relative 'bulk_data_group_export_validation'
|
4
|
+
require_relative 'incorrectly_permitted_tls_versions_messages_setup_test'
|
4
5
|
|
5
6
|
module ONCCertificationG10TestKit
|
6
7
|
class MultiPatientAPIGroupSTU1 < Inferno::TestGroup
|
@@ -62,7 +63,17 @@ module ONCCertificationG10TestKit
|
|
62
63
|
This test returns an access token.
|
63
64
|
DESCRIPTION
|
64
65
|
|
66
|
+
test from: :g10_incorrectly_permitted_tls_versions_messages_setup,
|
67
|
+
id: :g10_bulk_auth_tls_messages_setup
|
68
|
+
|
65
69
|
group from: :bulk_data_group_export
|
70
|
+
|
71
|
+
test from: :g10_incorrectly_permitted_tls_versions_messages_setup,
|
72
|
+
id: :g10_bulk_group_export_tls_messages_setup
|
73
|
+
|
66
74
|
group from: :bulk_data_group_export_validation
|
75
|
+
|
76
|
+
test from: :g10_incorrectly_permitted_tls_versions_messages_setup,
|
77
|
+
id: :g10_bulk_group_export_validation_messages_setup
|
67
78
|
end
|
68
79
|
end
|
@@ -62,7 +62,17 @@ module ONCCertificationG10TestKit
|
|
62
62
|
This test returns an access token.
|
63
63
|
DESCRIPTION
|
64
64
|
|
65
|
+
test from: :g10_incorrectly_permitted_tls_versions_messages_setup,
|
66
|
+
id: :g10_bulk_auth_tls_messages_setup
|
67
|
+
|
65
68
|
group from: :bulk_data_group_export_stu2
|
69
|
+
|
70
|
+
test from: :g10_incorrectly_permitted_tls_versions_messages_setup,
|
71
|
+
id: :g10_bulk_group_export_tls_messages_setup
|
72
|
+
|
66
73
|
group from: :bulk_data_group_export_validation
|
74
|
+
|
75
|
+
test from: :g10_incorrectly_permitted_tls_versions_messages_setup,
|
76
|
+
id: :g10_bulk_group_export_validation_messages_setup
|
67
77
|
end
|
68
78
|
end
|