us_core_test_kit 0.8.2 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/lib/us_core_test_kit/custom_groups/base_smart_granular_scopes_group.rb +87 -6
  3. data/lib/us_core_test_kit/custom_groups/smart_app_launch_group.rb +28 -6
  4. data/lib/us_core_test_kit/custom_groups/smart_ehr_launch_stu2_2.rb +40 -0
  5. data/lib/us_core_test_kit/custom_groups/smart_standalone_launch_stu2_2_group.rb +40 -0
  6. data/lib/us_core_test_kit/custom_groups/v3.1.1/capability_statement_group.rb +2 -2
  7. data/lib/us_core_test_kit/custom_groups/v3.1.1/{profile_support_test.rb → resource_support_test.rb} +1 -1
  8. data/lib/us_core_test_kit/custom_groups/v7.0.0/smart_app_launch_group.rb +3 -3
  9. data/lib/us_core_test_kit/custom_groups/v7.0.0/smart_app_launch_stu2_2_group.rb +16 -0
  10. data/lib/us_core_test_kit/custom_groups/v7.0.0/smart_discovery_stu2_2_group.rb +11 -0
  11. data/lib/us_core_test_kit/generated/v3.1.1/us_core_test_suite.rb +8 -2
  12. data/lib/us_core_test_kit/generated/v4.0.0/us_core_test_suite.rb +8 -2
  13. data/lib/us_core_test_kit/generated/v5.0.1/us_core_test_suite.rb +8 -2
  14. data/lib/us_core_test_kit/generated/v6.1.0/diagnostic_report_note/diagnostic_report_note_must_support_test.rb +0 -2
  15. data/lib/us_core_test_kit/generated/v6.1.0/diagnostic_report_note/diagnostic_report_note_reference_resolution_test.rb +0 -1
  16. data/lib/us_core_test_kit/generated/v6.1.0/diagnostic_report_note/metadata.yml +0 -4
  17. data/lib/us_core_test_kit/generated/v6.1.0/metadata.yml +0 -4
  18. data/lib/us_core_test_kit/generated/v6.1.0/us_core_test_suite.rb +14 -5
  19. data/lib/us_core_test_kit/generated/v7.0.0/diagnostic_report_note/diagnostic_report_note_must_support_test.rb +0 -2
  20. data/lib/us_core_test_kit/generated/v7.0.0/diagnostic_report_note/diagnostic_report_note_reference_resolution_test.rb +0 -1
  21. data/lib/us_core_test_kit/generated/v7.0.0/diagnostic_report_note/metadata.yml +0 -4
  22. data/lib/us_core_test_kit/generated/v7.0.0/metadata.yml +0 -4
  23. data/lib/us_core_test_kit/generated/v7.0.0/us_core_test_suite.rb +21 -5
  24. data/lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb +8 -0
  25. data/lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_7.rb +1 -0
  26. data/lib/us_core_test_kit/generator/suite_generator.rb +8 -4
  27. data/lib/us_core_test_kit/us_core_options.rb +9 -8
  28. data/lib/us_core_test_kit/version.rb +1 -1
  29. metadata +9 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a96c6f3f861e76af7890dece571af5e3c4ca97a8250438807218ac2affe33fce
4
- data.tar.gz: 5b005b8775b3855768365acdc237ce371501187102672fbc5058d0214a18dc5f
3
+ metadata.gz: d0b4059c21c91aac9937415541f2104a2f15ea911181d73e0e71b37efdb30d80
4
+ data.tar.gz: bc52f233f6620307ab10c64c03bfc3e223f7a9d6bd5e80e5bcecc4ace255a399
5
5
  SHA512:
6
- metadata.gz: b210de56a48140207534ad50251d849da40023352e34d71b0e4d73d05a307ec02e5c2c04a81e6b40120246ab50e6e68ff8f138b54134c1c46c94906b453ec36a
7
- data.tar.gz: e43c0f334ee18d8b7861328890ed0bc791bc4ef3175d439fafb37b0ecda10222b4e5e5100fd00307ce3f92abaaed35450845b556d6dc3e81e79530fea37328dd
6
+ metadata.gz: b786a061e34bb45029cebf15641f360607d89f6c5b4c2249bd11171b6ca74403958795c7579ef170bee76a8061cb4f4b23dac257a3cdee91675510de3901eed5
7
+ data.tar.gz: b8ebd86009a0fc9cd4b3ab35a5f8078320d4c81612f3445793d524367cc446096a537461c1f30aaf5686f27110282a6717ed44f3460415b7def5ddd61ab905ae
@@ -1,12 +1,12 @@
1
1
  require 'inferno'
2
2
  require 'smart_app_launch_test_kit'
3
- require_relative './smart_ehr_launch_stu2'
4
- require_relative './smart_scopes_constants'
5
- require_relative './smart_standalone_launch_stu2_group'
3
+ require_relative 'smart_ehr_launch_stu2'
4
+ require_relative 'smart_scopes_constants'
5
+ require_relative 'smart_standalone_launch_stu2_group'
6
6
  require_relative '../granular_scope_search_test'
7
7
  require_relative '../granular_scope_read_test'
8
8
  require_relative '../us_core_options'
9
- require_relative './granted_granular_scopes_test'
9
+ require_relative 'granted_granular_scopes_test'
10
10
 
11
11
  module USCoreTestKit
12
12
  class BaseSmartGranularScopesGroup < Inferno::TestGroup
@@ -54,8 +54,29 @@ module USCoreTestKit
54
54
  smart_credentials: {
55
55
  name: :granular_scopes_1_credentials
56
56
  }
