onc_certification_g10_test_kit 3.7.1 → 3.7.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a217709dc49a228fae0a2a23ea7eb38cbf22462dde7e652f49e2f0cac99107a4
4
- data.tar.gz: ad6a5a07a6090d411314b51e12e553f977512cb58f2a38170d9896df1b1e28b8
3
+ metadata.gz: 1f80a148fd28accafc4b6112cf435bff19443c7422c5a92b2a6be485568839da
4
+ data.tar.gz: '0138f1ac5453800b58f5f4f3eb3cf4c83a84668e9ecf606ad747c50bef591e6b'
5
5
  SHA512:
6
- metadata.gz: 29269e887ab0936ee2719095d60bbf860d81a33105562e01f03133769a26a45a0337eff87501bd34637ff693065f0adf7a1f8d605a265c1b3ab3f54cae7685ab
7
- data.tar.gz: a48a791c47d1ef1051c81e84c193af00c8fa6d791a6cbba6a9ceecc919d02dd4b5b237483ae22a2bc9a050d9fa5018b970ed7f3c54fb075ef0ffe9e02c2be4a5
6
+ metadata.gz: 6643638bc0088397befc86627839508823c42ae59a9b0be6a80968dfe3c0f6b15390351001771593d8d33dd0231bcdcc3d18e88ed74cbd922d21398e9ece49c9
7
+ data.tar.gz: 1615506d4dc00c6d3a76929be7847318480a83a419fc57e72eb1df6e1d19ebd5c612841b375d00946075092b2aff29c0a75c774117c67e1bcbe15886ada0340a
@@ -116,9 +116,9 @@ module ONCCertificationG10TestKit
116
116
  end
117
117
  end
118
118
 
119
- def bad_format_message(scope)
119
+ def bad_format_message(scope, scope_direction = 'Requested')
120
120
  %(
121
- Requested scope `#{scope}` does not follow the format:
121
+ #{scope_direction} scope `#{scope}` does not follow the format:
122
122
  `#{required_scope_type}/[ <ResourceType> | * ].[ #{read_format} ]`
123
123
  )
124
124
  end
@@ -131,12 +131,12 @@ module ONCCertificationG10TestKit
131
131
  end
132
132
  end
133
133
 
134
- def assert_correct_scope_type(scope, scope_type, resource_type)
134
+ def assert_correct_scope_type(scope, scope_type, resource_type, scope_direction)
135
135
  if required_scope_type == 'patient' && patient_compartment_resource_types.exclude?(resource_type)
136
136
  assert ['user', 'patient'].include?(scope_type),
137
- "Requested scope '#{scope}' must begin with either 'user/' or 'patient/'"
137
+ "#{scope_direction} scope '#{scope}' must begin with either 'user/' or 'patient/'"
138
138
  else
139
- assert scope_type == required_scope_type, bad_format_message(scope)
139
+ assert scope_type == required_scope_type, bad_format_message(scope, scope_direction)
140
140
  end
141
141
  end
142
142
 
@@ -157,7 +157,7 @@ module ONCCertificationG10TestKit
157
157
  resource_type, access_level = resource_scope_parts
158
158
  assert access_level =~ access_level_regex, bad_format_message(scope)
159
159
 
160
- assert_correct_scope_type(scope, scope_type, resource_type)
160
+ assert_correct_scope_type(scope, scope_type, resource_type, 'Requested')
161
161
 
162
162
  assert valid_resource_types.include?(resource_type),
163
163
  "'#{resource_type}' must be either a permitted resource type or '*'"
@@ -189,7 +189,7 @@ module ONCCertificationG10TestKit
189
189
 
190
190
  next unless ['patient', 'user', 'system'].include?(scope_type)
191
191
 
192
- assert_correct_scope_type(scope, scope_type, resource_type)
192
+ assert_correct_scope_type(scope, scope_type, resource_type, 'Received')
193
193
 
194
194
  granted_resource_types << resource_type
195
195
  end
@@ -1,3 +1,3 @@
1
1
  module ONCCertificationG10TestKit
2
- VERSION = '3.7.1'.freeze
2
+ VERSION = '3.7.2'.freeze
3
3
  end
@@ -61,63 +61,80 @@ module ONCCertificationG10TestKit
61
61
  /Unknown ValueSet/
62
62
  ].freeze
63
63
 
