davinci_us_drug_formulary_test_kit 0.9.1 → 0.10.1

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: 8d6b4a9ccf4297a309b64e061a13c0328bf7ff0a0050b54885dbc76b06070036
4
- data.tar.gz: 743ff9f19270b523a56bb6911830fa1339e573cc6b2f4b040738aeac96d864b2
3
+ metadata.gz: dbd0f61ee522c225815fd46063c993665f84b80784833cd2e2da8fde9f53c0f5
4
+ data.tar.gz: 766f0d7bba4138d26c50a6f1e7ce2a15818b06847006419c2ef68b5f11320aec
5
5
  SHA512:
6
- metadata.gz: a9114b502c22d5ba3bb6db78dcef5aca546b4fc621591683ef8c684b485ae6d2632235af4501be68ef54e0aabe319e3057e41790722508a51af273282ecbe12d
7
- data.tar.gz: afab6c4c7c64a3920aa4044119d625f4c0b3a5518e4338592dabb718715cd1b52a50aeb8a9de6b1f64c1c50a89725501437ac02d65872693ed3d51818176f21e
6
+ metadata.gz: c2d5625ffe7dcb3e9e1e762274fba92f32e55a70d49bc762c3f8eb12590888ea203ee8403ba64817a294f3f1c708bc6a65f72733244675f8ba8f2dfe0d59a1cc
7
+ data.tar.gz: 232f99718005a113b9f86d64ca5f21df1bf9eb6571ed92649db9e65cd41d3a78f09b2095bae85b4a12b80c8445ec8afbeb4065dfa0b600d65c5df306775dbc33
@@ -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 with
21
- the required [capabilities of a US Drug Formulary](http://hl7.org/fhir/us/davinci-drug-formulary/STU2.0.1/CapabilityStatement-usdf-server.html). The Capability Statement
22
- must also advertise the location of the required SMART on FHIR endpoints
23
- that enable authenticated access to the FHIR server resources.
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 to
27
- implement all possible queries and data elements described in the US Drug Formulary
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 for some reason (begin/rescue with StandardError?)
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
 
@@ -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:/ # Invalid invariant in FHIR v4.0.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
- validator do
65
- url ENV.fetch('V201_VALIDATOR_URL', 'http://validator_service:4567')
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|
@@ -90,9 +94,6 @@ module DaVinciUSDrugFormularyTestKit
90
94
  }
91
95
  ]
92
96
 
93
-
94
- id :davinci_us_drug_formulary_v201
95
-
96
97
  input :url,
97
98
  title: 'FHIR Endpoint',
98
99
  description: 'URL of the FHIR endpoint'
@@ -56,8 +56,9 @@ module DaVinciUSDrugFormularyTestKit
56
56
  "US Drug Formulary #{ig_metadata.ig_version}"
57
57
  end
58
58
 
59
- def validator_env_name
60
- "#{ig_metadata.reformatted_version.upcase}_VALIDATOR_URL"
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] != "extension"
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
- outcome = FHIR::OperationOutcome.new(JSON.parse(validator.validate(resource, target_profile_with_version)))
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DaVinciUSDrugFormularyTestKit
4
- VERSION = '0.9.1'
4
+ VERSION = '0.10.1'
5
5
  end
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.9.1
4
+ version: 0.10.1
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-03-07 00:00:00.000000000 Z
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.2
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.2
28
+ version: 0.4.37
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: tls_test_kit
31
31
  requirement: !ruby/object:Gem::Requirement