57
- } )
57
+ }
58
+ )
58
59
  group from: :us_core_smart_standalone_launch_stu2,
60
+ required_suite_options: USCoreOptions::SMART_2_REQUIREMENT,
61
+ optional: true,
62
+ config: {
63
+ inputs: {
64
+ smart_credentials: {
65
+ name: :granular_scopes_1_credentials
66
+ }
67
+ }
68
+ } do
69
+ groups[1].test from: :us_core_granted_granular_scopes,
70
+ config: {
71
+ inputs: {
72
+ received_scopes: {
73
+ name: :standalone_received_scopes
74
+ }
75
+ }
76
+ }
77
+ end
78
+ group from: :us_core_smart_standalone_launch_stu2_2,
79
+ required_suite_options: USCoreOptions::SMART_2_2_REQUIREMENT,
59
80
  optional: true,
60
81
  config: {
61
82
  inputs: {
@@ -73,7 +94,28 @@ module USCoreTestKit
73
94
  }
74
95
  }
75
96
  end
97
+
76
98
  group from: :us_core_smart_ehr_launch_stu2,
99
+ required_suite_options: USCoreOptions::SMART_2_REQUIREMENT,
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
+ }
116
+ end
117
+ group from: :us_core_smart_ehr_launch_stu2_2,
118
+ required_suite_options: USCoreOptions::SMART_2_2_REQUIREMENT,
77
119
  optional: true,
