us_core_test_kit 0.4.4 → 0.4.5

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: aac6a564a32ae165aafa5464db0cf48406798016af086d3f27eb3b89c7c6358a
4
- data.tar.gz: 5dfd9dec3bc2559f5c02d985d08bcd8766673c5b292114c4f225d950125c35d3
3
+ metadata.gz: 100200153e9adc8ef4a768a34ab02fe1b2460a72bde04350f3681ad699aacb99
4
+ data.tar.gz: 41013e5c4b2161553a28bd73f9928fb00097455e3b547adbfe02fd0115a3f03e
5
5
  SHA512:
6
- metadata.gz: 55352a177a081274e200990644114ba019c09d7e684b4d40edf3c1ce3e2138434058bd7b9c7eea21361c77d08f5010a51b06cf774a2a5ac97db08421d8f0700d
7
- data.tar.gz: c1aa7c927b0cc9a3c3181ebc122a17f85bf8d9a9c8b411292a13bccd42520f3cdd5fe01da347f7a9e4121d17404df56cedfac2c686d37dec11ef743c669b02d9
6
+ metadata.gz: 37702b890daf5dc75452d610cd9cc70b2cca359b8d8580f842ed770ea24f3447dc6af0db058bc156a07344ad48f6ecbfba83e34427c5258c5270a418fda1145f
7
+ data.tar.gz: 6b658f5e99a0d62939d18f7316e57dc3bc901a6130eb668b24750a6e76ee33a456a732c87db8bb7e71efcbf848e2e1536aff28226b6b33bab4e811aa09e3bc7a
@@ -9,7 +9,9 @@ module USCoreTestKit
9
9
  The US Core Server SHALL:
10
10
  1. Support the US Core Patient resource profile.
11
11
  2. Support at least one additional resource profile from the list of US
12
- Core Profiles.
12
+ Core Profiles.
13
+
14
+ In order to support USCDI, servers must support all USCDI resources.
13
15
  ```
14
16
  )
15
17
  uses_request :capability_statement
@@ -23,30 +25,25 @@ module USCoreTestKit
23
25
  &.each_with_object([]) do |rest, resources|
24
26
  rest.resource.each { |resource| resources << resource.type }
25
27
  end.uniq
26
- supported_profiles =
27
- capability_statement.rest
28
- &.flat_map(&:resource)
29
- &.flat_map { |resource| resource.supportedProfile + [resource.profile] }
30
- &.compact || []
31
- supported_profiles.map! { |profile_url| profile_url.split('|').first }
32
28
 
33
29
  assert supported_resources.include?('Patient'), 'US Core Patient profile not supported'
34
30
 
35
- target_profiles = config.options[:target_profiles]
31
+ us_core_resources = config.options[:us_core_resources]
36
32
 
37
- other_resources = target_profiles.keys.reject { |resource_type| resource_type == 'Patient' }
33
+ other_resources = us_core_resources.reject { |resource_type| resource_type == 'Patient' }
38
34
  other_resources_supported = other_resources.any? { |resource| supported_resources.include? resource }
39
35
  assert other_resources_supported, 'No US Core resources other than Patient are supported'
40
36
 
41
- target_profiles.each do |resource_type, profiles|
42
- next unless supported_resources.include? resource_type
37
+ if config.options[:required_resources].present?
38
+ missing_resources = config.options[:required_resources] - supported_resources
39
+
40
+ missing_resource_list =
41
+ missing_resources
42
+ .map { |resource| "`#{resource}`" }
43
+ .join(', ')
43
44
 
44
- profiles.each do |profile|
45
- warning do
46
- assert supported_profiles&.include?(profile),
47
- "CapabilityStatement does not claim support for US Core #{resource_type} profile: #{profile}"
48
- end
49
- end
45
+ assert missing_resources.empty?,
46
+ "The CapabilityStatement did not list support for the following resources: #{missing_resource_list}"
50
47
  end
51
48
  end
52
49
  end
@@ -102,7 +102,7 @@ module USCoreTestKit
102
102
 
103
103
  test from: :us_core_profile_support do
104
104
  config(
105
- options: { target_profiles: PROFILES }
105
+ options: { us_core_resources: PROFILES.keys }
106
106
  )
107
107
  end
108
108
  end
@@ -106,7 +106,7 @@ module USCoreTestKit
106
106
 
107
107
  test from: :us_core_profile_support do
108
108
  config(
109
- options: { target_profiles: PROFILES }
109
+ options: { us_core_resources: PROFILES.keys }
110
110
  )
111
111
  end
112
112
 
@@ -118,7 +118,7 @@ module USCoreTestKit
118
118
 
119
119
  test from: :us_core_profile_support do
120
120
  config(
121
- options: { target_profiles: PROFILES }
121
+ options: { us_core_resources: PROFILES.keys }
122
122
  )
123
123
  end
124
124
 
@@ -54,8 +54,8 @@ module USCoreTestKit
54
54
  version VERSION
55
55
 
56
56
  VALIDATION_MESSAGE_FILTERS = [
57
- %r{Sub-extension url 'introspect' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris$},
58
- %r{Sub-extension url 'revoke' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris$},
57
+ %r{Sub-extension url 'introspect' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris},
58
+ %r{Sub-extension url 'revoke' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris},
59
59
  /Observation\.effective\.ofType\(Period\): .*vs-1:/, # Invalid invariant in FHIR v4.0.1
60
60
  /Observation\.effective\.ofType\(Period\): .*us-core-1:/, # Invalid invariant in US Core v3.1.1
61
61
  /Provenance.agent\[\d*\]: Rule provenance-1/ #Invalid invariant in US Core v5.0.1
@@ -56,8 +56,8 @@ module USCoreTestKit
56
56
  version VERSION
57
57
 
58
58
  VALIDATION_MESSAGE_FILTERS = [
59
- %r{Sub-extension url 'introspect' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris$},
60
- %r{Sub-extension url 'revoke' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris$},
59
+ %r{Sub-extension url 'introspect' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris},
60
+ %r{Sub-extension url 'revoke' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris},
61
61
  /Observation\.effective\.ofType\(Period\): .*vs-1:/, # Invalid invariant in FHIR v4.0.1
62
62
  /Observation\.effective\.ofType\(Period\): .*us-core-1:/, # Invalid invariant in US Core v3.1.1
63
63
  /Provenance.agent\[\d*\]: Rule provenance-1/ #Invalid invariant in US Core v5.0.1
@@ -65,8 +65,8 @@ module USCoreTestKit
65
65
  version VERSION
66
66
 
67
67
  VALIDATION_MESSAGE_FILTERS = [
68
- %r{Sub-extension url 'introspect' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris$},
69
- %r{Sub-extension url 'revoke' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris$},
68
+ %r{Sub-extension url 'introspect' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris},
69
+ %r{Sub-extension url 'revoke' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris},
70
70
  /Observation\.effective\.ofType\(Period\): .*vs-1:/, # Invalid invariant in FHIR v4.0.1
71
71
  /Observation\.effective\.ofType\(Period\): .*us-core-1:/, # Invalid invariant in US Core v3.1.1
72
72
  /Provenance.agent\[\d*\]: Rule provenance-1/ #Invalid invariant in US Core v5.0.1
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module USCoreTestKit
4
- VERSION = '0.4.4'
4
+ VERSION = '0.4.5'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: us_core_test_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
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-01-06 00:00:00.000000000 Z
11
+ date: 2023-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inferno_core