onc_certification_g10_test_kit 7.0.2 → 7.1.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 (45) hide show
  1. checksums.yaml +4 -4
  2. data/config/presets/g10_reference_server_preset.json +1291 -0
  3. data/lib/inferno/ext/bloomer.rb +1 -1
  4. data/lib/inferno/terminology/tasks/process_umls.rb +1 -1
  5. data/lib/onc_certification_g10_test_kit/bulk_data_authorization.rb +4 -4
  6. data/lib/onc_certification_g10_test_kit/bulk_export_validation_tester.rb +3 -3
  7. data/lib/onc_certification_g10_test_kit/configuration_checker.rb +5 -13
  8. data/lib/onc_certification_g10_test_kit/feature.rb +5 -4
  9. data/lib/onc_certification_g10_test_kit/igs/01-us-core-v400.tgz +0 -0
  10. data/lib/onc_certification_g10_test_kit/igs/03-us-core-v311.tgz +0 -0
  11. data/lib/onc_certification_g10_test_kit/igs/04-us-core-610.tgz +0 -0
  12. data/lib/onc_certification_g10_test_kit/metadata.rb +103 -0
  13. data/lib/onc_certification_g10_test_kit/onc_program_procedure.yml +908 -134
  14. data/lib/onc_certification_g10_test_kit/patient_scope_test.rb +1 -1
  15. data/lib/onc_certification_g10_test_kit/short_id_map.yml +1 -0
  16. data/lib/onc_certification_g10_test_kit/single_patient_api_group.rb +17 -16
  17. data/lib/onc_certification_g10_test_kit/single_patient_us_core_4_api_group.rb +17 -16
  18. data/lib/onc_certification_g10_test_kit/single_patient_us_core_5_api_group.rb +17 -16
  19. data/lib/onc_certification_g10_test_kit/single_patient_us_core_6_api_group.rb +19 -18
  20. data/lib/onc_certification_g10_test_kit/single_patient_us_core_7_api_group.rb +19 -18
  21. data/lib/onc_certification_g10_test_kit/smart_app_launch_invalid_aud_group.rb +1 -1
  22. data/lib/onc_certification_g10_test_kit/smart_asymmetric_launch_group.rb +1 -1
  23. data/lib/onc_certification_g10_test_kit/smart_ehr_patient_launch_group.rb +2 -2
  24. data/lib/onc_certification_g10_test_kit/smart_ehr_patient_launch_group_stu2.rb +2 -2
  25. data/lib/onc_certification_g10_test_kit/smart_ehr_patient_launch_group_stu2_2.rb +2 -2
  26. data/lib/onc_certification_g10_test_kit/smart_ehr_practitioner_app_group.rb +4 -4
  27. data/lib/onc_certification_g10_test_kit/smart_fine_grained_scopes_group.rb +1 -1
  28. data/lib/onc_certification_g10_test_kit/smart_fine_grained_scopes_group_stu2_2.rb +1 -1
  29. data/lib/onc_certification_g10_test_kit/smart_fine_grained_scopes_us_core_7_group.rb +1 -1
  30. data/lib/onc_certification_g10_test_kit/smart_fine_grained_scopes_us_core_7_group_stu2_2.rb +1 -1
  31. data/lib/onc_certification_g10_test_kit/smart_granular_scope_selection_group.rb +4 -4
  32. data/lib/onc_certification_g10_test_kit/smart_invalid_pkce_group.rb +6 -6
  33. data/lib/onc_certification_g10_test_kit/smart_invalid_token_group.rb +3 -3
  34. data/lib/onc_certification_g10_test_kit/smart_invalid_token_group_stu2.rb +3 -3
  35. data/lib/onc_certification_g10_test_kit/smart_limited_app_group.rb +3 -3
  36. data/lib/onc_certification_g10_test_kit/smart_public_standalone_launch_group.rb +2 -2
  37. data/lib/onc_certification_g10_test_kit/smart_public_standalone_launch_group_stu2.rb +2 -2
  38. data/lib/onc_certification_g10_test_kit/smart_public_standalone_launch_group_stu2_2.rb +2 -2
  39. data/lib/onc_certification_g10_test_kit/smart_standalone_patient_app_group.rb +28 -2
  40. data/lib/onc_certification_g10_test_kit/smart_v1_scopes_group.rb +2 -2
  41. data/lib/onc_certification_g10_test_kit/tasks/generate_matrix.rb +1 -1
  42. data/lib/onc_certification_g10_test_kit/urls.rb +4 -0
  43. data/lib/onc_certification_g10_test_kit/version.rb +2 -1
  44. data/lib/onc_certification_g10_test_kit.rb +15 -25
  45. metadata +19 -68
