onc_certification_g10_test_kit 8.0.1 → 8.0.2

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 (19) hide show
  1. checksums.yaml +4 -4
  2. data/config/presets/g10_reference_server_preset.json +2 -1
  3. data/execution_scripts/reference_server/g10_ref_server_usc6_smart2_bulk1_no_terminology_expected.json +1 -0
  4. data/execution_scripts/reference_server/g10_ref_server_usc6_smart2_bulk1_with_commands.yaml +281 -0
  5. data/execution_scripts/reference_server/g10_ref_server_usc6_smart2_bulk1_with_commands_expected.json +1 -0
  6. data/execution_scripts/reference_server/g10_ref_server_usc7_smart2_bulk1_no_terminology_expected.json +1 -0
  7. data/execution_scripts/reference_server/g10_ref_server_usc7_smart2_bulk1_with_commands.yaml +281 -0
  8. data/execution_scripts/reference_server/g10_ref_server_usc7_smart2_bulk1_with_commands_expected.json +4054 -0
  9. data/execution_scripts/reference_server/ref_server_authorize_85_all_scopes.rb +4 -0
  10. data/execution_scripts/reference_server/ref_server_authorize_85_granular_scopes.rb +15 -0
  11. data/execution_scripts/reference_server/ref_server_authorize_85_limited_scopes.rb +28 -0
  12. data/execution_scripts/reference_server/ref_server_authorize_launched_all_scopes.rb +4 -0
  13. data/execution_scripts/reference_server/ref_server_ehr_launch_85.rb +4 -0
  14. data/execution_scripts/reference_server/ref_server_invalid_launch_and_attest.rb +20 -0
  15. data/execution_scripts/reference_server/ref_server_revoke_token_and_run_group.rb +43 -0
  16. data/lib/onc_certification_g10_test_kit/configuration_checker.rb +1 -1
  17. data/lib/onc_certification_g10_test_kit/smart_app_launch_invalid_aud_group.rb +18 -3
  18. data/lib/onc_certification_g10_test_kit/version.rb +2 -2
  19. metadata +20 -7