78
120
  config: {
79
121
  inputs: {
@@ -113,6 +155,26 @@ module USCoreTestKit
113
155
  )
114
156
 
115
157
  group from: :us_core_smart_standalone_launch_stu2,
158
+ required_suite_options: USCoreOptions::SMART_2_REQUIREMENT,
159
+ optional: true,
160
+ config: {
161
+ inputs: {
162
+ smart_credentials: {
163
+ name: :granular_scopes_2_credentials
164
+ }
165
+ }
166
+ } do
167
+ groups[1].test from: :us_core_granted_granular_scopes,
168
+ config: {
169
+ inputs: {
170
+ received_scopes: {
171
+ name: :standalone_received_scopes
172
+ }
173
+ }
174
+ }
175
+ end
176
+ group from: :us_core_smart_standalone_launch_stu2_2,
177
+ required_suite_options: USCoreOptions::SMART_2_2_REQUIREMENT,
116
178
  optional: true,
117
179
  config: {
118
180
  inputs: {
@@ -130,9 +192,28 @@ module USCoreTestKit
130
192
  }
131
193
  }
132
194
  end
133
-
134
195
 
135
196
  group from: :us_core_smart_ehr_launch_stu2,
197
+ required_suite_options: USCoreOptions::SMART_2_REQUIREMENT,
198
+ optional: true,
199
+ config: {
200
+ inputs: {
201
+ smart_credentials: {
202
+ name: :granular_scopes_2_credentials
203
+ }
204
+ }
205
+ } do
206
+ groups[1].test from: :us_core_granted_granular_scopes,
207
+ config: {
208
+ inputs: {
209
+ received_scopes: {
210
+ name: :ehr_received_scopes
211
+ }
212
+ }
213
+ }
214
+ end
215
+ group from: :us_core_smart_ehr_launch_stu2_2,
216
+ required_suite_options: USCoreOptions::SMART_2_2_REQUIREMENT,
136
217
  optional: true,
137
218
  config: {
138
219
  inputs: {
@@ -1,18 +1,22 @@
1
1
  require 'smart_app_launch_test_kit'
2
2
  require_relative '../us_core_options'
3
- require_relative './smart_ehr_launch_stu1'
4
- require_relative './smart_ehr_launch_stu2'
5
- require_relative './smart_standalone_launch_stu1_group'
6
- require_relative './smart_standalone_launch_stu2_group'
3
+ require_relative 'smart_ehr_launch_stu1'
4
+ require_relative 'smart_ehr_launch_stu2'
5
+ require_relative 'smart_ehr_launch_stu2_2'
6
+ require_relative 'smart_standalone_launch_stu1_group'
7
+ require_relative 'smart_standalone_launch_stu2_group'
8
+ require_relative 'smart_standalone_launch_stu2_2_group'
7
9
 
8
10
  module USCoreTestKit
9
11
  class SmartAppLaunchGroup < Inferno::TestGroup
10
12
  id :us_core_smart_app_launch
11
13
  title 'SMART App Launch'
12
14
 
13
- SMART_V1_RESOURCE_LEVEL_SCOPES = "launch/patient openid fhirUser offline_access patient/Medication.read patient/AllergyIntolerance.read patient/CarePlan.read patient/CareTeam.read patient/Condition.read patient/Device.read patient/DiagnosticReport.read patient/DocumentReference.read patient/Encounter.read patient/Goal.read patient/Immunization.read patient/Location.read patient/MedicationRequest.read patient/Observation.read patient/Organization.read patient/Patient.read patient/Practitioner.read patient/Procedure.read patient/Provenance.read patient/PractitionerRole.read patient/ServiceRequest.read patient/RelatedPerson.read patient/Specimen.read patient/MedicationDispense.read patient/Coverage.read patient/Location.read patient/media.read".freeze
15
+ SMART_V1_RESOURCE_LEVEL_SCOPES = 'launch/patient openid fhirUser offline_access patient/Medication.read patient/AllergyIntolerance.read patient/CarePlan.read patient/CareTeam.read patient/Condition.read patient/Device.read patient/DiagnosticReport.read patient/DocumentReference.read patient/Encounter.read patient/Goal.read patient/Immunization.read patient/Location.read patient/MedicationRequest.read patient/Observation.read patient/Organization.read patient/Patient.read patient/Practitioner.read patient/Procedure.read patient/Provenance.read patient/PractitionerRole.read patient/ServiceRequest.read patient/RelatedPerson.read patient/Specimen.read patient/MedicationDispense.read patient/Coverage.read patient/Location.read patient/media.read'.freeze
14
16
 
15
- SMART_V2_RESOURCE_LEVEL_SCOPES = "launch/patient openid fhirUser offline_access patient/Medication.rs patient/AllergyIntolerance.rs patient/CarePlan.rs patient/CareTeam.rs patient/Condition.rs patient/Device.rs patient/DiagnosticReport.rs patient/DocumentReference.rs patient/Encounter.rs patient/Goal.rs patient/Immunization.rs patient/Location.rs patient/MedicationRequest.rs patient/Observation.rs patient/Organization.rs patient/Patient.rs patient/Practitioner.rs patient/Procedure.rs patient/Provenance.rs patient/PractitionerRole.rs patient/ServiceRequest.rs patient/RelatedPerson.rs patient/Specimen.rs patient/MedicationDispense.rs patient/Coverage.rs patient/Location.rs patient/Media.rs".freeze
17
+ SMART_V2_RESOURCE_LEVEL_SCOPES = 'launch/patient openid fhirUser offline_access patient/Medication.rs patient/AllergyIntolerance.rs patient/CarePlan.rs patient/CareTeam.rs patient/Condition.rs patient/Device.rs patient/DiagnosticReport.rs patient/DocumentReference.rs patient/Encounter.rs patient/Goal.rs patient/Immunization.rs patient/Location.rs patient/MedicationRequest.rs patient/Observation.rs patient/Organization.rs patient/Patient.rs patient/Practitioner.rs patient/Procedure.rs patient/Provenance.rs patient/PractitionerRole.rs patient/ServiceRequest.rs patient/RelatedPerson.rs patient/Specimen.rs patient/MedicationDispense.rs patient/Coverage.rs patient/Location.rs patient/Media.rs'.freeze
18
+
19
+ SMART_V2_2_RESOURCE_LEVEL_SCOPES = 'launch/patient openid fhirUser offline_access patient/Medication.rs patient/AllergyIntolerance.rs patient/CarePlan.rs patient/CareTeam.rs patient/Condition.rs patient/Device.rs patient/DiagnosticReport.rs patient/DocumentReference.rs patient/Encounter.rs patient/Goal.rs patient/Immunization.rs patient/Location.rs patient/MedicationRequest.rs patient/Observation.rs patient/Organization.rs patient/Patient.rs patient/Practitioner.rs patient/Procedure.rs patient/Provenance.rs patient/PractitionerRole.rs patient/ServiceRequest.rs patient/RelatedPerson.rs patient/Specimen.rs patient/MedicationDispense.rs patient/Coverage.rs patient/Location.rs patient/Media.rs'.freeze
16
20
 
17
21
  group from: :us_core_smart_standalone_launch_stu1,
18
22
  required_suite_options: USCoreOptions::SMART_1_REQUIREMENT,
@@ -49,5 +53,23 @@ module USCoreTestKit
49
53
  requested_scopes: { default: SmartAppLaunchGroup::SMART_V2_RESOURCE_LEVEL_SCOPES }
50
54
  }
51
55
  }
56
+
57
+ group from: :us_core_smart_standalone_launch_stu2_2,
58
+ required_suite_options: USCoreOptions::SMART_2_2_REQUIREMENT,
59
+ optional: true,
60
+ config: {
61
+ inputs: {
62
+ requested_scopes: { default: SmartAppLaunchGroup::SMART_V2_2_RESOURCE_LEVEL_SCOPES }
63
+ }
64
+ }
65
+
66
+ group from: :us_core_smart_ehr_launch_stu2_2,
67
+ required_suite_options: USCoreOptions::SMART_2_2_REQUIREMENT,
68
+ optional: true,
69
+ config: {
70
+ inputs: {
71
+ requested_scopes: { default: SmartAppLaunchGroup::SMART_V2_2_RESOURCE_LEVEL_SCOPES }
72
+ }
73
+ }
52
74
  end
53
75
  end
@@ -0,0 +1,40 @@
1
+ module USCoreTestKit
2
+ class SmartEHRLaunchSTU22 < Inferno::TestGroup
3
+ id :us_core_smart_ehr_launch_stu2_2
4
+ title 'EHR Launch'
5
+
6
+ run_as_group
7
+
8
+ group from: :smart_discovery_stu2_2,
9
+ run_as_group: true
10
+ group from: :smart_ehr_launch_stu2_2,
11
+ run_as_group: true
12
+
13
+ group from: :smart_openid_connect_stu2_2 do
14
+ run_as_group
15
+ optional
16
+ config(
17
+ inputs: {
18
+ id_token: { name: :ehr_id_token },
19
+ client_id: { name: :ehr_client_id },
20
+ requested_scopes: { name: :ehr_requested_scopes },
21
+ access_token: { name: :ehr_access_token },
22
+ smart_credentials: { name: :ehr_smart_credentials }
23
+ }
24
+ )
25
+ end
26
+
27
+ group from: :smart_token_refresh_stu2 do
28
+ run_as_group
29
+ optional
30
+ config(
31
+ inputs: {
32
+ refresh_token: { name: :ehr_refresh_token },
33
+ client_id: { name: :ehr_client_id },
34
+ client_secret: { name: :ehr_client_secret },
35
+ received_scopes: { name: :ehr_received_scopes }
36
+ }
37
+ )
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,40 @@
1
+ module USCoreTestKit
2
+ class SmartStandaloneLaunchSTU22 < Inferno::TestGroup
3
+ id :us_core_smart_standalone_launch_stu2_2
4
+ title 'Standalone Launch'
5
+
6
+ run_as_group
7
+
8
+ group from: :smart_discovery_stu2_2,
9
+ run_as_group: true
10
+ group from: :smart_standalone_launch_stu2_2,
11
+ run_as_group: true
12
+
13
+ group from: :smart_openid_connect_stu2_2 do
14
+ run_as_group
15
+ optional
16
+ config(
17
+ inputs: {
18
+ id_token: { name: :standalone_id_token },
19
+ client_id: { name: :standalone_client_id },
20
+ requested_scopes: { name: :standalone_requested_scopes },
21
+ access_token: { name: :standalone_access_token },
22
+ smart_credentials: { name: :standalone_smart_credentials }
23
+ }
24
+ )
25
+ end
26
+
27
+ group from: :smart_token_refresh_stu2 do
28
+ run_as_group
29
+ optional
30
+ config(
31
+ inputs: {
32
+ refresh_token: { name: :standalone_refresh_token },
33
+ client_id: { name: :standalone_client_id },
34
+ client_secret: { name: :standalone_client_secret },
35
+ received_scopes: { name: :standalone_received_scopes }
36
+ }
37
+ )
38
+ end
39
+ end
40
+ end
@@ -2,7 +2,7 @@ require 'tls_test_kit'
2
2
  require_relative '../capability_statement/conformance_support_test'
3
3
  require_relative '../capability_statement/fhir_version_test'
4
4
  require_relative '../capability_statement/json_support_test'
5
- require_relative './profile_support_test'
5
+ require_relative './resource_support_test'
6
6
 
7
7
  module USCoreTestKit
8
8
  module USCoreV311
@@ -100,7 +100,7 @@ module USCoreTestKit
100
100
  test from: :us_core_fhir_version
101
101
  test from: :us_core_json_support
102
102
 
103
- test from: :us_core_profile_support do
103
+ test from: :us_core_v311_resource_support do
104
104
  config(
105
105
  options: { us_core_resources: PROFILES.keys }
106
106
  )
@@ -1,7 +1,7 @@
1
1
  module USCoreTestKit
2
2
  module USCoreV311
3
3
  class ProfileSupportTest < Inferno::Test
4
- id :us_core_profile_support
4
+ id :us_core_v311_resource_support
5
5
  title 'Capability Statement lists support for required US Core Resoruce Types'
6
6
  description %(
7
7
  The US Core Implementation Guide states:
@@ -1,5 +1,5 @@
1
1
  require_relative '../smart_app_launch_group'
2
- require_relative './smart_discovery_stu2_group'
2
+ require_relative 'smart_discovery_stu2_group'
3
3
 
4
4
  module USCoreTestKit
5
5
  module USCoreV700
@@ -9,8 +9,8 @@ module USCoreTestKit
9
9
  groups[2].group from: :us_core_v700_smart_discovery_stu2
10
10
  groups[2].children[0] = groups[2].children.pop
11
11
 
12
- groups.last.group from: :us_core_v700_smart_discovery_stu2
13
- groups.last.children[0] = groups.last.children.pop
12
+ groups[3].group from: :us_core_v700_smart_discovery_stu2
13
+ groups[3].children[0] = groups[3].children.pop
14
14
  end
15
15
  end
16
16
  end
@@ -0,0 +1,16 @@
1
+ require_relative '../smart_app_launch_group'
2
+ require_relative 'smart_discovery_stu2_2_group'
3
+
4
+ module USCoreTestKit
5
+ module USCoreV700
6
+ class SmartAppLaunchSTU22Group < USCoreTestKit::SmartAppLaunchGroup
7
+ id :us_core_v700_smart_app_launch_stu2_2
8
+
9
+ groups[4].group from: :us_core_v700_smart_discovery_stu2_2
10
+ groups[4].children[0] = groups[4].children.pop
11
+
12
+ groups.last.group from: :us_core_v700_smart_discovery_stu2_2
13
+ groups.last.children[0] = groups.last.children.pop
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,11 @@
1
+ require_relative '../smart_well_known_capabilities_test'
2
+
3
+ module USCoreTestKit
4
+ module USCoreV700
5
+ class USCoreDiscoverySTU22Group < SMARTAppLaunch::DiscoverySTU22Group
6
+ id :us_core_v700_smart_discovery_stu2_2
7
+
8
+ test from: :us_core_smart_well_known_capabilities
9
+ end
10
+ end
11
+ end
@@ -57,7 +57,7 @@ module USCoreTestKit
57
57
  )
58
58
  version VERSION
59
59
 
60
- VALIDATION_MESSAGE_FILTERS = [
60
+ GENERAL_MESSAGE_FILTERS = [
61
61
  %r{Sub-extension url 'introspect' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris},
62
62
  %r{Sub-extension url 'revoke' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris},
63
63
  /Observation\.effective\.ofType\(Period\): .*vs-1:/, # Invalid invariant in FHIR v4.0.1
@@ -71,6 +71,8 @@ module USCoreTestKit
71
71
 
72
72
  VERSION_SPECIFIC_MESSAGE_FILTERS = [].freeze
73
73
 
74
+ VALIDATION_MESSAGE_FILTERS = GENERAL_MESSAGE_FILTERS + VERSION_SPECIFIC_MESSAGE_FILTERS
75
+
74
76
  def self.metadata
75
77
  @metadata ||= YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true)[:groups].map do |raw_metadata|
76
78
  Generator::GroupMetadata.new(raw_metadata)
@@ -81,7 +83,7 @@ module USCoreTestKit
81
83
 
82
84
  fhir_resource_validator do
83
85
  igs 'hl7.fhir.us.core#3.1.1'
84
- message_filters = VALIDATION_MESSAGE_FILTERS + VERSION_SPECIFIC_MESSAGE_FILTERS
86
+ message_filters = VALIDATION_MESSAGE_FILTERS
85
87
 
86
88
  exclude_message do |message|
87
89
 
@@ -107,6 +109,10 @@ module USCoreTestKit
107
109
  {
108
110
  label: 'SMART App Launch 2.0.0',
109
111
  value: USCoreOptions::SMART_2
112
+ },
113
+ {
114
+ label: 'SMART App Launch 2.2.0',
115
+ value: USCoreOptions::SMART_2_2
110
116
  }
111
117
  ]
112
118
 
@@ -59,7 +59,7 @@ module USCoreTestKit
59
59
  )