@@ -18,7 +18,7 @@ class Bloomer
18
18
  def self.initial_size(length)
19
19
  size = 2**Math.log2(length).ceil
20
20
 
21
- size < 256 ? 256 : size
21
+ [size, 256].max
22
22
  end
23
23
  end
24
24
  end
@@ -37,7 +37,7 @@ module Inferno
37
37
  case code_system
38
38
  when 'SNOMEDCT_US'
39
39
  code_system = 'SNOMED'
40
- include_code = (row[4] == 'PF' && ['FN', 'OAF'].include?(row[12]))
40
+ include_code = row[4] == 'PF' && ['FN', 'OAF'].include?(row[12])
41
41
  when 'LNC'
42
42
  code_system = 'LOINC'
43
43
  include_code = true
@@ -87,7 +87,7 @@ module ONCCertificationG10TestKit
87
87
  aud: bulk_token_endpoint,
88
88
  grant_type: 'not_a_grant_type')
89
89
 
90
- post(**{ client: :token_endpoint }.merge(post_request_content))
90
+ post(client: :token_endpoint, **post_request_content)
91
91
 
92
92
  assert_response_status(400)
93
93
  end
@@ -118,7 +118,7 @@ module ONCCertificationG10TestKit
118
118
  aud: bulk_token_endpoint,
119
119
  client_assertion_type: 'not_an_assertion_type')
120
120
 
121
- post(**{ client: :token_endpoint }.merge(post_request_content))
121
+ post(client: :token_endpoint, **post_request_content)
122
122
 
123
123
  assert_response_status(400)
124
124
  end
@@ -157,7 +157,7 @@ module ONCCertificationG10TestKit
157
157
  sub: bulk_client_id,
158
158
  aud: bulk_token_endpoint)
159
159
 
160
- post(**{ client: :token_endpoint }.merge(post_request_content))
160
+ post(client: :token_endpoint, **post_request_content)
161
161
 
162
162
  assert_response_status([400, 401])
163
163
  end
@@ -179,7 +179,7 @@ module ONCCertificationG10TestKit
179
179
  sub: bulk_client_id,
180
180
  aud: bulk_token_endpoint)
181
181
 
182
- authentication_response = post(**{ client: :token_endpoint }.merge(post_request_content))
182
+ authentication_response = post(client: :token_endpoint, **post_request_content)
183
183
 
184
184
  assert_response_status([200, 201])
185
185
 
@@ -43,13 +43,13 @@ module ONCCertificationG10TestKit
43
43
  end
44
44
 
45
45
  def stream_ndjson(endpoint, headers, process_chunk_line, process_response) # rubocop:disable Metrics/CyclomaticComplexity
46
- hanging_chunk = String.new
46
+ hanging_chunk = ''
47
47
 