@@ -0,0 +1,4 @@
1
+ gem_dir = Gem::Specification.find_by_name('smart_app_launch_test_kit').gem_dir
2
+ load "#{gem_dir}/execution_scripts/reference_server/base_ref_server_authorize.rb"
3
+
4
+ ref_server_authorize(ARGV[0], target_patient_id: '85')
@@ -0,0 +1,15 @@
1
+ gem_dir = Gem::Specification.find_by_name('smart_app_launch_test_kit').gem_dir
2
+ load "#{gem_dir}/execution_scripts/reference_server/base_ref_server_authorize.rb"
3
+
4
+ GRANULAR_SCOPE_SELECTIONS_TO_CLICK = ['patient/Condition.rs',
5
+ 'patient/Condition.rs?category=http://hl7.org/fhir/us/core/CodeSystem/condition-category|health-concern',
6
+ 'patient/Condition.rs?category=http://terminology.hl7.org/CodeSystem/condition-category|encounter-diagnosis',
7
+ 'patient/Condition.rs?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item',
8
+ 'patient/Observation.rs',
9
+ 'patient/Observation.rs?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh',
10
+ 'patient/Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|social-history',
11
+ 'patient/Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|laboratory',
12
+ 'patient/Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|survey',
13
+ 'patient/Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs'].freeze
14
+
15
+ ref_server_authorize(ARGV[0], target_patient_id: '85', click_scopes: GRANULAR_SCOPE_SELECTIONS_TO_CLICK)
@@ -0,0 +1,28 @@
1
+ gem_dir = Gem::Specification.find_by_name('smart_app_launch_test_kit').gem_dir
2
+ load "#{gem_dir}/execution_scripts/reference_server/base_ref_server_authorize.rb"
3
+
4
+ LIMITED_SCOPES_TO_UNCHECK = ['patient/AllergyIntolerance.rs',
5
+ 'patient/CarePlan.rs',
6
+ 'patient/CareTeam.rs',
7
+ 'patient/Coverage.rs',
8
+ 'patient/Device.rs',
9
+ 'patient/DocumentReference.rs',
10
+ 'patient/DiagnosticReport.rs',
11
+ 'patient/Encounter.rs',
12
+ 'patient/Goal.rs',
13
+ 'patient/Immunization.rs',
14
+ 'patient/Location.rs',
15
+ 'patient/Medication.rs',
16
+ 'patient/MedicationDispense.rs',
17
+ 'patient/MedicationRequest.rs',
18
+ 'patient/Organization.rs',
19
+ 'patient/Practitioner.rs',
20
+ 'patient/PractitionerRole.rs',
21
+ 'patient/Procedure.rs',
22
+ 'patient/Provenance.rs',
23
+ 'patient/QuestionnaireResponse.rs',
24
+ 'patient/RelatedPerson.rs',
25
+ 'patient/ServiceRequest.rs',
26
+ 'patient/Specimen.rs'].freeze
27
+
28
+ ref_server_authorize(ARGV[0], target_patient_id: '85', click_scopes: LIMITED_SCOPES_TO_UNCHECK)
@@ -0,0 +1,4 @@
1
+ gem_dir = Gem::Specification.find_by_name('smart_app_launch_test_kit').gem_dir
2
+ load "#{gem_dir}/execution_scripts/reference_server/base_ref_server_authorize.rb"
3
+
4
+ ref_server_authorize(ARGV[0])
@@ -0,0 +1,4 @@
1
+ gem_dir = Gem::Specification.find_by_name('smart_app_launch_test_kit').gem_dir
2
+ load "#{gem_dir}/execution_scripts/reference_server/base_ref_server_ehr_launch.rb"
3
+
4
+ ref_server_ehr_launch(ARGV[0], ARGV[1], 85)
@@ -0,0 +1,20 @@
1
+ begin
2
+ require 'selenium-webdriver'
3
+ rescue LoadError
4
+ warn 'selenium-webdriver is required to run this command script.'
5
+ warn "Add it to your Gemfile: gem 'selenium-webdriver'"
6
+ exit(1)
7
+ end
8
+
9
+ launch_url = ARGV[0]
10
+ attest_url = ARGV[1]
11
+
12
+ options = Selenium::WebDriver::Options.chrome(args: ['--headless=new'])
13
+ driver = Selenium::WebDriver.for(:chrome, options: options)
14
+ wait = Selenium::WebDriver::Wait.new(timeout: 10)
15
+ driver.get launch_url
16
+ wait.until { driver.find_element(id: 'errorMessage') }
17
+ driver.get attest_url
18
+ wait.until { driver.find_element(:xpath, '//title') }
19
+ driver.quit
20
+ exit(0)
@@ -0,0 +1,43 @@
1
+ begin
2
+ require 'selenium-webdriver'
3
+ rescue LoadError
4
+ warn 'selenium-webdriver is required to run this command script.'
5
+ warn "Add it to your Gemfile: gem 'selenium-webdriver'"
6
+ exit(1)
7
+ end
8
+
9
+ def ref_server_revoke_token(session_id, inferno_host)
10
+ inputs_cli_command = "bundle exec inferno session data #{session_id}#{" -I #{inferno_host}" unless inferno_host.nil?}"
11
+ inputs = JSON.parse(`#{inputs_cli_command}`)
12
+
13
+ token_to_revoke = token_to_revoke(inputs)
14
+ raise StandardError, 'could not find access token to revoke' if token_to_revoke.nil? || token_to_revoke == ''
15
+
16
+ reference_server_url = inputs.find { |input| input['name'] == 'url' }&.dig('value')
17
+ revocation_url = "#{reference_server_url.chomp('/r4')}/oauth/token/revoke-token"
18
+
19
+ options = Selenium::WebDriver::Options.chrome(args: ['--headless=new'])
20
+ driver = Selenium::WebDriver.for(:chrome, options: options)
21
+ wait = Selenium::WebDriver::Wait.new(timeout: 10)
22
+ driver.get revocation_url
23
+ wait.until { driver.find_element(id: 'revokeToken') }.send_keys(token_to_revoke)
24
+ driver.find_element(id: 'revokeTokenButton').click
25
+ wait.until { driver.find_element(id: 'errorMessage').text.include?('successfully') }
26
+ driver.quit
27
+ end
28
+
29
+ def token_to_revoke(inputs)
30
+ JSON.parse(inputs.find { |input| input['name'] == 'smart_auth_info' }&.dig('value'))&.dig('access_token')
31
+ rescue JSON::ParserError
32
+ nil
33
+ end
34
+
35
+ session_id = ARGV[0]
36
+ revoke_token_group = ARGV[1]
37
+ inferno_host = ARGV[2]
38
+
39
+ ref_server_revoke_token(session_id, inferno_host)
40
+ start_run_cli_command =
41
+ "bundle exec inferno session start_run #{session_id} #{revoke_token_group}" \
42
+ "#{" -I #{inferno_host}" unless inferno_host.nil?}"
43
+ exec(start_run_cli_command)
@@ -2,7 +2,7 @@ require_relative '../inferno/terminology/tasks/check_built_terminology'
2
2
 
