onc_certification_g10_test_kit 3.1.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/lib/inferno/terminology/expected_manifest.yml +36 -693
  3. data/lib/inferno/terminology/fhir_package_manager.rb +16 -14
  4. data/lib/inferno/terminology/loader.rb +25 -3
  5. data/lib/inferno/terminology/tasks/create_value_set_validators.rb +3 -3
  6. data/lib/inferno/terminology/tasks/download_umls.rb +3 -2
  7. data/lib/inferno/terminology/tasks/expand_value_set_to_file.rb +1 -1
  8. data/lib/inferno/terminology/tasks/run_umls_jar.rb +2 -1
  9. data/lib/inferno/terminology/tasks/validate_code.rb +1 -1
  10. data/lib/inferno/terminology/terminology_validation.rb +1 -1
  11. data/lib/inferno/terminology/validator.rb +9 -9
  12. data/lib/inferno/terminology/value_set.rb +65 -63
  13. data/lib/onc_certification_g10_test_kit/authorization_request_builder.rb +2 -2
  14. data/lib/onc_certification_g10_test_kit/bulk_data_authorization.rb +4 -4
  15. data/lib/onc_certification_g10_test_kit/bulk_data_group_export_stu1.rb +3 -1
  16. data/lib/onc_certification_g10_test_kit/bulk_data_group_export_validation.rb +7 -4
  17. data/lib/onc_certification_g10_test_kit/bulk_export_validation_tester.rb +5 -14
  18. data/lib/onc_certification_g10_test_kit/configuration_checker.rb +23 -1
  19. data/lib/onc_certification_g10_test_kit/export_kick_off_performer.rb +2 -2
  20. data/lib/onc_certification_g10_test_kit/g10_options.rb +46 -0
  21. data/lib/onc_certification_g10_test_kit/incorrectly_permitted_tls_versions_messages_setup_test.rb +34 -0
  22. data/lib/onc_certification_g10_test_kit/limited_scope_grant_test.rb +3 -1
  23. data/lib/onc_certification_g10_test_kit/multi_patient_api_stu1.rb +11 -0
  24. data/lib/onc_certification_g10_test_kit/multi_patient_api_stu2.rb +10 -0
  25. data/lib/onc_certification_g10_test_kit/onc_program_procedure.yml +1 -0
  26. data/lib/onc_certification_g10_test_kit/patient_scope_test.rb +25 -0
  27. data/lib/onc_certification_g10_test_kit/profile_selector.rb +33 -25
  28. data/lib/onc_certification_g10_test_kit/resource_access_test.rb +1 -2
  29. data/lib/onc_certification_g10_test_kit/restricted_resource_type_access_group.rb +2 -2
  30. data/lib/onc_certification_g10_test_kit/short_id_manager.rb +46 -0
  31. data/lib/onc_certification_g10_test_kit/short_id_map.yml +1538 -0
  32. data/lib/onc_certification_g10_test_kit/single_patient_api_group.rb +4 -0
  33. data/lib/onc_certification_g10_test_kit/single_patient_us_core_4_api_group.rb +4 -0
  34. data/lib/onc_certification_g10_test_kit/single_patient_us_core_5_api_group.rb +4 -0
  35. data/lib/onc_certification_g10_test_kit/smart_app_launch_invalid_aud_group.rb +2 -2
  36. data/lib/onc_certification_g10_test_kit/smart_ehr_patient_launch_group.rb +27 -4
  37. data/lib/onc_certification_g10_test_kit/smart_ehr_patient_launch_group_stu2.rb +27 -4
  38. data/lib/onc_certification_g10_test_kit/smart_ehr_practitioner_app_group.rb +58 -7
  39. data/lib/onc_certification_g10_test_kit/smart_invalid_pkce_group.rb +1 -1
  40. data/lib/onc_certification_g10_test_kit/smart_invalid_token_group.rb +1 -1
  41. data/lib/onc_certification_g10_test_kit/smart_invalid_token_group_stu2.rb +1 -1
  42. data/lib/onc_certification_g10_test_kit/smart_limited_app_group.rb +3 -2
  43. data/lib/onc_certification_g10_test_kit/smart_scopes_test.rb +4 -2
  44. data/lib/onc_certification_g10_test_kit/smart_standalone_patient_app_group.rb +57 -6
  45. data/lib/onc_certification_g10_test_kit/tasks/test_procedure.rb +1 -1
  46. data/lib/onc_certification_g10_test_kit/terminology_binding_validator.rb +1 -1
  47. data/lib/onc_certification_g10_test_kit/unrestricted_resource_type_access_group.rb +7 -4
  48. data/lib/onc_certification_g10_test_kit/version.rb +1 -1
  49. data/lib/onc_certification_g10_test_kit/visual_inspection_and_attestations_group.rb +52 -2
  50. data/lib/onc_certification_g10_test_kit/well_known_capabilities_test.rb +3 -1
  51. data/lib/onc_certification_g10_test_kit.rb +41 -23
  52. metadata +22 -17