48
48
  process_body = proc { |chunk|
49
49
  hanging_chunk << chunk
50
50
  chunk_by_lines = hanging_chunk.lines
51
51
 
52
- hanging_chunk = chunk_by_lines.pop || String.new
52
+ hanging_chunk = chunk_by_lines.pop || ''
53
53
 
54
54
  chunk_by_lines.each do |elem|
55
55
  process_chunk_line.call(elem)
@@ -89,7 +89,7 @@ module ONCCertificationG10TestKit
89
89
  coding.code if coding.system.nil? || coding.system == 'http://snomed.info/sct'
90
90
  end
91
91
 
92
- (expected & actual).any?
92
+ expected.intersect?(actual)
93
93
  end
94
94
 
95
95
  def determine_profile(resource)
@@ -2,9 +2,7 @@ require_relative '../inferno/terminology/tasks/check_built_terminology'
2
2
 
3
3
  module ONCCertificationG10TestKit
4
4
  class ConfigurationChecker
5
- EXPECTED_VALIDATOR_VERSION = '2.3.2'.freeze
6
- INFERNO_VALIDATOR_VERSION_KEY = 'inferno-framework/fhir-validator-wrapper'.freeze
7
- EXPECTED_HL7_VALIDATOR_VERSION = '1.0.59'.freeze
5
+ EXPECTED_HL7_VALIDATOR_VERSION = '1.0.60'.freeze
8
6
  HL7_VALIDATOR_VERSION_KEY = 'validatorWrapperVersion'.freeze
9
7
 
10
8
  def configuration_messages
@@ -24,15 +22,9 @@ module ONCCertificationG10TestKit
24
22
  end
25
23
 
26
24
  def validator_version_message
27
- if Feature.use_hl7_resource_validator?
28
- expected_validator_version = EXPECTED_HL7_VALIDATOR_VERSION
29
- validator_version_key = HL7_VALIDATOR_VERSION_KEY
30
- validator_version_url = "#{validator_url}/validator/version"
31
- else
32
- expected_validator_version = EXPECTED_VALIDATOR_VERSION
33
- validator_version_key = INFERNO_VALIDATOR_VERSION_KEY
34
- validator_version_url = "#{validator_url}/version"
35
- end
25
+ expected_validator_version = EXPECTED_HL7_VALIDATOR_VERSION
26
+ validator_version_key = HL7_VALIDATOR_VERSION_KEY
27
+ validator_version_url = "#{validator_url}/validator/version"
36
28
 
37
29
  response = Faraday.get validator_version_url
38
30
  if response.body.starts_with? '{'
@@ -71,7 +63,7 @@ module ONCCertificationG10TestKit
71
63
 
72
64
  cs_metadata = YAML.load_file(path)
73
65
  message = "Terminology was generated based on the following code system versions:\n"
74
- cs_metadata.each do |_url, metadata|
66
+ cs_metadata.each_value do |metadata|
75
67
  message += "* #{metadata[:name]}: version #{metadata[:versions].join(', ')}\n"
76
68
  end
77
69
 
@@ -1,9 +1,10 @@
1
1
  module ONCCertificationG10TestKit
2
2
  module Feature
3
- class << self
4
- def use_hl7_resource_validator?
5
- ENV.fetch('USE_HL7_RESOURCE_VALIDATOR', 'false')&.casecmp?('true')
6
- end
3
+ class << self # rubocop:disable Lint/EmptyClass
4
+ # This is how you can define feature flags to be used in the g10 test kit
5
+ # def us_core_v4?
6
+ # ENV.fetch('US_CORE_4_ENABLED', 'false')&.casecmp?('true')
7
+ # end
7
8
  end
8
9
  end
9
10
  end
@@ -0,0 +1,103 @@
1
+ require_relative 'version'
2
+
3
+ module ONCCertificationG10TestKit
4
+ class Metadata < Inferno::TestKit
5
+ id :onc_certification_g10_test_kit
6
+ title 'ONC Certification (g)(10) Standardized API Test Kit'
7
+ description <<~DESCRIPTION
8
+ The ONC Certification (g)(10) Standardized API Test Kit is a testing tool for
9
+ Health IT systems seeking to meet the requirements of the Standardized API for
10
+ Patient and Population Services criterion § 170.315(g)(10) in the ONC
11
+ Certification Program. It is an approved test method for the [§ 170.315(g)(10)
12
+ test
13
+ procedure](https://www.healthit.gov/test-method/standardized-api-patient-and-population-services#test_procedure).
14
+ <!-- break -->
15
+
16
+ Systems may adopt later versions of standards than those named in the rule as
17
+ approved by the ONC Standards Version Advancement Process (SVAP). Please note
18
+ that US Core Implementation Guide v.7.0.0 should only be used with SMART
19
+ App Launch Guide v2.0.0 or above due to granular scope support
20
+ requirements within this version of US Core.
21
+
22
+ Please select which approved version of each standard to use, and click 'Create
23
+ Test Session' to begin testing.
24
+
25
+ This test kit includes a [simulated conformant FHIR
26
+ API](https://inferno.healthit.gov/reference-server/) that can be used to
27
+ demonstrate success for all tests. This simulated API is open source and is
28
+ available on
29
+ [GitHub](https://github.com/inferno-framework/inferno-reference-server). Visit
30
+ the
31
+ [walkthrough](https://github.com/onc-healthit/onc-certification-g10-test-kit/wiki/Walkthrough)
32
+ for a demonstration of using these tests against the provided simulated FHIR
33
+ API.
34
+
35
+ ## Status
36
+
37
+ The ONC Certification (g)(10) Standardized API is actively developed and updates
38
+ are released monthly.
39
+
40
+ The test kit currently tests all requirements for the [Standardized API for
41
+ Patient and Population Services criterion §
42
+ 170.315(g)(10)](https://www.healthit.gov/test-method/standardized-api-patient-and-population-services),
43
+ including updates from the [HTI-1 Final
44
+ Rule](https://www.healthit.gov/topic/laws-regulation-and-policy/health-data-technology-and-interoperability-certification-program).
45
+ This includes:
46
+ - SMART App Standalone Launch with full system access
47
+ - SMART App Standalone Launch with limited system access
48
+ - SMART App Standalone Launch with OpenID Connect
49
+ - SMART App EHR Launch with user scopes
50
+ - SMART App EHR Launch with patient scopes
51
+ - SMART App Launch Invalid AUD Parameter
52
+ - SMART App Launch Invalid Access Token Request
53
+ - SMART App Launch Token Introspection
54
+ - SMART App Launch v1 and v2 scopes
55
+ - SMART App Launch finer-grained scope access
56
+ - Support for Capability Statement
57
+ - Support for all US Core Profiles
58
+ - Searches required for each resource
59
+ - Support for Must Support Elements
60
+ - Profile Validation
61
+ - Reference Validation
62
+ - Export of multiple patients using the FHIR Bulk Data Access IG
63
+
64
+ See the test descriptions within the test kit for detail on the specific
65
+ validations performed as part of testing these requirements.
66
+
67
+ ## Repository and Resources
68
+
69
+ The ONC Certification (g)(10) Standardized API Test Kit can be [downloaded from
70
+ its GitHub
71
+ repository](https://github.com/onc-healthit/onc-certification-g10-test-kit),
72
+ where additional resources and documentation are also available to help users
73
+ get started with the testing process. The repository
74
+ [Wiki](https://github.com/onc-healthit/onc-certification-g10-test-kit/wiki/FAQ)
75
+ provides a
76
+ [FAQ](https://github.com/onc-healthit/onc-certification-g10-test-kit/wiki/FAQ)
77
+ for testers, and the
78
+ [Releases](https://github.com/onc-healthit/onc-certification-g10-test-kit/releases)
79
+ page provides information about each new release.
80
+
81
+ ## Providing Feedback and Reporting Issues
82
+
83
+ We welcome feedback on the tests, including but not limited to the following areas:
84
+
85
+ - Validation logic, such as potential bugs, lax checks, and unexpected failures.
86
+ - Requirements coverage, such as requirements that have been missed, tests that
87
+ necessitate features that the IG does not require, or other issues with the
88
+ interpretation of the IG's requirements.
89
+ - User experience, such as confusing or missing information in the test UI.
90
+
91
+ Please report any issues with this set of tests in the [issues
92
+ section](https://github.com/onc-healthit/onc-certification-g10-test-kit/issues)
93
+ of the repository.
94
+ DESCRIPTION
95
+ suite_ids [:g10_certification]
96
+ tags ['SMART App Launch', 'US Core', 'Bulk Data']
97
+ last_updated LAST_UPDATED
98
+ version VERSION
99
+ maturity 'High'
100
+ authors ['Stephen MacVicar']
101
+ repo 'https://github.com/onc-healthit/onc-certification-g10-test-kit'
102
+ end
103
+ end