3
3
  module ONCCertificationG10TestKit
4
4
  class ConfigurationChecker
5
- EXPECTED_HL7_VALIDATOR_VERSION = '1.0.67'.freeze
5
+ EXPECTED_HL7_VALIDATOR_VERSION = '1.0.78'.freeze
6
6
  HL7_VALIDATOR_VERSION_KEY = 'validatorWrapperVersion'.freeze
7
7
 
8
8
  def configuration_messages
@@ -93,12 +93,17 @@ module ONCCertificationG10TestKit
93
93
  }
94
94
  }
95
95
  )
96
+ output :attest_launch_failed_url
96
97
 
97
98
  def aud
98
99
  'https://inferno.healthit.gov/invalid_aud'
99
100
  end
100
101
 
101
102
  def wait_message(auth_url)
103
+ attest_launch_failed_url =
104
+ "#{Inferno::Application['base_url']}/custom/smart/redirect?state=#{state}&confirm_fail=true"
105
+ output(attest_launch_failed_url:)
106
+
102
107
  %(
103
108
  Inferno will redirect you to an external website for authorization.
104
109
  **It is expected this will fail**. If the server does not return to
@@ -108,7 +113,7 @@ module ONCCertificationG10TestKit
108
113
 
109
114
  * [Perform Invalid Launch](#{auth_url})
110
115
  * [Attest launch
111
- failed](#{Inferno::Application['base_url']}/custom/smart/redirect?state=#{state}&confirm_fail=true)
116
+ failed](#{attest_launch_failed_url})
112
117
  )
113
118
  end
114
119
  end
@@ -156,12 +161,17 @@ module ONCCertificationG10TestKit
156
161
  }
157
162
  }
158
163
  )
164
+ output :attest_launch_failed_url
159
165
 
160
166
  def aud
161
167
  'https://inferno.healthit.gov/invalid_aud'
162
168
  end
163
169
 
164
170
  def wait_message(auth_url)
171
+ attest_launch_failed_url =
172
+ "#{Inferno::Application['base_url']}/custom/smart/redirect?state=#{state}&confirm_fail=true"
173
+ output(attest_launch_failed_url:)
174
+
165
175
  %(
166
176
  Inferno will redirect you to an external website for authorization.
167
177
  **It is expected this will fail**. If the server does not return to
@@ -171,7 +181,7 @@ module ONCCertificationG10TestKit
171
181
 
172
182
  * [Perform Invalid Launch](#{auth_url})
173
183
  * [Attest launch
174
- failed](#{Inferno::Application['base_url']}/custom/smart/redirect?state=#{state}&confirm_fail=true)
184
+ failed](#{attest_launch_failed_url})
175
185
  )
176
186
  end
177
187
  end
@@ -218,12 +228,17 @@ module ONCCertificationG10TestKit
218
228
  }
219
229
  }
220
230
  )
231
+ output :attest_launch_failed_url
221
232
 
222
233
  def aud
223
234
  'https://inferno.healthit.gov/invalid_aud'
224
235
  end
225
236
 
226
237
  def wait_message(auth_url)
