onc_certification_g10_test_kit 3.7.0 → 3.7.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f80a148fd28accafc4b6112cf435bff19443c7422c5a92b2a6be485568839da
|
4
|
+
data.tar.gz: '0138f1ac5453800b58f5f4f3eb3cf4c83a84668e9ecf606ad747c50bef591e6b'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6643638bc0088397befc86627839508823c42ae59a9b0be6a80968dfe3c0f6b15390351001771593d8d33dd0231bcdcc3d18e88ed74cbd922d21398e9ece49c9
|
7
|
+
data.tar.gz: 1615506d4dc00c6d3a76929be7847318480a83a419fc57e72eb1df6e1d19ebd5c612841b375d00946075092b2aff29c0a75c774117c67e1bcbe15886ada0340a
|
@@ -200,6 +200,7 @@ module ONCCertificationG10TestKit
|
|
200
200
|
|
201
201
|
wait_time = 1
|
202
202
|
start = Time.now
|
203
|
+
used_time = 0
|
203
204
|
|
204
205
|
loop do
|
205
206
|
get(polling_url, headers: { authorization: "Bearer #{bearer_token}", accept: 'application/json' })
|
@@ -208,14 +209,21 @@ module ONCCertificationG10TestKit
|
|
208
209
|
|
209
210
|
wait_time = retry_after_val.positive? ? retry_after_val : wait_time *= 2
|
210
211
|
|
211
|
-
|
212
|
+
used_time = Time.now - start
|
212
213
|
|
213
|
-
|
214
|
+
total_time_to_next_poll = Time.now - start + wait_time
|
215
|
+
|
216
|
+
break if response[:status] != 202 || total_time_to_next_poll > timeout
|
214
217
|
|
215
218
|
sleep wait_time
|
216
219
|
end
|
217
220
|
|
218
|
-
|
221
|
+
if response[:status] == 202
|
222
|
+
skip "Server already used #{used_time} seconds processing this request, " \
|
223
|
+
"and next poll is #{wait_time} seconds after. " \
|
224
|
+
"The total wait time for next poll is more than #{timeout} seconds time out setting."
|
225
|
+
end
|
226
|
+
|
219
227
|
assert_response_status(200)
|
220
228
|
|
221
229
|
assert request.response_header('content-type')&.value&.include?('application/json'),
|
@@ -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
|
-
|
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
|
-
"
|
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
|
@@ -61,63 +61,80 @@ module ONCCertificationG10TestKit
|
|
61
61
|
/Unknown ValueSet/
|
62
62
|
].freeze
|
63
63
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
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
|
-
|
80
|
-
|
81
|
-
|
95
|
+
true
|
96
|
+
else
|
97
|
+
false
|
98
|
+
end
|
82
99
|
end
|
83
|
-
end
|
84
100
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
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.
|
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-
|
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.
|
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.
|
152
|
+
version: 0.5.0
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: database_cleaner-sequel
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|