@@ -1,3 +1,5 @@
1
+ require_relative 'incorrectly_permitted_tls_versions_messages_setup_test'
2
+
1
3
  module ONCCertificationG10TestKit
2
4
  class SinglePatientAPIGroup < Inferno::TestGroup
3
5
  id :g10_single_patient_api
@@ -92,5 +94,7 @@ module ONCCertificationG10TestKit
92
94
 
93
95
  group(from: id, exclude_optional: true, config: group_config)
94
96
  end
97
+
98
+ test from: :g10_incorrectly_permitted_tls_versions_messages_setup
95
99
  end
96
100
  end
@@ -1,3 +1,5 @@
1
+ require_relative 'incorrectly_permitted_tls_versions_messages_setup_test'
2
+
1
3
  module ONCCertificationG10TestKit
2
4
  class SinglePatientUSCore4APIGroup < Inferno::TestGroup
3
5
  id :g10_single_patient_us_core_4_api
@@ -92,5 +94,7 @@ module ONCCertificationG10TestKit
92
94
 
93
95
  group(from: id, exclude_optional: true, config: group_config)
94
96
  end
97
+
98
+ test from: :g10_incorrectly_permitted_tls_versions_messages_setup
95
99
  end
96
100
  end
@@ -1,3 +1,5 @@
1
+ require_relative 'incorrectly_permitted_tls_versions_messages_setup_test'
2
+
1
3
  module ONCCertificationG10TestKit
2
4
  class SinglePatientUSCore5APIGroup < Inferno::TestGroup
3
5
  id :g10_single_patient_us_core_5_api
@@ -92,5 +94,7 @@ module ONCCertificationG10TestKit
92
94
 
93
95
  group(from: id, exclude_optional: true, config: group_config)
94
96
  end
97
+
98
+ test from: :g10_incorrectly_permitted_tls_versions_messages_setup
95
99
  end
96
100
  end
@@ -91,7 +91,7 @@ module ONCCertificationG10TestKit
91
91
  :smart_authorization_url
92
92
 
93
93
  test from: :smart_app_redirect do
94
- required_suite_options smart_app_launch_version: 'smart_app_launch_1'
94
+ required_suite_options G10Options::SMART_1_REQUIREMENT
95
95
 
96
96
  input :client_secret,
97
97
  name: :standalone_client_secret,
@@ -118,7 +118,7 @@ module ONCCertificationG10TestKit
118
118
  end
119
119
 
120
120
  test from: :smart_app_redirect_stu2 do
121
- required_suite_options smart_app_launch_version: 'smart_app_launch_2'
121
+ required_suite_options G10Options::SMART_2_REQUIREMENT
122
122
 