238
+ attest_launch_failed_url =
239
+ "#{Inferno::Application['base_url']}/custom/smart/redirect?state=#{state}&confirm_fail=true"
240
+ output(attest_launch_failed_url:)
241
+
227
242
  %(
228
243
  Inferno will redirect you to an external website for authorization.
229
244
  **It is expected this will fail**. If the server does not return to
@@ -233,7 +248,7 @@ module ONCCertificationG10TestKit
233
248
 
234
249
  * [Perform Invalid Launch](#{auth_url})
235
250
  * [Attest launch
236
- failed](#{Inferno::Application['base_url']}/custom/smart/redirect?state=#{state}&confirm_fail=true)
251
+ failed](#{attest_launch_failed_url})
237
252
  )
238
253
  end
239
254
  end
@@ -1,4 +1,4 @@
1
1
  module ONCCertificationG10TestKit
2
- VERSION = '8.0.1'.freeze
3
- LAST_UPDATED = '2026-05-18'.freeze # TODO: update next release
2
+ VERSION = '8.0.2'.freeze
3
+ LAST_UPDATED = '2026-05-27'.freeze # TODO: update next release
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onc_certification_g10_test_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.0.1
4
+ version: 8.0.2
5
5
  platform: ruby
6
6
  authors:
7
- - Stephen MacVicar
7
+ - Inferno Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-05-19 00:00:00.000000000 Z
11
+ date: 2026-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bloomer
@@ -123,7 +123,7 @@ dependencies:
123
123
  version: '1.0'
124
124
  - - ">="
125
125
  - !ruby/object:Gem::Version
126
- version: 1.0.1
126
+ version: 1.0.2
127
127
  type: :runtime
128
128
  prerelease: false
129
129
  version_requirements: !ruby/object:Gem::Requirement
@@ -133,7 +133,7 @@ dependencies:
133
133
  version: '1.0'
134
134
  - - ">="
135
135
  - !ruby/object:Gem::Version
136
- version: 1.0.1
136
+ version: 1.0.2
137
137
  - !ruby/object:Gem::Dependency
138
138
  name: tls_test_kit
139
139
  requirement: !ruby/object:Gem::Requirement
@@ -163,7 +163,7 @@ dependencies:
163
163
  version: '1.1'
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
- version: 1.1.2
166
+ version: 1.1.3
167
167
  type: :runtime
168
168
  prerelease: false
169
169
  version_requirements: !ruby/object:Gem::Requirement
@@ -173,7 +173,7 @@ dependencies:
173
173
  version: '1.1'
174
174
  - - ">="
175
175
  - !ruby/object:Gem::Version
176
- version: 1.1.2
176
+ version: 1.1.3
177
177
  description: ONC Certification (g)(10) Standardized API for Patient and Population
178
178
  Services Test Kit
179
179
  email:
@@ -183,6 +183,19 @@ extra_rdoc_files: []
183
183
  files:
184
184
  - LICENSE
185
185
  - config/presets/g10_reference_server_preset.json
186
+ - execution_scripts/reference_server/g10_ref_server_usc6_smart2_bulk1_no_terminology_expected.json
187
+ - execution_scripts/reference_server/g10_ref_server_usc6_smart2_bulk1_with_commands.yaml
188
+ - execution_scripts/reference_server/g10_ref_server_usc6_smart2_bulk1_with_commands_expected.json
189
+ - execution_scripts/reference_server/g10_ref_server_usc7_smart2_bulk1_no_terminology_expected.json
190
+ - execution_scripts/reference_server/g10_ref_server_usc7_smart2_bulk1_with_commands.yaml
191
+ - execution_scripts/reference_server/g10_ref_server_usc7_smart2_bulk1_with_commands_expected.json
192
+ - execution_scripts/reference_server/ref_server_authorize_85_all_scopes.rb
193
+ - execution_scripts/reference_server/ref_server_authorize_85_granular_scopes.rb
194
+ - execution_scripts/reference_server/ref_server_authorize_85_limited_scopes.rb
195
+ - execution_scripts/reference_server/ref_server_authorize_launched_all_scopes.rb
196
+ - execution_scripts/reference_server/ref_server_ehr_launch_85.rb
197
+ - execution_scripts/reference_server/ref_server_invalid_launch_and_attest.rb
198
+ - execution_scripts/reference_server/ref_server_revoke_token_and_run_group.rb
186
199
  - lib/inferno/exceptions.rb
187
200
  - lib/inferno/ext/bloomer.rb
188
201
  - lib/inferno/repositiories/validators.rb