60
60
  version VERSION
61
61
 
62
- VALIDATION_MESSAGE_FILTERS = [
62
+ GENERAL_MESSAGE_FILTERS = [
63
63
  %r{Sub-extension url 'introspect' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris},
64
64
  %r{Sub-extension url 'revoke' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris},
65
65
  /Observation\.effective\.ofType\(Period\): .*vs-1:/, # Invalid invariant in FHIR v4.0.1
@@ -73,6 +73,8 @@ module USCoreTestKit
73
73
 
74
74
  VERSION_SPECIFIC_MESSAGE_FILTERS = [].freeze
75
75
 
76
+ VALIDATION_MESSAGE_FILTERS = GENERAL_MESSAGE_FILTERS + VERSION_SPECIFIC_MESSAGE_FILTERS
77
+
76
78
  def self.metadata
77
79
  @metadata ||= YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true)[:groups].map do |raw_metadata|
78
80
  Generator::GroupMetadata.new(raw_metadata)
@@ -83,7 +85,7 @@ module USCoreTestKit
83
85
 
84
86
  fhir_resource_validator do
85
87
  igs 'hl7.fhir.us.core#4.0.0'
86
- message_filters = VALIDATION_MESSAGE_FILTERS + VERSION_SPECIFIC_MESSAGE_FILTERS
88
+ message_filters = VALIDATION_MESSAGE_FILTERS
87
89
 
88
90
  exclude_message do |message|
89
91
 
@@ -109,6 +111,10 @@ module USCoreTestKit
109
111
  {
110
112
  label: 'SMART App Launch 2.0.0',
111
113
  value: USCoreOptions::SMART_2
114
+ },
115
+ {
116
+ label: 'SMART App Launch 2.2.0',
117
+ value: USCoreOptions::SMART_2_2
112
118
  }
113
119
  ]