123
123
  config(
124
124
  inputs: {
@@ -1,17 +1,29 @@
1
+ require_relative 'patient_scope_test'
2
+
1
3
  module ONCCertificationG10TestKit
2
4
  class SMARTEHRPatientLaunchGroup < SMARTAppLaunch::EHRLaunchGroup
3
5
  title 'EHR Launch with Patient Scopes'
4
6
  description %(
5
7
  # Background
8
+ Systems are required to support the `permission-patient` capability as
9
+ part of the [Clinician Access for EHR Launch Capability
10
+ Set.](http://hl7.org/fhir/smart-app-launch/1.0.0/conformance/index.html#clinician-access-for-ehr-launch)
11
+
12
+ Additionally, if an application launched from an EHR requests and is
13
+ granted a clinical scope restricted to a single patient, the EHR SHALL
14
+ establish a patient in context.
6
15
 
7
- If an application launched from an EHR requests and is granted a clinical
8
- scope restricted to a single patient, the EHR SHALL establish a patient in
9
- context.
16
+ Register Inferno as an EHR-launched application using patient-level scopes
17
+ and the following URIs:
18
+
19
+ * Launch URI: `#{SMARTAppLaunch::AppLaunchTest.config.options[:launch_uri]}`
20
+ * Redirect URI: `#{SMARTAppLaunch::AppRedirectTest.config.options[:redirect_uri]}`
10
21
 
11
22
  # Test Methodology
12
23
 
13
24
  Inferno will attempt an EHR Launch with a clinical scope restricted to a
14
- single patient and verify that a patient id is received.
25
+ single patient and verify that a patient-level scope is granted and a
26
+ patient id is received.
15
27
 
16
28
  For more information on the #{title}
17
29
 
@@ -43,6 +55,9 @@ module ONCCertificationG10TestKit
43
55
  launch: {
44
56
  name: :ehr_patient_launch
45
57
  },
58
+ received_scopes: {
59
+ name: :ehr_patient_received_scopes
60
+ },
46
61
  smart_credentials: {
47
62
  name: :ehr_patient_smart_credentials
48
63
  },
@@ -67,6 +82,7 @@ module ONCCertificationG10TestKit
67
82
  patient_id: { name: :ehr_patient_patient_id },
68
83
  encounter_id: { name: :ehr_patient_encounter_id },
69
84
  received_scopes: { name: :ehr_patient_received_scopes },
85
+ requested_scopes: { name: :ehr_patient_requested_scopes },
70
86
  intent: { name: :ehr_patient_intent },
71
87
  smart_credentials: { name: :ehr_patient_smart_credentials }
72
88
  },
@@ -89,5 +105,12 @@ module ONCCertificationG10TestKit
89
105
  smart_credentials: { name: :ehr_patient_smart_credentials }
90
106
  }
91
107
  }
108
+
109
+ test from: :g10_patient_scope,
110
+ config: {
111
+ options: {
112
+ scope_version: :v1
113
+ }
114
+ }
92
115
  end
93
116
  end
@@ -1,17 +1,29 @@
1
+ require_relative 'patient_scope_test'
2
+
1
3
  module ONCCertificationG10TestKit
2
4
  class SMARTEHRPatientLaunchGroupSTU2 < SMARTAppLaunch::EHRLaunchGroupSTU2
3
5
  title 'EHR Launch with Patient Scopes'
4
6
  description %(
5
7
  # Background
8
+ Systems are required to support the `permission-patient` capability as
9
+ part of the [Clinician Access for EHR Launch Capability
10
+ Set.](http://hl7.org/fhir/smart-app-launch/STU2/conformance.html#clinician-access-for-ehr-launch)
11
+
12
+ Additionally, if an application launched from an EHR requests and is
13
+ granted a clinical scope restricted to a single patient, the EHR SHALL
14
+ establish a patient in context.
6
15
 
7
- If an application launched from an EHR requests and is granted a clinical
8
- scope restricted to a single patient, the EHR SHALL establish a patient in
9
- context.
16
+ Register Inferno as an EHR-launched application using patient-level scopes
17
+ and the following URIs:
18
+
19
+ * Launch URI: `#{SMARTAppLaunch::AppLaunchTest.config.options[:launch_uri]}`
20
+ * Redirect URI: `#{SMARTAppLaunch::AppRedirectTest.config.options[:redirect_uri]}`
10
21
 
11
22
  # Test Methodology
12
23
 
13
24
  Inferno will attempt an EHR Launch with a clinical scope restricted to a
14
- single patient and verify that a patient id is received.
25
+ single patient and verify that a patient-level scope is granted and a
26
+ patient id is received.
15
27
 
16
28
  For more information on the #{title}
17
29
 
@@ -43,6 +55,9 @@ module ONCCertificationG10TestKit
43
55
  launch: {
44
56
  name: :ehr_patient_launch
45
57
  },
58
+ received_scopes: {
59
+ name: :ehr_patient_received_scopes
60
+ },
46
61
  smart_credentials: {
47
62
  name: :ehr_patient_smart_credentials
48
63
  },
@@ -67,6 +82,7 @@ module ONCCertificationG10TestKit
67
82
  patient_id: { name: :ehr_patient_patient_id },
68
83
  encounter_id: { name: :ehr_patient_encounter_id },
69
84
  received_scopes: { name: :ehr_patient_received_scopes },
85
+ requested_scopes: { name: :ehr_patient_requested_scopes },
70
86
  intent: { name: :ehr_patient_intent },
71
87
  smart_credentials: { name: :ehr_patient_smart_credentials }
72
88
  },
@@ -90,5 +106,12 @@ module ONCCertificationG10TestKit
90
106
  smart_credentials: { name: :ehr_patient_smart_credentials }
91
107
  }
92
108
  }
