davinci_us_drug_formulary_test_kit 0.9.0 → 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_us_drug_formulary_test_kit/custom_groups/v2.0.1/capability_statement_group.rb +9 -7
- data/lib/davinci_us_drug_formulary_test_kit/fhir_resource_navigation.rb +5 -4
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/usdf_test_suite.rb +13 -8
- data/lib/davinci_us_drug_formulary_test_kit/generator/suite_generator.rb +4 -3
- data/lib/davinci_us_drug_formulary_test_kit/must_support_test.rb +3 -3
- data/lib/davinci_us_drug_formulary_test_kit/reference_resolution_test.rb +2 -1
- data/lib/davinci_us_drug_formulary_test_kit/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e65817122b43903b0e36cf5321d955c85c84e242c62d551f2788c4e39a6d15f3
|
4
|
+
data.tar.gz: 65a4dd64907aeb998e66f6aa082c4360e3bc73c820ae45f12f30d470582bfd2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 651f8926d9e60874efa3b8879fb89fa2814a20287569ede857422ebf7a254bcda0ca31480161d5af07993441d2804fc141ae9ef33b4f8baf121421e043604ba7
|
7
|
+
data.tar.gz: 7d1cab5b5d87618aa7667a46db081bba38cd108dfc07b1f9210c049f01e0cc46201291d7fc26fe4584584dd450300eee51318f39fa613615baa02e2996794bd2
|
data/lib/davinci_us_drug_formulary_test_kit/custom_groups/v2.0.1/capability_statement_group.rb
CHANGED
@@ -17,15 +17,17 @@ module DaVinciUSDrugFormularyTestKit
|
|
17
17
|
The #{title} Sequence tests a FHIR server's ability to formally describe
|
18
18
|
features supported by the API by using the [Capability
|
19
19
|
Statement](https://www.hl7.org/fhir/capabilitystatement.html) resource.
|
20
|
-
The features described in the Capability Statement must be consistent
|
21
|
-
the required [capabilities of a US Drug
|
22
|
-
|
23
|
-
|
20
|
+
The features described in the Capability Statement must be consistent
|
21
|
+
with the required [capabilities of a US Drug
|
22
|
+
Formulary](http://hl7.org/fhir/us/davinci-drug-formulary/STU2.0.1/CapabilityStatement-usdf-server.html).
|
23
|
+
The Capability Statement must also advertise the location of the
|
24
|
+
required SMART on FHIR endpoints that enable authenticated access to the
|
25
|
+
FHIR server resources.
|
24
26
|
|
25
27
|
The Capability Statement resource allows clients to determine which
|
26
|
-
resources are supported by a FHIR Server. Not all servers are expected
|
27
|
-
implement all possible queries and data elements described in the US
|
28
|
-
API.
|
28
|
+
resources are supported by a FHIR Server. Not all servers are expected
|
29
|
+
to implement all possible queries and data elements described in the US
|
30
|
+
Drug Formulary API.
|
29
31
|
|
30
32
|
# Test Methodology
|
31
33
|
|
@@ -102,13 +102,13 @@ module DaVinciUSDrugFormularyTestKit
|
|
102
102
|
when 'Date'
|
103
103
|
begin
|
104
104
|
Date.parse(slice)
|
105
|
-
rescue ArgumentError
|
105
|
+
rescue ArgumentError # rubocop:disable Metrics/BlockNesting
|
106
106
|
false
|
107
107
|
end
|
108
108
|
when 'DateTime'
|
109
109
|
begin
|
110
110
|
DateTime.parse(slice)
|
111
|
-
rescue ArgumentError
|
111
|
+
rescue ArgumentError # rubocop:disable Metrics/BlockNesting
|
112
112
|
false
|
113
113
|
end
|
114
114
|
when 'String'
|
@@ -121,8 +121,9 @@ module DaVinciUSDrugFormularyTestKit
|
|
121
121
|
slice_value { |coding| discriminator[:values].include?(coding.code) }
|
122
122
|
end
|
123
123
|
end
|
124
|
-
else
|
125
|
-
# TODO: Error handling for if this file doesn't have access to metadata
|
124
|
+
else # rubocop:disable Style/EmptyElse
|
125
|
+
# TODO: Error handling for if this file doesn't have access to metadata
|
126
|
+
# for some reason (begin/rescue with StandardError?)
|
126
127
|
end
|
127
128
|
end
|
128
129
|
|
@@ -10,10 +10,10 @@ require_relative 'location_group'
|
|
10
10
|
module DaVinciUSDrugFormularyTestKit
|
11
11
|
module USDFV201
|
12
12
|
class USDFTestSuite < Inferno::TestSuite
|
13
|
-
title '
|
13
|
+
title 'DaVinci US Drug Formulary v2.0.1'
|
14
14
|
short_title 'US Drug Formulary v2.0.1'
|
15
15
|
description %(
|
16
|
-
The
|
16
|
+
The DaVinci US Drug Formulary Test Kit tests systems for their
|
17
17
|
conformance to the [US Drug Formulary Implementation Guide](https://hl7.org/fhir/us/davinci-drug-formulary/STU2.0.1/).
|
18
18
|
|
19
19
|
## Instructions
|
@@ -47,10 +47,13 @@ module DaVinciUSDrugFormularyTestKit
|
|
47
47
|
)
|
48
48
|
version VERSION
|
49
49
|
|
50
|
+
id :davinci_us_drug_formulary_v201
|
51
|
+
|
50
52
|
VALIDATION_MESSAGE_FILTERS = [
|
51
53
|
%r{Sub-extension url 'introspect' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris},
|
52
54
|
%r{Sub-extension url 'revoke' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris},
|
53
|
-
/Observation\.effective\.ofType\(Period\): .*vs-1
|
55
|
+
/Observation\.effective\.ofType\(Period\): .*vs-1:/, # Invalid invariant in FHIR v4.0.1
|
56
|
+
/\A\S+: \S+: URL value '.*' does not resolve/,
|
54
57
|
].freeze
|
55
58
|
|
56
59
|
VERSION_SPECIFIC_MESSAGE_FILTERS = [].freeze
|
@@ -61,8 +64,9 @@ module DaVinciUSDrugFormularyTestKit
|
|
61
64
|
end
|
62
65
|
end
|
63
66
|
|
64
|
-
|
65
|
-
|
67
|
+
fhir_resource_validator do
|
68
|
+
igs 'hl7.fhir.us.davinci-drug-formulary#2.0.1'
|
69
|
+
|
66
70
|
message_filters = VALIDATION_MESSAGE_FILTERS + VERSION_SPECIFIC_MESSAGE_FILTERS
|
67
71
|
|
68
72
|
exclude_message do |message|
|
@@ -83,12 +87,13 @@ module DaVinciUSDrugFormularyTestKit
|
|
83
87
|
{
|
84
88
|
label: 'Source Code',
|
85
89
|
url: 'https://github.com/inferno-framework/davinci-us-drug-formulary-test-kit'
|
90
|
+
},
|
91
|
+
{
|
92
|
+
label: 'Implementation Guide',
|
93
|
+
url: 'https://hl7.org/fhir/us/davinci-drug-formulary/STU2.0.1/'
|
86
94
|
}
|
87
95
|
]
|
88
96
|
|
89
|
-
|
90
|
-
id :davinci_us_drug_formulary_v201
|
91
|
-
|
92
97
|
input :url,
|
93
98
|
title: 'FHIR Endpoint',
|
94
99
|
description: 'URL of the FHIR endpoint'
|
@@ -49,15 +49,16 @@ module DaVinciUSDrugFormularyTestKit
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def title
|
52
|
-
"
|
52
|
+
"DaVinci US Drug Formulary #{ig_metadata.ig_version}"
|
53
53
|
end
|
54
54
|
|
55
55
|
def short_title
|
56
56
|
"US Drug Formulary #{ig_metadata.ig_version}"
|
57
57
|
end
|
58
58
|
|
59
|
-
def
|
60
|
-
|
59
|
+
def ig_identifier
|
60
|
+
version = ig_metadata.ig_version[1..] # Remove leading 'v'
|
61
|
+
"hl7.fhir.us.davinci-drug-formulary##{version}"
|
61
62
|
end
|
62
63
|
|
63
64
|
def ig_link
|
@@ -94,11 +94,11 @@ module DaVinciUSDrugFormularyTestKit
|
|
94
94
|
must_support_extensions.select do |extension_definition|
|
95
95
|
resources.none? do |resource|
|
96
96
|
path = extension_definition[:path]
|
97
|
-
if extension_definition[:path]
|
97
|
+
if extension_definition[:path] == 'extension'
|
98
|
+
resource.extension.any? { |extension| extension.url == extension_definition[:url] }
|
99
|
+
else
|
98
100
|
extension = find_a_value_at(resource, path)
|
99
101
|
extension&.url == extension_definition[:url]
|
100
|
-
else
|
101
|
-
resource.extension.any? { |extension| extension.url == extension_definition[:url] }
|
102
102
|
end
|
103
103
|
end
|
104
104
|
end
|
@@ -160,7 +160,8 @@ module DaVinciUSDrugFormularyTestKit
|
|
160
160
|
target_profile_with_version =
|
161
161
|
target_profile.include?('|') ? target_profile : "#{target_profile}|#{metadata.profile_version}"
|
162
162
|
|
163
|
-
|
163
|
+
validator_response = validator.validate(resource, target_profile_with_version)
|
164
|
+
outcome = validator.operation_outcome_from_hl7_wrapped_response(validator_response)
|
164
165
|
|
165
166
|
message_hashes = outcome.issue&.map { |issue| validator.message_hash_from_issue(issue, resource) } || []
|
166
167
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: davinci_us_drug_formulary_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
|
- Stephen MacVicar
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2024-
|
13
|
+
date: 2024-06-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: inferno_core
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ">="
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.4.
|
21
|
+
version: 0.4.37
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - ">="
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 0.4.
|
28
|
+
version: 0.4.37
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: tls_test_kit
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|