114
120
 
@@ -69,7 +69,7 @@ module USCoreTestKit
69
69
  )
70
70
  version VERSION
71
71
 
72
- VALIDATION_MESSAGE_FILTERS = [
72
+ GENERAL_MESSAGE_FILTERS = [
73
73
  %r{Sub-extension url 'introspect' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris},
74
74
  %r{Sub-extension url 'revoke' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris},
75
75
  /Observation\.effective\.ofType\(Period\): .*vs-1:/, # Invalid invariant in FHIR v4.0.1
@@ -83,6 +83,8 @@ module USCoreTestKit
83
83
 
84
84
  VERSION_SPECIFIC_MESSAGE_FILTERS = [].freeze
85
85
 
86
+ VALIDATION_MESSAGE_FILTERS = GENERAL_MESSAGE_FILTERS + VERSION_SPECIFIC_MESSAGE_FILTERS
87
+
86
88
  def self.metadata
87
89
  @metadata ||= YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true)[:groups].map do |raw_metadata|
88
90
  Generator::GroupMetadata.new(raw_metadata)
@@ -93,7 +95,7 @@ module USCoreTestKit
93
95
 
94
96
  fhir_resource_validator do
95
97
  igs 'hl7.fhir.us.core#5.0.1'
96
- message_filters = VALIDATION_MESSAGE_FILTERS + VERSION_SPECIFIC_MESSAGE_FILTERS
98
+ message_filters = VALIDATION_MESSAGE_FILTERS
97
99
 
98
100
  exclude_message do |message|
99
101
 
@@ -119,6 +121,10 @@ module USCoreTestKit
119
121
  {
120
122
  label: 'SMART App Launch 2.0.0',
121
123
  value: USCoreOptions::SMART_2
124
+ },
125
+ {
126
+ label: 'SMART App Launch 2.2.0',
127
+ value: USCoreOptions::SMART_2_2
122
128
  }
123
129
  ]
124
130
 
@@ -18,8 +18,6 @@ module USCoreTestKit
18
18
  * DiagnosticReport.effectiveDateTime
19
19
  * DiagnosticReport.encounter
20
20
  * DiagnosticReport.issued
21
- * DiagnosticReport.media
22
- * DiagnosticReport.media.link
23
21
  * DiagnosticReport.performer
24
22
  * DiagnosticReport.presentedForm
25
23
  * DiagnosticReport.result
@@ -16,7 +16,6 @@ module USCoreTestKit
16
16
  Elements which may provide external references include:
17
17
 
18
18
  * DiagnosticReport.encounter
19
- * DiagnosticReport.media.link
20
19
  * DiagnosticReport.performer
21
20
  * DiagnosticReport.result
22
21
  * DiagnosticReport.subject
@@ -192,10 +192,6 @@
192
192
  :target_profiles:
193
193
  - http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab
194
194
  - http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-clinical-result
195
- - :path: media
196
- - :path: media.link
197
- :types:
198
- - Reference
199
195
  - :path: presentedForm
200
196
  :mandatory_elements:
201
197
  - DiagnosticReport.status
@@ -1887,10 +1887,6 @@
1887
1887
  :target_profiles:
1888
1888
  - http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab
1889
1889
  - http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-clinical-result
1890
- - :path: media
1891
- - :path: media.link
1892
- :types:
1893
- - Reference
1894
1890
  - :path: presentedForm
1895
1891
  :mandatory_elements:
1896
1892
  - DiagnosticReport.status
@@ -76,7 +76,7 @@ module USCoreTestKit
76
76
  )
77
77
  version VERSION
78
78
 
79
- VALIDATION_MESSAGE_FILTERS = [
79
+ GENERAL_MESSAGE_FILTERS = [
80
80
  %r{Sub-extension url 'introspect' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris},
81
81
  %r{Sub-extension url 'revoke' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris},
82
82
  /Observation\.effective\.ofType\(Period\): .*vs-1:/, # Invalid invariant in FHIR v4.0.1
@@ -89,11 +89,13 @@ module USCoreTestKit
89
89
  ].freeze
90
90
 
91
91
  VERSION_SPECIFIC_MESSAGE_FILTERS = [
92
- %r{Observation\.effective\.ofType\(Period\):.*http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus},
93
- %r{Observation: Slice 'Observation\.effective\[x\]:effectiveDateTime':.*http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus},
94
- %r{Observation\.effective\.ofType\(Period\).*This element is not allowed by the profile http://hl7.org/fhir/StructureDefinition/dateTime}
92
+ %r{Observation\.effective\.ofType\(Period\):.*http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus|6.1.0},
93
+ %r{Observation: Slice 'Observation\.effective\[x\]:effectiveDateTime':.*http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus|6.1.0},
94
+ %r{Observation\.effective\.ofType\(Period\)\.end: This element is not allowed by the profile http://hl7.org/fhir/StructureDefinition/dateTime}
95
95
  ].freeze
96
96
 
97
+ VALIDATION_MESSAGE_FILTERS = GENERAL_MESSAGE_FILTERS + VERSION_SPECIFIC_MESSAGE_FILTERS
98
+
97
99
  def self.metadata
98
100
  @metadata ||= YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true)[:groups].map do |raw_metadata|
99
101
  Generator::GroupMetadata.new(raw_metadata)
@@ -104,7 +106,7 @@ module USCoreTestKit
104
106
 
105
107
  fhir_resource_validator do
106
108
  igs 'hl7.fhir.us.core#6.1.0'
107
- message_filters = VALIDATION_MESSAGE_FILTERS + VERSION_SPECIFIC_MESSAGE_FILTERS
109
+ message_filters = VALIDATION_MESSAGE_FILTERS
108
110
 
109
111
  exclude_message do |message|
110
112
 
@@ -130,6 +132,10 @@ module USCoreTestKit
130
132
  {
131
133
  label: 'SMART App Launch 2.0.0',
132
134
  value: USCoreOptions::SMART_2
135
+ },
136
+ {
137
+ label: 'SMART App Launch 2.2.0',
138
+ value: USCoreOptions::SMART_2_2
133
139
  }
134
140
  ]
135
141
 
@@ -210,6 +216,9 @@ module USCoreTestKit
210
216
 
211
217
  group from: :us_core_v610_smart_granular_scopes,
212
218
  required_suite_options: USCoreOptions::SMART_2_REQUIREMENT
219
+ group from: :us_core_v610_smart_granular_scopes,
220
+ id: :us_core_v610_smart_granular_scopes_stu2_2,
221
+ required_suite_options: USCoreOptions::SMART_2_2_REQUIREMENT
213
222
 
214
223
  end
215
224
  end
@@ -18,8 +18,6 @@ module USCoreTestKit
18
18
  * DiagnosticReport.effectiveDateTime
19
19
  * DiagnosticReport.encounter
20
20
  * DiagnosticReport.issued
21
- * DiagnosticReport.media
22
- * DiagnosticReport.media.link
23
21
  * DiagnosticReport.performer
24
22
  * DiagnosticReport.presentedForm
25
23
  * DiagnosticReport.result
@@ -16,7 +16,6 @@ module USCoreTestKit
16
16
  Elements which may provide external references include:
17
17
 
18
18
  * DiagnosticReport.encounter
19
- * DiagnosticReport.media.link
20
19
  * DiagnosticReport.performer
21
20
  * DiagnosticReport.result
22
21
  * DiagnosticReport.subject
@@ -219,10 +219,6 @@
219
219
  :target_profiles:
220
220
  - http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab
221
221
  - http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-clinical-result
222
- - :path: media
223
- - :path: media.link
224
- :types:
225
- - Reference
226
222
  - :path: presentedForm
227
223
  :mandatory_elements:
228
224
  - DiagnosticReport.status
@@ -1981,10 +1981,6 @@
1981
1981
  :target_profiles:
1982
1982
  - http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab
1983
1983
  - http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-clinical-result
1984
- - :path: media
1985
- - :path: media.link
1986
- :types:
1987
- - Reference
1988
1984
  - :path: presentedForm
1989
1985
  :mandatory_elements:
1990
1986
  - DiagnosticReport.status
@@ -9,6 +9,7 @@ require_relative '../../custom_groups/v7.0.0/screening_assessment_group'
9
9
  require_relative '../../provenance_validator'
10
10
  require_relative '../../us_core_options'
11
11
  require_relative '../../custom_groups/v7.0.0/smart_app_launch_group'
12
+ require_relative '../../custom_groups/v7.0.0/smart_app_launch_stu2_2_group'
12
13
 
13
14
  require_relative 'patient_group'
14
15
  require_relative 'allergy_intolerance_group'
@@ -81,7 +82,7 @@ module USCoreTestKit
81
82
  )