109
+
110
+ test from: :g10_patient_scope,
111
+ config: {
112
+ options: {
113
+ scope_version: :v2
114
+ }
115
+ }
93
116
  end
94
117
  end
@@ -60,7 +60,7 @@ module ONCCertificationG10TestKit
60
60
  input_order :url, :ehr_client_id, :ehr_client_secret
61
61
 
62
62
  group from: :smart_discovery do
63
- required_suite_options(smart_app_launch_version: 'smart_app_launch_1')
63
+ required_suite_options(G10Options::SMART_1_REQUIREMENT)
64
64
 
65
65
  test from: 'g10_smart_well_known_capabilities',
66
66
  config: {
@@ -80,7 +80,7 @@ module ONCCertificationG10TestKit
80
80
  end
81
81
 
82
82
  group from: :smart_discovery_stu2 do
83
- required_suite_options(smart_app_launch_version: 'smart_app_launch_2')
83
+ required_suite_options(G10Options::SMART_2_REQUIREMENT)
84
84
 
85
85
  test from: 'g10_smart_well_known_capabilities',
86
86
  config: {
@@ -95,7 +95,6 @@ module ONCCertificationG10TestKit
95
95
  'permission-offline',
96
96
  'permission-user',
97
97
  'authorize-post',
98
- 'permission-v1',
99
98
  'permission-v2'
100
99
  ]
101
100
  }
@@ -103,7 +102,7 @@ module ONCCertificationG10TestKit
103
102
  end
104
103
 
105
104
  group from: :smart_ehr_launch do
106
- required_suite_options(smart_app_launch_version: 'smart_app_launch_1')
105
+ required_suite_options(G10Options::SMART_1_REQUIREMENT)
107
106
 
108
107
  title 'EHR Launch With Practitioner Scope'
109
108
  input :client_secret,
@@ -173,7 +172,7 @@ module ONCCertificationG10TestKit
173
172
  access_token: { name: :ehr_access_token }
174
173
  }
175
174
  },
176
- required_suite_options: { us_core_version: 'us_core_5' }
175
+ required_suite_options: G10Options::US_CORE_5_REQUIREMENT
177
176
 
178
177
  test do
179
178
  title 'Launch context contains smart_style_url which links to valid JSON'
@@ -221,6 +220,22 @@ module ONCCertificationG10TestKit
221
220
  'Token response did not contain `need_patient_banner`'
222
221
  end
223
222
  end
223
+
224
+ tests[2].config(
225
+ outputs: {
226
+ incorrectly_permitted_tls_versions_messages: {
227
+ name: :auth_incorrectly_permitted_tls_versions_messages
228
+ }
229
+ }
230
+ )
231
+
232
+ tests[5].config(
233
+ outputs: {
234
+ incorrectly_permitted_tls_versions_messages: {
235
+ name: :token_incorrectly_permitted_tls_versions_messages
236
+ }
237
+ }
238
+ )
224
239
  end
225
240
 
226
241
  group from: :smart_ehr_launch_stu2,
@@ -240,7 +255,7 @@ module ONCCertificationG10TestKit
240
255
  }
241
256
  }
242
257
  } do
243
- required_suite_options(smart_app_launch_version: 'smart_app_launch_2')
258
+ required_suite_options(G10Options::SMART_2_REQUIREMENT)
244
259
 
245
260
  title 'EHR Launch With Practitioner Scope'
246
261
  input :client_secret,
@@ -309,7 +324,7 @@ module ONCCertificationG10TestKit
309
324
  access_token: { name: :ehr_access_token }
310
325
  }
311
326
  },
