davinci_pas_test_kit 0.9.3 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/davinci_pas_test_kit/client_suite.rb +2 -2
- data/lib/davinci_pas_test_kit/generated/v2.0.1/server_suite.rb +2 -2
- data/lib/davinci_pas_test_kit/generator/suite_generator.rb +5 -0
- data/lib/davinci_pas_test_kit/igs/README.md +21 -0
- data/lib/davinci_pas_test_kit/pas_bundle_validation.rb +9 -5
- data/lib/davinci_pas_test_kit/validator_suppressions.rb +2 -0
- data/lib/davinci_pas_test_kit/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e45ca8e36bad87d4e457eb2b49c26eb0170c7877e059e9a8cb8e5bda906972b9
|
4
|
+
data.tar.gz: 6dbf634eb8484ea7dc442a7bd9b016392ea70316e3635ae4fe7c2e2bd884772a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29e35d93edbabe076d85521e36829951c15ae73645c262a334a3abf3a1c1abaf6752ab7e56488c4edc519dfa95a2a228312e467a25f9b78822efa1f2abb96d7c
|
7
|
+
data.tar.gz: af2de00d7c19bc247f8834f185a702b942b939947e4aa2c16323ab044b67ccffcd9cd315fe6ec8d26cc98e410e05ed12548f8796e9d9d01da9da72c3d0b29410
|
@@ -41,8 +41,8 @@ module DaVinciPASTestKit
|
|
41
41
|
!test.config.options[:accepts_multiple_requests]
|
42
42
|
end
|
43
43
|
|
44
|
-
|
45
|
-
|
44
|
+
fhir_resource_validator do
|
45
|
+
igs 'hl7.fhir.us.davinci-pas#2.0.1'
|
46
46
|
|
47
47
|
exclude_message do |message|
|
48
48
|
# Messages expected of the form `<ResourceType>: <FHIRPath>: <message>`
|
@@ -33,8 +33,8 @@ module DaVinciPASTestKit
|
|
33
33
|
request.query_parameters['use_case']
|
34
34
|
end
|
35
35
|
|
36
|
-
|
37
|
-
|
36
|
+
fhir_resource_validator do
|
37
|
+
igs 'hl7.fhir.us.davinci-pas#2.0.1'
|
38
38
|
|
39
39
|
exclude_message do |message|
|
40
40
|
# Messages expected of the form `<ResourceType>: <FHIRPath>: <message>`
|
@@ -48,6 +48,11 @@ module DaVinciPASTestKit
|
|
48
48
|
"Da Vinci PAS Server Suite #{ig_metadata.ig_version}"
|
49
49
|
end
|
50
50
|
|
51
|
+
def ig_identifier
|
52
|
+
version = ig_metadata.ig_version[1..] # Remove leading 'v'
|
53
|
+
"hl7.fhir.us.davinci-pas##{version}"
|
54
|
+
end
|
55
|
+
|
51
56
|
def ig_link
|
52
57
|
case ig_metadata.ig_version
|
53
58
|
when 'v2.0.1'
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Note on this IGs folder
|
2
|
+
|
3
|
+
There are three reasons why it would be necessary to put an IG package.tgz in this folder. If none of these apply, you do not need to put any files here, or can consider removing any existing files to make it clear they are unused.
|
4
|
+
|
5
|
+
## 1. Generated Test Suites
|
6
|
+
Some test kits use a "generator" to automatically generate the contents of a test suite for an IG. The IG files are required every time the test suites need to be regenerated. Examples of test kits that use this approach are the US Core Test Kit and CARIN IG for Blue Button® Test Kit.
|
7
|
+
|
8
|
+
|
9
|
+
## 2. Non-published IG
|
10
|
+
If your IG, or the specific version of the IG you want to test against, is not published, then the validator service needs to load the IG from file in order to be able to validate resources with it. The IG must be referenced in the `fhir_resource_validator` block in the test suite definition by filename, ie:
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
fhir_resource_validator do
|
14
|
+
igs 'igs/filename.tgz'
|
15
|
+
|
16
|
+
...
|
17
|
+
end
|
18
|
+
```
|
19
|
+
|
20
|
+
## 3. Inferno Validator UI
|
21
|
+
The Inferno Validator UI is configured to auto-load any IGs present in the igs folder and include them in all validations. The Inferno Validator UI is currently disabled by default, so this is only relevant if you choose to re-enable it. In general, the Inferno team is currently leaving IGs in this folder even if not otherwise necessary to make it easy to re-enable the validator UI.
|
@@ -210,9 +210,11 @@ module DaVinciPASTestKit
|
|
210
210
|
# @param version [String] The version of the IG.
|
211
211
|
def validate_bundle_entries_against_profiles(version)
|
212
212
|
bundle_resources_target_profile_map.each_value do |item|
|
213
|
+
resource = item[:resource]
|
214
|
+
base_profile = FHIR::Definitions.resource_definition(resource.resourceType).url
|
213
215
|
success_profile = item[:profile_urls].find do |url|
|
214
|
-
|
215
|
-
resource_is_valid?(resource
|
216
|
+
profile_to_validate = url == base_profile ? url : "#{url}|#{version}"
|
217
|
+
resource_is_valid?(resource:, profile_url: profile_to_validate)
|
216
218
|
end
|
217
219
|
|
218
220
|
validation_error_messages << generate_non_conformance_message(item) unless success_profile
|
@@ -370,18 +372,20 @@ module DaVinciPASTestKit
|
|
370
372
|
|
371
373
|
logger = Logger.new($stdout)
|
372
374
|
begin
|
373
|
-
|
374
|
-
path = "#{
|
375
|
+
fhirpath_url = ENV.fetch('FHIRPATH_URL')
|
376
|
+
path = "#{fhirpath_url}/evaluate?path=#{expression}"
|
375
377
|
|
376
378
|
response = Faraday.post(path, resource.to_json, 'Content-Type' => 'application/json')
|
377
379
|
if response.status.to_s.start_with? '2'
|
378
380
|
result = JSON.parse(response.body)
|
379
381
|
return result.map { |entry| entry.dig('element', 'reference') if entry['type'] == 'Reference' }.compact
|
380
382
|
else
|
381
|
-
logger.error "External
|
383
|
+
logger.error "External FHIRPath service failed: #{response.status}"
|
384
|
+
raise 'FHIRPath service not available'
|
382
385
|
end
|
383
386
|
rescue Faraday::Error => e
|
384
387
|
logger.error "HTTP request failed: #{e.message}"
|
388
|
+
raise 'FHIRPath service not available'
|
385
389
|
end
|
386
390
|
|
387
391
|
[]
|
@@ -133,6 +133,8 @@ module DaVinciPASTestKit
|
|
133
133
|
# no real content
|
134
134
|
/Details for (.+) matching against profile/,
|
135
135
|
': All OK',
|
136
|
+
# This was ignored natively in the Inferno validator but needs to be ignored by the test kit with the HL7 validator
|
137
|
+
/URL value '.*' does not resolve/,
|
136
138
|
# addition validator clean-up based on Bundle sub-validations where Inferno error supression doesn't
|
137
139
|
# work. The test kit validates these instances individually as well, so they are still checked,
|
138
140
|
# but in a way that Inferno can supress errors
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: davinci_pas_test_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Inferno Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inferno_core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.4.
|
19
|
+
version: 0.4.37
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.4.
|
26
|
+
version: 0.4.37
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: database_cleaner-sequel
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -247,6 +247,7 @@ files:
|
|
247
247
|
- lib/davinci_pas_test_kit/generator/terminology_binding_metadata_extractor.rb
|
248
248
|
- lib/davinci_pas_test_kit/generator/validation_test_generator.rb
|
249
249
|
- lib/davinci_pas_test_kit/generator/value_extractor.rb
|
250
|
+
- lib/davinci_pas_test_kit/igs/README.md
|
250
251
|
- lib/davinci_pas_test_kit/mock_server.rb
|
251
252
|
- lib/davinci_pas_test_kit/must_support_test.rb
|
252
253
|
- lib/davinci_pas_test_kit/pas_bundle_validation.rb
|