82
83
  version VERSION
83
84
 
84
- VALIDATION_MESSAGE_FILTERS = [
85
+ GENERAL_MESSAGE_FILTERS = [
85
86
  %r{Sub-extension url 'introspect' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris},
86
87
  %r{Sub-extension url 'revoke' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris},
87
88
  /Observation\.effective\.ofType\(Period\): .*vs-1:/, # Invalid invariant in FHIR v4.0.1
@@ -95,6 +96,8 @@ module USCoreTestKit
95
96
 
96
97
  VERSION_SPECIFIC_MESSAGE_FILTERS = [].freeze
97
98
 
99
+ VALIDATION_MESSAGE_FILTERS = GENERAL_MESSAGE_FILTERS + VERSION_SPECIFIC_MESSAGE_FILTERS
100
+
98
101
  def self.metadata
99
102
  @metadata ||= YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true)[:groups].map do |raw_metadata|
100
103
  Generator::GroupMetadata.new(raw_metadata)
@@ -105,7 +108,7 @@ module USCoreTestKit
105
108
 
106
109
  fhir_resource_validator do
107
110
  igs 'hl7.fhir.us.core#7.0.0'
108
- message_filters = VALIDATION_MESSAGE_FILTERS + VERSION_SPECIFIC_MESSAGE_FILTERS
111
+ message_filters = VALIDATION_MESSAGE_FILTERS
109
112
 
110
113
  exclude_message do |message|
111
114
 
@@ -131,10 +134,20 @@ module USCoreTestKit
131
134
  {
132
135
  label: 'SMART App Launch 2.0.0',
133
136
  value: USCoreOptions::SMART_2
137
+ },
138
+ {
139
+ label: 'SMART App Launch 2.2.0',
140
+ value: USCoreOptions::SMART_2_2
134
141
  }
135
142
  ]
136
143
 
137
- group from: :us_core_v700_smart_app_launch
144
+ group from: :us_core_v700_smart_app_launch,
145
+ required_suite_options: USCoreOptions::SMART_1_REQUIREMENT
146
+ group from: :us_core_v700_smart_app_launch,
147
+ required_suite_options: USCoreOptions::SMART_2_REQUIREMENT,
148
+ id: :us_core_v700_smart_app_launch_stu2
149
+ group from: :us_core_v700_smart_app_launch_stu2_2,
150
+ required_suite_options: USCoreOptions::SMART_2_2_REQUIREMENT
138
151
 
139
152
  group do
140
153
  input :smart_credentials,
@@ -157,7 +170,7 @@ module USCoreTestKit
157
170
  )
158
171
 
159
172
  group from: :us_core_v700_capability_statement
160
-
173
+
161
174
  group from: :us_core_v700_patient
162
175
  group from: :us_core_v700_allergy_intolerance
163
176
  group from: :us_core_v700_care_plan
@@ -215,7 +228,10 @@ module USCoreTestKit
215
228
 
216
229
  group from: :us_core_v700_smart_granular_scopes,
217
230
  required_suite_options: USCoreOptions::SMART_2_REQUIREMENT
218
-
231
+ group from: :us_core_v700_smart_granular_scopes,
232
+ id: :us_core_v700_smart_granular_scopes_stu2_2,
233
+ required_suite_options: USCoreOptions::SMART_2_2_REQUIREMENT
234
+
219
235
  end
220
236
  end
221
237
  end
@@ -29,6 +29,7 @@ module USCoreTestKit
29
29
  add_patient_uscdi_elements
30
30
  update_smoking_status_effective
31
31
  remove_practitioner_address
32
+ remove_diagnosticreport_media
32
33
  end
33
34
 
34
35
  def add_must_support_choices
@@ -92,11 +93,18 @@ module USCoreTestKit
92
93
  must_supports[:elements] << { path: 'effective[x]' }
93
94
  end
94
95
 
96
+ # US Core v6.1.0 Patch FI-44693, Add MustSupport choice between Practitioner.address and PractitionerRole
95
97
  def remove_practitioner_address
96
98
  return unless profile.type == 'Practitioner'
97
99
 
98
100
  must_supports[:elements].delete_if { |element| element[:path].start_with?('address') }
99
101
  end
102
+
103
+ # US Core v6.1.0 Patch FI-46240, Remove the Must Support on media and media.link
104
+ def remove_diagnosticreport_media
105
+ return unless profile.id == 'us-core-diagnosticreport-note'
106
+ must_supports[:elements].delete_if { |element| element[:path].start_with?('media') }
107
+ end
100
108
  end
101
109
  end
102
110
  end
@@ -20,6 +20,7 @@ module USCoreTestKit
20
20
  us_core_6_extractor.add_patient_uscdi_elements
21
21
  add_must_support_choices
22
22
  us_core_6_extractor.remove_practitioner_address
23
+ us_core_6_extractor.remove_diagnosticreport_media
23
24
  end
24
25
 
25
26
  def add_must_support_choices
@@ -21,9 +21,9 @@ module USCoreTestKit
21
21
  case ig_metadata.reformatted_version
22
22
  when 'v610'