312
- required_suite_options: { us_core_version: 'us_core_5' }
327
+ required_suite_options: G10Options::US_CORE_5_REQUIREMENT
313
328
 
314
329
  test do
315
330
  title 'Launch context contains smart_style_url which links to valid JSON'
@@ -357,6 +372,22 @@ module ONCCertificationG10TestKit
357
372
  'Token response did not contain `need_patient_banner`'
358
373
  end
359
374
  end
375
+
376
+ tests[2].config(
377
+ outputs: {
378
+ incorrectly_permitted_tls_versions_messages: {
379
+ name: :auth_incorrectly_permitted_tls_versions_messages
380
+ }
381
+ }
382
+ )
383
+
384
+ tests[5].config(
385
+ outputs: {
386
+ incorrectly_permitted_tls_versions_messages: {
387
+ name: :token_incorrectly_permitted_tls_versions_messages
388
+ }
389
+ }
390
+ )
360
391
  end
361
392
 
362
393
  group from: :smart_openid_connect,
@@ -417,5 +448,25 @@ module ONCCertificationG10TestKit
417
448
  patient_id: ehr_patient_id
418
449
  end
419
450
  end
451
+
452
+ test from: :g10_incorrectly_permitted_tls_versions_messages_setup,
453
+ id: :g10_auth_incorrectly_permitted_tls_versions_messages_setup,
454
+ config: {
455
+ inputs: {
456
+ incorrectly_permitted_tls_versions_messages: {
457
+ name: :auth_incorrectly_permitted_tls_versions_messages
458
+ }
459
+ }
460
+ }
461
+
462
+ test from: :g10_incorrectly_permitted_tls_versions_messages_setup,
463
+ id: :g10_token_incorrectly_permitted_tls_versions_messages_setup,
464
+ config: {
465
+ inputs: {
466
+ incorrectly_permitted_tls_versions_messages: {
467
+ name: :token_incorrectly_permitted_tls_versions_messages
468
+ }
469
+ }
470
+ }
420
471
  end
421
472
  end
@@ -19,7 +19,7 @@ module ONCCertificationG10TestKit
19
19
 
20
20
  oauth2_params = {
21
21
  grant_type: 'authorization_code',
22
- code: code,
22
+ code:,
23
23
  redirect_uri: config.options[:redirect_uri]
24
24
  }
25
25
 
@@ -186,7 +186,7 @@ module ONCCertificationG10TestKit
186
186
 
187
187
  oauth2_params = {
188
188
  grant_type: 'authorization_code',
189
- code: code,
189
+ code:,
190
190
  redirect_uri: config.options[:redirect_uri]
191
191
  }
192
192
  oauth2_headers = { 'Content-Type' => 'application/x-www-form-urlencoded' }
@@ -188,7 +188,7 @@ module ONCCertificationG10TestKit
188
188
 
189
189
  oauth2_params = {
190
190
  grant_type: 'authorization_code',
191
- code: code,
191
+ code:,
192
192
  redirect_uri: config.options[:redirect_uri]
193
193
  }
194
194
  oauth2_headers = { 'Content-Type' => 'application/x-www-form-urlencoded' }
@@ -1,3 +1,4 @@
1
+ require_relative 'g10_options'
1
2
  require_relative 'patient_context_test'
2
3
  require_relative 'limited_scope_grant_test'
3
4
  require_relative 'restricted_resource_type_access_group'
@@ -80,7 +81,7 @@ module ONCCertificationG10TestKit
80
81
  Sequence](http://hl7.org/fhir/smart-app-launch/1.0.0/index.html#standalone-launch-sequence)
81
82
  )
82
83
 
83
- required_suite_options smart_app_launch_version: 'smart_app_launch_1'
84
+ required_suite_options G10Options::SMART_1_REQUIREMENT
84
85
 