64
- validator do
65
- url ENV.fetch('G10_VALIDATOR_URL', 'http://validator_service:4567')
66
-
67
- exclude_message do |message|
68
- us_core_message_filters = USCoreTestKit::USCoreV311::USCoreTestSuite::VALIDATION_MESSAGE_FILTERS
69
- if message.type == 'info' ||
70
- (message.type == 'warning' && WARNING_INCLUSION_FILTERS.none? { |filter| filter.match? message.message }) ||
71
- us_core_message_filters.any? { |filter| filter.match? message.message } ||
72
- (
73
- message.type == 'error' && (
74
- message.message.match?(/\A\S+: \S+: Unknown Code/) ||
75
- message.message.match?(/\A\S+: \S+: None of the codings provided are in the value set/) ||
76
- message.message.match?(/\A\S+: \S+: The Coding provided \(\S*\) is not in the value set/)
64
+ [
65
+ G10Options::US_CORE_3_REQUIREMENT,
66
+ G10Options::US_CORE_4_REQUIREMENT,
67
+ G10Options::US_CORE_5_REQUIREMENT
68
+ ].each do |us_core_version_requirement|
69
+ validator :default, required_suite_options: us_core_version_requirement do
70
+ url ENV.fetch('G10_VALIDATOR_URL', 'http://validator_service:4567')
71
+
72
+ us_core_message_filters =
73
+ case (us_core_version_requirement[:us_core_version])
74
+ when G10Options::US_CORE_3
75
+ USCoreTestKit::USCoreV311::USCoreTestSuite::VALIDATION_MESSAGE_FILTERS
76
+ when G10Options::US_CORE_4
77
+ USCoreTestKit::USCoreV400::USCoreTestSuite::VALIDATION_MESSAGE_FILTERS
78
+ when G10Options::US_CORE_5
79
+ USCoreTestKit::USCoreV501::USCoreTestSuite::VALIDATION_MESSAGE_FILTERS
80
+ end
81
+
82
+ exclude_message do |message|
83
+ if message.type == 'info' ||
84
+ (message.type == 'warning' && WARNING_INCLUSION_FILTERS.none? do |filter|
85
+ filter.match? message.message
86
+ end) ||
87
+ us_core_message_filters.any? { |filter| filter.match? message.message } ||
88
+ (
89
+ message.type == 'error' && (
90
+ message.message.match?(/\A\S+: \S+: Unknown Code/) ||
91
+ message.message.match?(/\A\S+: \S+: None of the codings provided are in the value set/) ||
92
+ message.message.match?(/\A\S+: \S+: The Coding provided \(\S*\) is not in the value set/)
93
+ )
77
94
  )
78
- )
79
- true
80
- else
81
- false
95
+ true
96
+ else
97
+ false
98
+ end
82
99
  end
83
- end
84
100
 
85
- perform_additional_validation do |resource, profile_url|
86
- versionless_profile_url, profile_version = profile_url.split('|')
87
- profile_version = case profile_version
88
- when '4.0.0'
89
- '400'
90
- when '5.0.1'
91
- '501'
92
- else
93
- # This open-ended else is primarily for Vital Signs profiles in v3.1.1, which are tagged
94
- # with the base FHIR version (4.0.1). The profiles were migrated to US Core in later
95
- # versions.
96
- '311'
97
- end
98
-
99
- us_core_suite = USCoreTestKit.const_get("USCoreV#{profile_version}")::USCoreTestSuite
100
- metadata = us_core_suite.metadata.find do |metadata_candidate|
101
- metadata_candidate.profile_url == versionless_profile_url
101
+ perform_additional_validation do |resource, profile_url|
102
+ versionless_profile_url, profile_version = profile_url.split('|')
103
+ profile_version = case profile_version
104
+ when '4.0.0'
105
+ '400'
106
+ when '5.0.1'
107
+ '501'
108
+ else
109
+ # This open-ended else is primarily for Vital Signs profiles in v3.1.1, which are tagged
110
+ # with the base FHIR version (4.0.1). The profiles were migrated to US Core in later
111
+ # versions.
112
+ '311'
113
+ end
114
+
115
+ us_core_suite = USCoreTestKit.const_get("USCoreV#{profile_version}")::USCoreTestSuite
116
+ metadata = us_core_suite.metadata.find do |metadata_candidate|
117
+ metadata_candidate.profile_url == versionless_profile_url
118
+ end
119
+ next if metadata.nil?
120
+
121
+ validation_messages = if resource.instance_of?(FHIR::Provenance)
122
+ USCoreTestKit::ProvenanceValidator.validate(resource)
123
+ else
124
+ []
125
+ end
126
+
127
+ terminology_validation_messages = metadata.bindings
128
+ .select { |binding_definition| binding_definition[:strength] == 'required' }
129
+ .flat_map do |binding_definition|
130
+ TerminologyBindingValidator.validate(resource, binding_definition)
131
+ rescue Inferno::UnknownValueSetException, Inferno::UnknownCodeSystemException => e
132
+ { type: 'warning', message: e.message }
133
+ end.compact
134
+
135
+ validation_messages.concat(terminology_validation_messages)
136
+ validation_messages
102
137
  end
103
- next if metadata.nil?
104
-
105
- validation_messages = if resource.instance_of?(FHIR::Provenance)
106
- USCoreTestKit::ProvenanceValidator.validate(resource)
107
- else
108
- []
109
- end
110
-
111
- terminology_validation_messages = metadata.bindings
112
- .select { |binding_definition| binding_definition[:strength] == 'required' }
113
- .flat_map do |binding_definition|
114
- TerminologyBindingValidator.validate(resource, binding_definition)
115
- rescue Inferno::UnknownValueSetException, Inferno::UnknownCodeSystemException => e
116
- { type: 'warning', message: e.message }
117
- end.compact
118
-
119
- validation_messages.concat(terminology_validation_messages)
120
- validation_messages
121
138
  end
122
139
  end
123
140
 
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: 3.7.1
4
+ version: 3.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen MacVicar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-10 00:00:00.000000000 Z
11
+ date: 2023-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bloomer
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - '='
144
144
  - !ruby/object:Gem::Version
145
- version: 0.4.7
145
+ version: 0.5.0
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - '='
151
151
  - !ruby/object:Gem::Version
152
- version: 0.4.7
152
+ version: 0.5.0
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: database_cleaner-sequel
155
155
  requirement: !ruby/object:Gem::Requirement