us_core_test_kit 0.6.5 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/us_core_test_kit/custom_groups/base_smart_granular_scopes_group.rb +42 -11
- data/lib/us_core_test_kit/custom_groups/granted_granular_scopes_test.rb +61 -0
- data/lib/us_core_test_kit/custom_groups/smart_scopes_constants.rb +5 -8
- data/lib/us_core_test_kit/custom_groups/v6.1.0/smart_granular_scopes_group.rb +94 -41
- data/lib/us_core_test_kit/custom_groups/v7.0.0-ballot/smart_granular_scopes_group.rb +6 -0
- data/lib/us_core_test_kit/fhir_resource_navigation.rb +11 -1
- data/lib/us_core_test_kit/generated/v3.1.1/metadata.yml +3 -0
- data/lib/us_core_test_kit/generated/v3.1.1/patient/metadata.yml +3 -0
- data/lib/us_core_test_kit/generated/v3.1.1/us_core_test_suite.rb +5 -4
- data/lib/us_core_test_kit/generated/v4.0.0/metadata.yml +3 -0
- data/lib/us_core_test_kit/generated/v4.0.0/patient/metadata.yml +3 -0
- data/lib/us_core_test_kit/generated/v4.0.0/us_core_test_suite.rb +5 -4
- data/lib/us_core_test_kit/generated/v5.0.1/condition_encounter_diagnosis/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v5.0.1/condition_problems_health_concerns/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v5.0.1/metadata.yml +8 -0
- data/lib/us_core_test_kit/generated/v5.0.1/patient/metadata.yml +4 -0
- data/lib/us_core_test_kit/generated/v5.0.1/questionnaire_response/metadata.yml +2 -0
- data/lib/us_core_test_kit/generated/v5.0.1/us_core_test_suite.rb +5 -4
- data/lib/us_core_test_kit/generated/v6.1.0/condition_encounter_diagnosis/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v6.1.0/condition_granular_scope1_group.rb +2 -0
- data/lib/us_core_test_kit/generated/v6.1.0/condition_problems_health_concerns/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/condition/metadata.yml +3 -2
- data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/observation/metadata.yml +2 -2
- data/lib/us_core_test_kit/generated/v6.1.0/granular_scopes1_group.rb +5 -1
- data/lib/us_core_test_kit/generated/v6.1.0/metadata.yml +9 -6
- data/lib/us_core_test_kit/generated/v6.1.0/observation_granular_scope1_group.rb +3 -1
- data/lib/us_core_test_kit/generated/v6.1.0/patient/metadata.yml +5 -0
- data/lib/us_core_test_kit/generated/v6.1.0/questionnaire_response/metadata.yml +2 -0
- data/lib/us_core_test_kit/generated/v6.1.0/us_core_test_suite.rb +7 -6
- data/lib/us_core_test_kit/generated/v7.0.0-ballot/condition_encounter_diagnosis/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v7.0.0-ballot/condition_problems_health_concerns/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/condition/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v7.0.0-ballot/medication_request/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v7.0.0-ballot/metadata.yml +10 -0
- data/lib/us_core_test_kit/generated/v7.0.0-ballot/patient/metadata.yml +5 -0
- data/lib/us_core_test_kit/generated/v7.0.0-ballot/questionnaire_response/metadata.yml +2 -0
- data/lib/us_core_test_kit/generated/v7.0.0-ballot/us_core_test_suite.rb +6 -5
- data/lib/us_core_test_kit/generator/granular_scope_group_generator.rb +7 -0
- data/lib/us_core_test_kit/generator/granular_scope_resource_type_group_generator.rb +1 -1
- data/lib/us_core_test_kit/generator/granular_scope_test_generator.rb +2 -2
- data/lib/us_core_test_kit/generator/group_metadata.rb +1 -1
- data/lib/us_core_test_kit/generator/must_support_metadata_extractor.rb +1 -0
- data/lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_4.rb +3 -0
- data/lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_5.rb +1 -0
- data/lib/us_core_test_kit/generator/special_cases.rb +3 -5
- data/lib/us_core_test_kit/generator/suite_generator.rb +5 -2
- data/lib/us_core_test_kit/must_support_test.rb +25 -6
- data/lib/us_core_test_kit/reference_resolution_test.rb +2 -1
- data/lib/us_core_test_kit/search_test.rb +2 -0
- data/lib/us_core_test_kit/version.rb +1 -1
- metadata +4 -6
- data/lib/us_core_test_kit/generated/v6.1.0/condition_granular_scope2_group.rb +0 -43
- data/lib/us_core_test_kit/generated/v6.1.0/granular_scopes2_group.rb +0 -52
- data/lib/us_core_test_kit/generated/v6.1.0/observation_granular_scope2_group.rb +0 -32
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ff99afacbf38abd7c8c459ab425b3e58c763a9ff721f9447562d62ff6e5dba66
|
|
4
|
+
data.tar.gz: b69ed849fd8588b2f8fe029cee922d78b46ba639de36ccd174efe94fe3da60eb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c64bede1519c6c76aa1e6fdb82f87036ccce90f88d238bb0af3fa35d7080246206a0cfedb0cbc57e0ad8aaf1769b1fa1297b5db50a1a5c0a35b6dc861664828a
|
|
7
|
+
data.tar.gz: 41a2be6bc4932c82fe6ef1ebe48027c556fec81ff8e3e7c72bcd77bb02de6ccb6161ea16772de78f7df2679facf6f7b798c1fbc9656a4fa2f20d96db6ee6d9fb
|
|
@@ -5,6 +5,7 @@ require_relative './smart_scopes_constants'
|
|
|
5
5
|
require_relative './smart_standalone_launch_stu2_group'
|
|
6
6
|
require_relative '../granular_scope_checker'
|
|
7
7
|
require_relative '../us_core_options'
|
|
8
|
+
require_relative './granted_granular_scopes_test'
|
|
8
9
|
|
|
9
10
|
module USCoreTestKit
|
|
10
11
|
class BaseSmartGranularScopesGroup < Inferno::TestGroup
|
|
@@ -52,8 +53,7 @@ module USCoreTestKit
|
|
|
52
53
|
smart_credentials: {
|
|
53
54
|
name: :granular_scopes_1_credentials
|
|
54
55
|
}
|
|
55
|
-
}
|
|
56
|
-
)
|
|
56
|
+
} )
|
|
57
57
|
group from: :us_core_smart_standalone_launch_stu2,
|
|
58
58
|
optional: true,
|
|
59
59
|
config: {
|
|
@@ -62,7 +62,16 @@ module USCoreTestKit
|
|
|
62
62
|
name: :granular_scopes_1_credentials
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
}
|
|
65
|
+
} do
|
|
66
|
+
groups[1].test from: :us_core_granted_granular_scopes,
|
|
67
|
+
config: {
|
|
68
|
+
inputs: {
|
|
69
|
+
received_scopes: {
|
|
70
|
+
name: :standalone_received_scopes
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
end
|
|
66
75
|
group from: :us_core_smart_ehr_launch_stu2,
|
|
67
76
|
optional: true,
|
|
68
77
|
config: {
|
|
@@ -71,9 +80,16 @@ module USCoreTestKit
|
|
|
71
80
|
name: :granular_scopes_1_credentials
|
|
72
81
|
}
|
|
73
82
|
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
83
|
+
} do
|
|
84
|
+
groups[1].test from: :us_core_granted_granular_scopes,
|
|
85
|
+
config: {
|
|
86
|
+
inputs: {
|
|
87
|
+
received_scopes: {
|
|
88
|
+
name: :ehr_received_scopes
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
end
|
|
77
93
|
end
|
|
78
94
|
end
|
|
79
95
|
|
|
@@ -103,7 +119,16 @@ module USCoreTestKit
|
|
|
103
119
|
name: :granular_scopes_2_credentials
|
|
104
120
|
}
|
|
105
121
|
}
|
|
106
|
-
}
|
|
122
|
+
} do
|
|
123
|
+
groups[1].test from: :us_core_granted_granular_scopes,
|
|
124
|
+
config: {
|
|
125
|
+
inputs: {
|
|
126
|
+
received_scopes: {
|
|
127
|
+
name: :standalone_received_scopes
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
end
|
|
107
132
|
|
|
108
133
|
|
|
109
134
|
group from: :us_core_smart_ehr_launch_stu2,
|
|
@@ -114,10 +139,16 @@ module USCoreTestKit
|
|
|
114
139
|
name: :granular_scopes_2_credentials
|
|
115
140
|
}
|
|
116
141
|
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
142
|
+
} do
|
|
143
|
+
groups[1].test from: :us_core_granted_granular_scopes,
|
|
144
|
+
config: {
|
|
145
|
+
inputs: {
|
|
146
|
+
received_scopes: {
|
|
147
|
+
name: :ehr_received_scopes
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
end
|
|
121
152
|
end
|
|
122
153
|
end
|
|
123
154
|
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
module USCoreTestKit
|
|
2
|
+
class GrantedGranularScopesTest < Inferno::Test
|
|
3
|
+
id :us_core_granted_granular_scopes
|
|
4
|
+
title 'Required granular scopes were granted'
|
|
5
|
+
|
|
6
|
+
description %()
|
|
7
|
+
|
|
8
|
+
input :received_scopes
|
|
9
|
+
|
|
10
|
+
run do
|
|
11
|
+
required_granular_scopes =
|
|
12
|
+
config
|
|
13
|
+
.options[:required_scopes]
|
|
14
|
+
.map { |scope| scope[scope.index('/') + 1, scope.length] }
|
|
15
|
+
|
|
16
|
+
received_granular_scopes =
|
|
17
|
+
received_scopes
|
|
18
|
+
.split(' ')
|
|
19
|
+
.select { |scope| scope.include? '?' }
|
|
20
|
+
.map { |scope| scope[scope.index('/') + 1, scope.length] }
|
|
21
|
+
|
|
22
|
+
missing_scopes = required_granular_scopes - received_granular_scopes
|
|
23
|
+
|
|
24
|
+
wrapped_missing_scopes = missing_scopes.map { |scope| "`#{scope}`" }
|
|
25
|
+
|
|
26
|
+
assert missing_scopes.empty?,
|
|
27
|
+
"The following granular scopes were not granted: #{wrapped_missing_scopes.to_sentence}"
|
|
28
|
+
|
|
29
|
+
granular_scope_resource_types =
|
|
30
|
+
required_granular_scopes
|
|
31
|
+
.map { |scope| scope.split('.').first }
|
|
32
|
+
.uniq
|
|
33
|
+
|
|
34
|
+
received_resource_level_scopes =
|
|
35
|
+
received_scopes
|
|
36
|
+
.split(' ')
|
|
37
|
+
.reject { |scope| scope.include? '?' }
|
|
38
|
+
.select { |scope| scope.match? %r{\A(user|patient|system|\*)/.+\..+} }
|
|
39
|
+
.map { |scope| scope[scope.index('/') + 1, scope.length] }
|
|
40
|
+
.select { |scope| granular_scope_resource_types.include? scope[0, scope.index('.')] }
|
|
41
|
+
|
|
42
|
+
wrapped_resource_scopes = received_resource_level_scopes.map { |scope| "`#{scope}`" }
|
|
43
|
+
|
|
44
|
+
assert received_resource_level_scopes.empty?,
|
|
45
|
+
'Can not verify the behavior of granular scopes because the following resource-level scopes were ' \
|
|
46
|
+
"granted: #{wrapped_resource_scopes.to_sentence}"
|
|
47
|
+
|
|
48
|
+
received_wildcard_scopes =
|
|
49
|
+
received_scopes
|
|
50
|
+
.split(' ')
|
|
51
|
+
.select { |scope| scope.match? %r{\A(user|patient|system|\*)/\*} }
|
|
52
|
+
|
|
53
|
+
wrapped_wildcard_scopes = received_wildcard_scopes.map { |scope| "`#{scope}`" }
|
|
54
|
+
|
|
55
|
+
assert received_wildcard_scopes.empty?,
|
|
56
|
+
'Can not verify the behavior of granular scopes because the following wildcard scopes were ' \
|
|
57
|
+
"granted: #{wrapped_wildcard_scopes.to_sentence}"
|
|
58
|
+
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
@@ -5,9 +5,13 @@ module USCoreTestKit
|
|
|
5
5
|
SMART_GRANULAR_SCOPES_GROUP1 = {
|
|
6
6
|
'v610' => [
|
|
7
7
|
'patient/Condition.rs?category=http://terminology.hl7.org/CodeSystem/condition-category|encounter-diagnosis',
|
|
8
|
+
'patient/Condition.rs?category=http://hl7.org/fhir/us/core/CodeSystem/condition-category|health-concern',
|
|
9
|
+
'patient/Condition.rs?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item',
|
|
8
10
|
'patient/Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|laboratory',
|
|
9
11
|
'patient/Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|social-history',
|
|
10
|
-
'patient/Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|
|
|
12
|
+
'patient/Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs',
|
|
13
|
+
'patient/Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|survey',
|
|
14
|
+
'patient/Observation.rs?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh'
|
|
11
15
|
].map(&:freeze).freeze,
|
|
12
16
|
'v700_ballot' => [
|
|
13
17
|
'patient/Condition.rs?category=http://terminology.hl7.org/CodeSystem/condition-category|encounter-diagnosis',
|
|
@@ -24,13 +28,6 @@ module USCoreTestKit
|
|
|
24
28
|
}.freeze
|
|
25
29
|
|
|
26
30
|
SMART_GRANULAR_SCOPES_GROUP2 = {
|
|
27
|
-
'v610' => [
|
|
28
|
-
'patient/Condition.rs?category=http://hl7.org/fhir/us/core/CodeSystem/condition-category|health-concern',
|
|
29
|
-
'patient/Condition.rs?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item',
|
|
30
|
-
'patient/Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs',
|
|
31
|
-
'patient.Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|survey',
|
|
32
|
-
'patient.Observation.rs?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh'
|
|
33
|
-
].map(&:freeze).freeze,
|
|
34
31
|
'v700_ballot' => [
|
|
35
32
|
'patient/Condition.rs?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item',
|
|
36
33
|
'patient/DiagnosticReport.rs?category=http://loinc.org|LP7839-6',
|
|
@@ -1,12 +1,33 @@
|
|
|
1
1
|
require_relative '../base_smart_granular_scopes_group'
|
|
2
|
+
require_relative '../smart_scopes_constants'
|
|
3
|
+
require_relative '../granted_granular_scopes_test'
|
|
2
4
|
require_relative '../../generated/v6.1.0/granular_scopes1_group'
|
|
3
|
-
require_relative '../../generated/v6.1.0/granular_scopes2_group'
|
|
4
5
|
|
|
5
6
|
module USCoreTestKit
|
|
6
7
|
module USCoreV610
|
|
7
|
-
class SmartGranularScopesGroup <
|
|
8
|
-
|
|
8
|
+
class SmartGranularScopesGroup < Inferno::TestGroup
|
|
9
|
+
include SmartScopesConstants
|
|
9
10
|
title 'US Core SMART Granular Scopes'
|
|
11
|
+
id :us_core_v610_smart_granular_scopes
|
|
12
|
+
|
|
13
|
+
description <<~DESCRIPTION
|
|
14
|
+
These tests verify that servers honor [SMART App Launch granular
|
|
15
|
+
scopes](http://hl7.org/fhir/smart-app-launch/STU2/scopes-and-launch-context.html#finer-grained-resource-constraints-using-search-parameters).
|
|
16
|
+
Support for these scopes is [required in US Core
|
|
17
|
+
7](http://hl7.org/fhir/us/core/2024Jan/scopes.html#us-core-scopes).
|
|
18
|
+
|
|
19
|
+
Prior to running these tests, first run the US Core FHIR API tests using
|
|
20
|
+
resource-level scopes. This group includes a SMART App Launch followed by
|
|
21
|
+
FHIR API tests. The app launches require that a granular scopes be
|
|
22
|
+
granted. The FHIR API tests then repeat all of the queries from the
|
|
23
|
+
original FHIR API tests that were run using resource-level scopes, and
|
|
24
|
+
verify that only resources matching the granted granular scopes are
|
|
25
|
+
returned.
|
|
26
|
+
DESCRIPTION
|
|
27
|
+
|
|
28
|
+
def self.default_group_scopes(version)
|
|
29
|
+
[DEFAULT_SCOPES, *SMART_GRANULAR_SCOPES_GROUP1[version]].join(' ')
|
|
30
|
+
end
|
|
10
31
|
|
|
11
32
|
def self.scopes_string(scopes)
|
|
12
33
|
scopes
|
|
@@ -15,59 +36,91 @@ module USCoreTestKit
|
|
|
15
36
|
.join("\n")
|
|
16
37
|
end
|
|
17
38
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
are repeated to verify that the results have been filtered according to the
|
|
27
|
-
above scopes.
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
groups
|
|
31
|
-
.first
|
|
32
|
-
.config(
|
|
33
|
-
inputs: {
|
|
34
|
-
requested_scopes: {
|
|
35
|
-
name: :requested_scopes_group1,
|
|
36
|
-
default: groups.first.default_group_scopes('v610')
|
|
37
|
-
}
|
|
39
|
+
config(
|
|
40
|
+
inputs: {
|
|
41
|
+
url: {
|
|
42
|
+
locked: true
|
|
43
|
+
},
|
|
44
|
+
requested_scopes: {
|
|
45
|
+
name: :requested_scopes_group1,
|
|
46
|
+
default: default_group_scopes('v610')
|
|
38
47
|
}
|
|
39
|
-
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
group do
|
|
52
|
+
title 'SMART App Launch w/Granular Scopes'
|
|
40
53
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
54
|
+
def self.scopes_string(scopes)
|
|
55
|
+
scopes
|
|
56
|
+
.map { |scope| scope.delete_prefix 'patient/' }
|
|
57
|
+
.map { |scope| "* `#{scope}`" }
|
|
58
|
+
.join("\n")
|
|
59
|
+
end
|
|
44
60
|
|
|
45
|
-
|
|
46
|
-
.last
|
|
47
|
-
.description %(
|
|
61
|
+
description %(
|
|
48
62
|
These tests perform a SMART app launch to receive the following granular scopes:
|
|
49
63
|
|
|
50
|
-
#{scopes_string(
|
|
64
|
+
#{scopes_string(SMART_GRANULAR_SCOPES_GROUP1['v610'])}
|
|
51
65
|
|
|
52
66
|
Then all of the searches which have been performed in the US Core FHIR API tests
|
|
53
67
|
are repeated to verify that the results have been filtered according to the
|
|
54
68
|
above scopes.
|
|
55
69
|
)
|
|
56
70
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
requested_scopes: {
|
|
62
|
-
name: :requested_scopes_group2,
|
|
63
|
-
default: groups.last.default_group_scopes('v610')
|
|
71
|
+
config(
|
|
72
|
+
outputs: {
|
|
73
|
+
smart_credentials: {
|
|
74
|
+
name: :granular_scopes_1_credentials
|
|
64
75
|
}
|
|
65
76
|
}
|
|
66
77
|
)
|
|
78
|
+
group from: :us_core_smart_standalone_launch_stu2,
|
|
79
|
+
optional: true,
|
|
80
|
+
config: {
|
|
81
|
+
inputs: {
|
|
82
|
+
smart_credentials: {
|
|
83
|
+
name: :granular_scopes_1_credentials
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
} do
|
|
87
|
+
groups[1].test from: :us_core_granted_granular_scopes,
|
|
88
|
+
config: {
|
|
89
|
+
inputs: {
|
|
90
|
+
received_scopes: {
|
|
91
|
+
name: :standalone_received_scopes
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
options: {
|
|
95
|
+
required_scopes: SMART_GRANULAR_SCOPES_GROUP1['v610']
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
end
|
|
99
|
+
group from: :us_core_smart_ehr_launch_stu2,
|
|
100
|
+
optional: true,
|
|
101
|
+
config: {
|
|
102
|
+
inputs: {
|
|
103
|
+
smart_credentials: {
|
|
104
|
+
name: :granular_scopes_1_credentials
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
} do
|
|
108
|
+
groups[1].test from: :us_core_granted_granular_scopes,
|
|
109
|
+
config: {
|
|
110
|
+
inputs: {
|
|
111
|
+
received_scopes: {
|
|
112
|
+
name: :ehr_received_scopes
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
options: {
|
|
116
|
+
required_scopes: SMART_GRANULAR_SCOPES_GROUP1['v610']
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
end
|
|
120
|
+
end
|
|
67
121
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
.group from: :us_core_v610_smart_granular_scopes_2
|
|
122
|
+
group from: :us_core_v610_smart_granular_scopes_1,
|
|
123
|
+
title: 'US Core FHIR API w/Granular Scopes'
|
|
71
124
|
end
|
|
72
125
|
end
|
|
73
126
|
end
|
|
@@ -43,6 +43,9 @@ above scopes.
|
|
|
43
43
|
name: :requested_scopes_group1,
|
|
44
44
|
default: groups.first.default_group_scopes('v700_ballot')
|
|
45
45
|
}
|
|
46
|
+
},
|
|
47
|
+
options: {
|
|
48
|
+
required_scopes: SMART_GRANULAR_SCOPES_GROUP1['v700_ballot']
|
|
46
49
|
}
|
|
47
50
|
)
|
|
48
51
|
|
|
@@ -70,6 +73,9 @@ above scopes.
|
|
|
70
73
|
name: :requested_scopes_group2,
|
|
71
74
|
default: groups.last.default_group_scopes('v700_ballot')
|
|
72
75
|
}
|
|
76
|
+
},
|
|
77
|
+
options: {
|
|
78
|
+
required_scopes: SMART_GRANULAR_SCOPES_GROUP2['v700_ballot']
|
|
73
79
|
}
|
|
74
80
|
)
|
|
75
81
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
module USCoreTestKit
|
|
2
2
|
module FHIRResourceNavigation
|
|
3
3
|
DAR_EXTENSION_URL = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason'.freeze
|
|
4
|
+
PRIMITIVE_DATA_TYPES = FHIR::PRIMITIVES.keys
|
|
4
5
|
|
|
5
6
|
def resolve_path(elements, path)
|
|
6
7
|
elements = Array.wrap(elements)
|
|
@@ -64,12 +65,21 @@ module USCoreTestKit
|
|
|
64
65
|
slice = find_slice_via_discriminator(element, property)
|
|
65
66
|
slice
|
|
66
67
|
else
|
|
67
|
-
element.send(property)
|
|
68
|
+
result = element.send(property)
|
|
69
|
+
result = find_primitive_extension(element, property) if result.nil?
|
|
70
|
+
result
|
|
68
71
|
end
|
|
69
72
|
rescue NoMethodError
|
|
70
73
|
nil
|
|
71
74
|
end
|
|
72
75
|
|
|
76
|
+
def find_primitive_extension(element, property)
|
|
77
|
+
type = element.class::METADATA[property.to_s]['type']
|
|
78
|
+
source_value = element.source_hash["_#{property}"]
|
|
79
|
+
|
|
80
|
+
PRIMITIVE_DATA_TYPES.include?(type) && source_value.present? ? FHIR::Element.new(source_value) : nil
|
|
81
|
+
end
|
|
82
|
+
|
|
73
83
|
def find_slice_via_discriminator(element, property)
|
|
74
84
|
element_name = property.to_s.split(':')[0].gsub(/^class$/, 'local_class')
|
|
75
85
|
slice_name = property.to_s.split(':')[1].gsub(/^class$/, 'local_class')
|
|
@@ -6636,10 +6636,13 @@
|
|
|
6636
6636
|
:must_supports:
|
|
6637
6637
|
:extensions:
|
|
6638
6638
|
- :id: Patient.extension:race
|
|
6639
|
+
:path: extension
|
|
6639
6640
|
:url: http://hl7.org/fhir/us/core/StructureDefinition/us-core-race
|
|
6640
6641
|
- :id: Patient.extension:ethnicity
|
|
6642
|
+
:path: extension
|
|
6641
6643
|
:url: http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity
|
|
6642
6644
|
- :id: Patient.extension:birthsex
|
|
6645
|
+
:path: extension
|
|
6643
6646
|
:url: http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex
|
|
6644
6647
|
:slices: []
|
|
6645
6648
|
:elements:
|
|
@@ -148,10 +148,13 @@
|
|
|
148
148
|
:must_supports:
|
|
149
149
|
:extensions:
|
|
150
150
|
- :id: Patient.extension:race
|
|
151
|
+
:path: extension
|
|
151
152
|
:url: http://hl7.org/fhir/us/core/StructureDefinition/us-core-race
|
|
152
153
|
- :id: Patient.extension:ethnicity
|
|
154
|
+
:path: extension
|
|
153
155
|
:url: http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity
|
|
154
156
|
- :id: Patient.extension:birthsex
|
|
157
|
+
:path: extension
|
|
155
158
|
:url: http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex
|
|
156
159
|
:slices: []
|
|
157
160
|
:elements:
|
|
@@ -65,6 +65,7 @@ module USCoreTestKit
|
|
|
65
65
|
/Provenance.agent\[\d*\]: Rule provenance-1/, #Invalid invariant in US Core v5.0.1
|
|
66
66
|
%r{Unknown Code System 'http://hl7.org/fhir/us/core/CodeSystem/us-core-tags'}, # Validator has an issue with this US Core 5 code system in US Core 6 resource
|
|
67
67
|
%r{URL value 'http://hl7.org/fhir/us/core/CodeSystem/us-core-tags' does not resolve}, # Validator has an issue with this US Core 5 code system in US Core 6 resource
|
|
68
|
+
/\A\S+: \S+: URL value '.*' does not resolve/,
|
|
68
69
|
%r{Observation.component\[\d+\].value.ofType\(Quantity\): The code provided \(http://unitsofmeasure.org#L/min\) was not found in the value set 'Vital Signs Units'} # Known issue with the Pulse Oximetry Profile
|
|
69
70
|
].freeze
|
|
70
71
|
|
|
@@ -76,8 +77,10 @@ module USCoreTestKit
|
|
|
76
77
|
end
|
|
77
78
|
end
|
|
78
79
|
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
id :us_core_v311
|
|
81
|
+
|
|
82
|
+
fhir_resource_validator do
|
|
83
|
+
igs 'hl7.fhir.us.core#3.1.1'
|
|
81
84
|
message_filters = VALIDATION_MESSAGE_FILTERS + VERSION_SPECIFIC_MESSAGE_FILTERS
|
|
82
85
|
|
|
83
86
|
exclude_message do |message|
|
|
@@ -90,8 +93,6 @@ module USCoreTestKit
|
|
|
90
93
|
end
|
|
91
94
|
end
|
|
92
95
|
|
|
93
|
-
id :us_core_v311
|
|
94
|
-
|
|
95
96
|
input :url,
|
|
96
97
|
title: 'FHIR Endpoint',
|
|
97
98
|
description: 'URL of the FHIR endpoint'
|
|
@@ -7260,12 +7260,15 @@
|
|
|
7260
7260
|
:must_supports:
|
|
7261
7261
|
:extensions:
|
|
7262
7262
|
- :id: Patient.extension:race
|
|
7263
|
+
:path: extension
|
|
7263
7264
|
:url: http://hl7.org/fhir/us/core/StructureDefinition/us-core-race
|
|
7264
7265
|
:uscdi_only: true
|
|
7265
7266
|
- :id: Patient.extension:ethnicity
|
|
7267
|
+
:path: extension
|
|
7266
7268
|
:url: http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity
|
|
7267
7269
|
:uscdi_only: true
|
|
7268
7270
|
- :id: Patient.extension:birthsex
|
|
7271
|
+
:path: extension
|
|
7269
7272
|
:url: http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex
|
|
7270
7273
|
:uscdi_only: true
|
|
7271
7274
|
:slices: []
|
|
@@ -148,12 +148,15 @@
|
|
|
148
148
|
:must_supports:
|
|
149
149
|
:extensions:
|
|
150
150
|
- :id: Patient.extension:race
|
|
151
|
+
:path: extension
|
|
151
152
|
:url: http://hl7.org/fhir/us/core/StructureDefinition/us-core-race
|
|
152
153
|
:uscdi_only: true
|
|
153
154
|
- :id: Patient.extension:ethnicity
|
|
155
|
+
:path: extension
|
|
154
156
|
:url: http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity
|
|
155
157
|
:uscdi_only: true
|
|
156
158
|
- :id: Patient.extension:birthsex
|
|
159
|
+
:path: extension
|
|
157
160
|
:url: http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex
|
|
158
161
|
:uscdi_only: true
|
|
159
162
|
:slices: []
|
|
@@ -67,6 +67,7 @@ module USCoreTestKit
|
|
|
67
67
|
/Provenance.agent\[\d*\]: Rule provenance-1/, #Invalid invariant in US Core v5.0.1
|
|
68
68
|
%r{Unknown Code System 'http://hl7.org/fhir/us/core/CodeSystem/us-core-tags'}, # Validator has an issue with this US Core 5 code system in US Core 6 resource
|
|
69
69
|
%r{URL value 'http://hl7.org/fhir/us/core/CodeSystem/us-core-tags' does not resolve}, # Validator has an issue with this US Core 5 code system in US Core 6 resource
|
|
70
|
+
/\A\S+: \S+: URL value '.*' does not resolve/,
|
|
70
71
|
%r{Observation.component\[\d+\].value.ofType\(Quantity\): The code provided \(http://unitsofmeasure.org#L/min\) was not found in the value set 'Vital Signs Units'} # Known issue with the Pulse Oximetry Profile
|
|
71
72
|
].freeze
|
|
72
73
|
|
|
@@ -78,8 +79,10 @@ module USCoreTestKit
|
|
|
78
79
|
end
|
|
79
80
|
end
|
|
80
81
|
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
id :us_core_v400
|
|
83
|
+
|
|
84
|
+
fhir_resource_validator do
|
|
85
|
+
igs 'hl7.fhir.us.core#4.0.0'
|
|
83
86
|
message_filters = VALIDATION_MESSAGE_FILTERS + VERSION_SPECIFIC_MESSAGE_FILTERS
|
|
84
87
|
|
|
85
88
|
exclude_message do |message|
|
|
@@ -92,8 +95,6 @@ module USCoreTestKit
|
|
|
92
95
|
end
|
|
93
96
|
end
|
|
94
97
|
|
|
95
|
-
id :us_core_v400
|
|
96
|
-
|
|
97
98
|
input :url,
|
|
98
99
|
title: 'FHIR Endpoint',
|
|
99
100
|
description: 'URL of the FHIR endpoint'
|
|
@@ -851,6 +851,7 @@
|
|
|
851
851
|
:must_supports:
|
|
852
852
|
:extensions:
|
|
853
853
|
- :id: Condition.extension:assertedDate
|
|
854
|
+
:path: extension
|
|
854
855
|
:url: http://hl7.org/fhir/StructureDefinition/condition-assertedDate
|
|
855
856
|
:slices:
|
|
856
857
|
- :slice_id: Condition.category:us-core
|
|
@@ -1196,6 +1197,7 @@
|
|
|
1196
1197
|
:must_supports:
|
|
1197
1198
|
:extensions:
|
|
1198
1199
|
- :id: Condition.extension:assertedDate
|
|
1200
|
+
:path: extension
|
|
1199
1201
|
:url: http://hl7.org/fhir/StructureDefinition/condition-assertedDate
|
|
1200
1202
|
:slices:
|
|
1201
1203
|
- :slice_id: Condition.category:us-core
|
|
@@ -9694,15 +9696,19 @@
|
|
|
9694
9696
|
:must_supports:
|
|
9695
9697
|
:extensions:
|
|
9696
9698
|
- :id: Patient.extension:race
|
|
9699
|
+
:path: extension
|
|
9697
9700
|
:url: http://hl7.org/fhir/us/core/StructureDefinition/us-core-race
|
|
9698
9701
|
:uscdi_only: true
|
|
9699
9702
|
- :id: Patient.extension:ethnicity
|
|
9703
|
+
:path: extension
|
|
9700
9704
|
:url: http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity
|
|
9701
9705
|
:uscdi_only: true
|
|
9702
9706
|
- :id: Patient.extension:birthsex
|
|
9707
|
+
:path: extension
|
|
9703
9708
|
:url: http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex
|
|
9704
9709
|
:uscdi_only: true
|
|
9705
9710
|
- :id: Patient.extension:genderIdentity
|
|
9711
|
+
:path: extension
|
|
9706
9712
|
:url: http://hl7.org/fhir/us/core/StructureDefinition/us-core-genderIdentity
|
|
9707
9713
|
:uscdi_only: true
|
|
9708
9714
|
:slices: []
|
|
@@ -10756,8 +10762,10 @@
|
|
|
10756
10762
|
:must_supports:
|
|
10757
10763
|
:extensions:
|
|
10758
10764
|
- :id: QuestionnaireResponse.questionnaire.extension:questionnaireDisplay
|
|
10765
|
+
:path: questionnaire.extension
|
|
10759
10766
|
:url: http://hl7.org/fhir/StructureDefinition/display
|
|
10760
10767
|
- :id: QuestionnaireResponse.questionnaire.extension:url
|
|
10768
|
+
:path: questionnaire.extension
|
|
10761
10769
|
:url: http://hl7.org/fhir/us/core/StructureDefinition/us-core-extension-questionnaire-uri
|
|
10762
10770
|
:slices:
|
|
10763
10771
|
- :slice_id: QuestionnaireResponse.meta.tag:sdoh
|
|
@@ -148,15 +148,19 @@
|
|
|
148
148
|
:must_supports:
|
|
149
149
|
:extensions:
|
|
150
150
|
- :id: Patient.extension:race
|
|
151
|
+
:path: extension
|
|
151
152
|
:url: http://hl7.org/fhir/us/core/StructureDefinition/us-core-race
|
|
152
153
|
:uscdi_only: true
|
|
153
154
|
- :id: Patient.extension:ethnicity
|
|
155
|
+
:path: extension
|
|
154
156
|
:url: http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity
|
|
155
157
|
:uscdi_only: true
|
|
156
158
|
- :id: Patient.extension:birthsex
|
|
159
|
+
:path: extension
|
|
157
160
|
:url: http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex
|
|
158
161
|
:uscdi_only: true
|
|
159
162
|
- :id: Patient.extension:genderIdentity
|
|
163
|
+
:path: extension
|
|
160
164
|
:url: http://hl7.org/fhir/us/core/StructureDefinition/us-core-genderIdentity
|
|
161
165
|
:uscdi_only: true
|
|
162
166
|
:slices: []
|
|
@@ -156,8 +156,10 @@
|
|
|
156
156
|
:must_supports:
|
|
157
157
|
:extensions:
|
|
158
158
|
- :id: QuestionnaireResponse.questionnaire.extension:questionnaireDisplay
|
|
159
|
+
:path: questionnaire.extension
|
|
159
160
|
:url: http://hl7.org/fhir/StructureDefinition/display
|
|
160
161
|
- :id: QuestionnaireResponse.questionnaire.extension:url
|
|
162
|
+
:path: questionnaire.extension
|
|
161
163
|
:url: http://hl7.org/fhir/us/core/StructureDefinition/us-core-extension-questionnaire-uri
|
|
162
164
|
:slices:
|
|
163
165
|
- :slice_id: QuestionnaireResponse.meta.tag:sdoh
|