85
86
  config(
86
87
  inputs: {
@@ -203,7 +204,7 @@ module ONCCertificationG10TestKit
203
204
  Sequence](http://hl7.org/fhir/smart-app-launch/STU2/app-launch.html#launch-app-standalone-launch)
204
205
  )
205
206
 
206
- required_suite_options smart_app_launch_version: 'smart_app_launch_2'
207
+ required_suite_options G10Options::SMART_2_REQUIREMENT
207
208
 
208
209
  config(
209
210
  inputs: {
@@ -1,5 +1,7 @@
1
1
  module ONCCertificationG10TestKit
2
2
  class SMARTScopesTest < Inferno::Test
3
+ include G10Options
4
+
3
5
  title 'Patient-level access with OpenID Connect and Refresh Token scopes used.'
4
6
  description %(
5
7
  The scopes being input must follow the guidelines specified in the
@@ -62,13 +64,13 @@ module ONCCertificationG10TestKit
62
64
  (PATIENT_COMPARTMENT_RESOURCE_TYPES + ['ServiceRequest']).freeze
63
65
 
64
66
  def patient_compartment_resource_types
65
- return PATIENT_COMPARTMENT_RESOURCE_TYPES unless suite_options[:us_core_version] == 'us_core_5'
67
+ return PATIENT_COMPARTMENT_RESOURCE_TYPES unless using_us_core_5?
66
68
 
67
69
  V5_PATIENT_COMPARTMENT_RESOURCE_TYPES
68
70
  end
69
71
 
70
72
  def valid_resource_types
71
- return VALID_RESOURCE_TYPES unless suite_options[:us_core_version] == 'us_core_5'
73
+ return VALID_RESOURCE_TYPES unless using_us_core_5?
72
74
 
73
75
  V5_VALID_RESOURCE_TYPES
74
76
  end
@@ -5,6 +5,7 @@ require_relative 'smart_scopes_test'
5
5
  require_relative 'unauthorized_access_test'
6
6
  require_relative 'unrestricted_resource_type_access_group'
7
7
  require_relative 'well_known_capabilities_test'
8
+ require_relative 'incorrectly_permitted_tls_versions_messages_setup_test'
8
9
 
9
10
  module ONCCertificationG10TestKit
10
11
  class SmartStandalonePatientAppGroup < Inferno::TestGroup
@@ -56,7 +57,7 @@ module ONCCertificationG10TestKit
56
57
  input_order :url, :standalone_client_id, :standalone_client_secret
57
58
 
58
59
  group from: :smart_discovery do
59
- required_suite_options(smart_app_launch_version: 'smart_app_launch_1')
60
+ required_suite_options(G10Options::SMART_1_REQUIREMENT)
60
61
 
61
62
  test from: 'g10_smart_well_known_capabilities',
62
63
  config: {
@@ -75,7 +76,7 @@ module ONCCertificationG10TestKit
75
76
  end
76
77
 
77
78
  group from: :smart_discovery_stu2 do
78
- required_suite_options(smart_app_launch_version: 'smart_app_launch_2')
79
+ required_suite_options(G10Options::SMART_2_REQUIREMENT)
79
80
 
80
81
  test from: 'g10_smart_well_known_capabilities',
81
82
  config: {
@@ -89,16 +90,14 @@ module ONCCertificationG10TestKit
89
90
  'permission-offline',
90
91
  'permission-patient',
91
92
  'authorize-post',
92
- 'permission-v1',
93
93
  'permission-v2'
94
-
95
94
  ]
96
95
  }
97
96
  }
98
97
  end
99
98
 
100
99
  group from: :smart_standalone_launch do
101
- required_suite_options(smart_app_launch_version: 'smart_app_launch_1')
100
+ required_suite_options(G10Options::SMART_1_REQUIREMENT)
102
101
 
103
102
  title 'Standalone Launch With Patient Scope'
104
103
  description %(
@@ -179,6 +178,22 @@ module ONCCertificationG10TestKit
179
178
  smart_credentials: { name: :standalone_smart_credentials }
180
179
  }
181
180
  }
181
+
182
+ tests[0].config(
183
+ outputs: {
184
+ incorrectly_permitted_tls_versions_messages: {
185
+ name: :auth_incorrectly_permitted_tls_versions_messages
186
+ }
187
+ }
188
+ )
189
+
190
+ tests[3].config(
191
+ outputs: {
192
+ incorrectly_permitted_tls_versions_messages: {
193
+ name: :token_incorrectly_permitted_tls_versions_messages
194
+ }
195
+ }
196
+ )
182
197
  end
183
198
 
184
199
  group from: :smart_standalone_launch_stu2,
@@ -198,7 +213,7 @@ module ONCCertificationG10TestKit
198
213
  }
199
214
  }
200
215
  } do