23
23
  [
24
- %r{Observation\.effective\.ofType\(Period\):.*http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus},
25
- %r{Observation: Slice 'Observation\.effective\[x\]:effectiveDateTime':.*http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus},
26
- %r{Observation\.effective\.ofType\(Period\).*This element is not allowed by the profile http://hl7.org/fhir/StructureDefinition/dateTime}
24
+ %r{Observation\.effective\.ofType\(Period\):.*http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus|6.1.0},
25
+ %r{Observation: Slice 'Observation\.effective\[x\]:effectiveDateTime':.*http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus|6.1.0},
26
+ %r{Observation\.effective\.ofType\(Period\)\.end: This element is not allowed by the profile http://hl7.org/fhir/StructureDefinition/dateTime}
27
27
  ]
28
28
  else
29
29
  []
@@ -84,7 +84,7 @@ module USCoreTestKit
84
84
  end
85
85
 
86
86
  def generate
87
- File.open(output_file_name, 'w') { |f| f.write(output) }
87
+ File.write(output_file_name, output)
88
88
  end
89
89
 
90
90
  def groups
@@ -146,6 +146,10 @@ module USCoreTestKit
146
146
  "../../custom_groups/#{ig_metadata.ig_version}/smart_app_launch_group"
147
147
  end
148
148
 
149
+ def stu2_2_smart_app_launch_file_name
150
+ "../../custom_groups/#{ig_metadata.ig_version}/smart_app_launch_stu2_2_group"
151
+ end
152
+
149
153
  def smart_app_launch_id
150
154
  if us_core_7_and_above?
151
155
  "us_core_#{ig_metadata.reformatted_version}_smart_app_launch"
@@ -1,10 +1,11 @@
1
1
  module USCoreTestKit
2
- module USCoreOptions
3
- SMART_1 = 'smart_app_launch_1'.freeze
4
- SMART_2 = 'smart_app_launch_2'.freeze
5
-
6
- SMART_1_REQUIREMENT = { smart_app_launch_version: SMART_1 }.freeze
7
- SMART_2_REQUIREMENT = { smart_app_launch_version: SMART_2 }.freeze
8
- end
2
+ module USCoreOptions
3
+ SMART_1 = 'smart_app_launch_1'.freeze
4
+ SMART_2 = 'smart_app_launch_2'.freeze
5
+ SMART_2_2 = 'smart_app_launch_2_2'.freeze
6
+
7
+ SMART_1_REQUIREMENT = { smart_app_launch_version: SMART_1 }.freeze
8
+ SMART_2_REQUIREMENT = { smart_app_launch_version: SMART_2 }.freeze
9
+ SMART_2_2_REQUIREMENT = { smart_app_launch_version: SMART_2_2 }.freeze
9
10
  end
10
-
11
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module USCoreTestKit
4
- VERSION = '0.8.2'
4
+ VERSION = '0.9.0'
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.8.2
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen MacVicar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-03 00:00:00.000000000 Z
11
+ date: 2024-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inferno_core
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.4.0
33
+ version: 0.4.6
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 0.4.0
40
+ version: 0.4.6
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: tls_test_kit
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -131,13 +131,15 @@ files:
131
131
  - lib/us_core_test_kit/custom_groups/smart_app_launch_group.rb
132
132
  - lib/us_core_test_kit/custom_groups/smart_ehr_launch_stu1.rb
133
133
  - lib/us_core_test_kit/custom_groups/smart_ehr_launch_stu2.rb
134
+ - lib/us_core_test_kit/custom_groups/smart_ehr_launch_stu2_2.rb
134
135
  - lib/us_core_test_kit/custom_groups/smart_scopes_constants.rb
135
136
  - lib/us_core_test_kit/custom_groups/smart_standalone_launch_stu1_group.rb
137
+ - lib/us_core_test_kit/custom_groups/smart_standalone_launch_stu2_2_group.rb
136
138
  - lib/us_core_test_kit/custom_groups/smart_standalone_launch_stu2_group.rb
137
139
  - lib/us_core_test_kit/custom_groups/smart_well_known_capabilities_test.rb
138
140
  - lib/us_core_test_kit/custom_groups/v3.1.1/capability_statement_group.rb
139
141
  - lib/us_core_test_kit/custom_groups/v3.1.1/clinical_notes_guidance_group.rb
140
- - lib/us_core_test_kit/custom_groups/v3.1.1/profile_support_test.rb
142
+ - lib/us_core_test_kit/custom_groups/v3.1.1/resource_support_test.rb
141
143
  - lib/us_core_test_kit/custom_groups/v4.0.0/capability_statement_group.rb
142
144
  - lib/us_core_test_kit/custom_groups/v4.0.0/clinical_notes_guidance_group.rb
143
145
  - lib/us_core_test_kit/custom_groups/v4.0.0/document_reference_custodian_test.rb
@@ -148,6 +150,8 @@ files:
148
150
  - lib/us_core_test_kit/custom_groups/v7.0.0/capability_statement_group.rb
149
151
  - lib/us_core_test_kit/custom_groups/v7.0.0/screening_assessment_group.rb
150
152
  - lib/us_core_test_kit/custom_groups/v7.0.0/smart_app_launch_group.rb
153
+ - lib/us_core_test_kit/custom_groups/v7.0.0/smart_app_launch_stu2_2_group.rb
154
+ - lib/us_core_test_kit/custom_groups/v7.0.0/smart_discovery_stu2_2_group.rb
151
155
  - lib/us_core_test_kit/custom_groups/v7.0.0/smart_discovery_stu2_group.rb
152
156
  - lib/us_core_test_kit/custom_groups/v7.0.0/smart_granular_scopes_group.rb
153
157
  - lib/us_core_test_kit/date_search_validation.rb