201
- required_suite_options(smart_app_launch_version: 'smart_app_launch_2')
216
+ required_suite_options(G10Options::SMART_2_REQUIREMENT)
202
217
 
203
218
  title 'Standalone Launch With Patient Scope'
204
219
  description %(
@@ -279,6 +294,22 @@ module ONCCertificationG10TestKit
279
294
  smart_credentials: { name: :standalone_smart_credentials }
280
295
  }
281
296
  }
297
+
298
+ tests[0].config(
299
+ outputs: {
300
+ incorrectly_permitted_tls_versions_messages: {
301
+ name: :auth_incorrectly_permitted_tls_versions_messages
302
+ }
303
+ }
304
+ )
305
+
306
+ tests[3].config(
307
+ outputs: {
308
+ incorrectly_permitted_tls_versions_messages: {
309
+ name: :token_incorrectly_permitted_tls_versions_messages
310
+ }
311
+ }
312
+ )
282
313
  end
283
314
 
284
315
  group from: :smart_openid_connect,
@@ -349,5 +380,25 @@ module ONCCertificationG10TestKit
349
380
  patient_id: standalone_patient_id
350
381
  end
351
382
  end
383
+
384
+ test from: :g10_incorrectly_permitted_tls_versions_messages_setup,
385
+ id: :g10_auth_incorrectly_permitted_tls_versions_messages_setup,
386
+ config: {
387
+ inputs: {
388
+ incorrectly_permitted_tls_versions_messages: {
389
+ name: :auth_incorrectly_permitted_tls_versions_messages
390
+ }
391
+ }
392
+ }
393
+
394
+ test from: :g10_incorrectly_permitted_tls_versions_messages_setup,
395
+ id: :g10_token_incorrectly_permitted_tls_versions_messages_setup,
396
+ config: {
397
+ inputs: {
398
+ incorrectly_permitted_tls_versions_messages: {
399
+ name: :token_incorrectly_permitted_tls_versions_messages
400
+ }
401
+ }
402
+ }
352
403
  end
353
404
  end
@@ -53,7 +53,7 @@ module ONCCertificationG10TestKit
53
53
  second_prefix, _, ending = second.rpartition('.')
54
54
  raise "'#{prefix}' != '#{second_prefix}' in #{@group} #{@id}" unless prefix == second_prefix
55
55
 
56
- (beginning.to_i..ending.to_i).map { |index| "#{prefix}.#{format('%02<index>d', { index: index })}" }
56
+ (beginning.to_i..ending.to_i).map { |index| "#{prefix}.#{format('%02<index>d', { index: })}" }
57
57
  else
58
58
  [test]
59
59
  end
@@ -51,7 +51,7 @@ module ONCCertificationG10TestKit
51
51
  def add_warning(message)
52
52
  validation_messages << {
53
53
  type: 'warning',
54
- message: message
54
+ message:
55
55
  }
56
56
  end
57
57
 
@@ -1,3 +1,4 @@
1
+ require_relative 'g10_options'
1
2
  require_relative 'resource_access_test'
2
3
 
3
4
  module ONCCertificationG10TestKit
@@ -111,6 +112,8 @@ module ONCCertificationG10TestKit
111
112
  (NON_PATIENT_COMPARTMENT_RESOURCES - ['Encounter'] + ['ServiceRequest']).freeze
112
113
 
113
114
  test do
115
+ include G10Options
116
+
114
117
  title 'Scope granted enables access to all US Core resource types.'
115
118
  description %(
116
119
  This test confirms that the scopes granted during authorization are
@@ -118,13 +121,13 @@ module ONCCertificationG10TestKit
118
121
  )
119
122
 
120
123
  def all_resources
121
- return V5_ALL_RESOURCES if suite_options[:us_core_version] == 'us_core_5'
124
+ return V5_ALL_RESOURCES if using_us_core_5?
122
125
 
123
126
  ALL_RESOURCES
124
127
  end
125
128
 
126
129
  def non_patient_compartment_resources
127
- return V5_NON_PATIENT_COMPARTMENT_RESOURCES if suite_options[:us_core_version] == 'us_core_5'
130
+ return V5_NON_PATIENT_COMPARTMENT_RESOURCES if using_us_core_5?
128
131
 
129
132
  NON_PATIENT_COMPARTMENT_RESOURCES
130
133
  end
@@ -335,7 +338,7 @@ module ONCCertificationG10TestKit
335
338
  )
336
339
  id :g10_encounter_unrestricted_access
337
340
 
338
- required_suite_options us_core_version: 'us_core_5'
341
+ required_suite_options G10Options::US_CORE_5_REQUIREMENT
339
342
 
340
343
  def resource_group
341
344
  USCoreTestKit::USCoreV501::EncounterGroup
@@ -349,7 +352,7 @@ module ONCCertificationG10TestKit
349
352
  )
350
353
  id :g10_service_request_unrestricted_access
351
354
 
352
- required_suite_options us_core_version: 'us_core_5'
355
+ required_suite_options G10Options::US_CORE_5_REQUIREMENT
353
356
 
354
357
  def resource_group
355
358
  USCoreTestKit::USCoreV501::ServiceRequestGroup
@@ -1,3 +1,3 @@
1
1
  module ONCCertificationG10TestKit
2
- VERSION = '3.1.0'.freeze
2
+ VERSION = '3.3.0'.freeze
3
3
  end
@@ -1,3 +1,5 @@
1
+ require_relative 'g10_options'
2
+
1
3
  module ONCCertificationG10TestKit
2
4
  class VisualInspectionAndAttestationsGroup < Inferno::TestGroup
3
5
  title 'Visual Inspection and Attestation'
@@ -374,7 +376,7 @@ module ONCCertificationG10TestKit
374
376
  )
375
377
  id 'Test11'
376
378
 
377
- required_suite_options us_core_version: 'us_core_3'
379
+ required_suite_options G10Options::US_CORE_3_REQUIREMENT
378
380
 
379
381
  input :patient_suffix_attestation,
380
382
  title: 'Health IT developer demonstrates support for the Patient Demographics Suffix USCDI v1 element.',
@@ -416,7 +418,7 @@ module ONCCertificationG10TestKit
416
418
  )
417
419
  id 'Test12'
418
420
 
419
- required_suite_options us_core_version: 'us_core_3'
421
+ required_suite_options G10Options::US_CORE_3_REQUIREMENT
420
422
 
421
423
  input :patient_previous_name_attestation,
422
424
  title: 'Health IT developer demonstrates support for the Patient Demographics Previous Name USCDI v1 element.', # rubocop:disable Layout/LineLength
@@ -522,5 +524,53 @@ module ONCCertificationG10TestKit
522
524
  pass public_url_attestation_notes if public_url_attestation_notes.present?
523
525
  end
524
526
  end
527
+
528
+ test do
529
+ title 'TLS version 1.2 or above must be enforced'
530
+ description %(
531
+ If TLS connections below version 1.2 have been allowed in any previous
532
+ tests, Health IT developers must document how the Health IT Module
533
+ enforces TLS version 1.2 or above.
534
+
535
+ If no TLS connections below version 1.2 have been allowed, no
536
+ documentation is necessary and this test will automatically pass.
537
+ )
538
+ id :g10_tls_version_attestation
539
+ input :unique_incorrectly_permitted_tls_versions_messages,
540
+ title: 'TLS Issues',
541
+ type: 'textarea',
542
+ locked: true,
543
+ optional: true
544
+ input :tls_documentation_required,
545
+ title: 'Health IT developers must document how the Health IT Module enforces TLs version 1.2 or above',
546
+ type: 'radio',
547
+ default: 'false',
548
+ locked: true,
549
+ options: {
550
+ list_options: [
551
+ {
552
+ label: 'Yes',
553
+ value: 'true'
554
+ },
555
+ {
556
+ label: 'No',
557
+ value: 'false'
558
+ }
559
+ ]
560
+ }
561
+ input :tls_version_attestation_notes,
562
+ title: 'Document how TLS version 1.2 or above is enforced, if required:',
563
+ type: 'textarea',
564
+ optional: true
565
+
566
+ run do
567
+ if tls_documentation_required == 'true'
568
+ assert tls_version_attestation_notes.present?,
569
+ 'Health IT developer did not document how the system under test enforces TLS version 1.2 or above'
570
+ end
571
+
572
+ pass tls_version_attestation_notes if tls_version_attestation_notes.present?
573
+ end
574
+ end
525
575
  end
526
576
  end