us_core_test_kit 0.9.2 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/config/presets/inferno_reference_server_311_preset.json +66 -0
  3. data/config/presets/inferno_reference_server_400_preset.json +66 -0
  4. data/config/presets/inferno_reference_server_501_preset.json +66 -0
  5. data/config/presets/inferno_reference_server_610_preset.json +66 -0
  6. data/config/presets/inferno_reference_server_700_preset.json +66 -0
  7. data/lib/us_core_test_kit/custom_groups/smart_app_launch_group.rb +3 -3
  8. data/lib/us_core_test_kit/generated/v3.1.1/us_core_test_suite.rb +18 -1
  9. data/lib/us_core_test_kit/generated/v4.0.0/us_core_test_suite.rb +18 -1
  10. data/lib/us_core_test_kit/generated/v5.0.1/us_core_test_suite.rb +18 -1
  11. data/lib/us_core_test_kit/generated/v6.1.0/condition_granular_scope1_group.rb +1 -1
  12. data/lib/us_core_test_kit/generated/v6.1.0/condition_granular_scope2_group.rb +1 -1
  13. data/lib/us_core_test_kit/generated/v6.1.0/observation_granular_scope1_group.rb +1 -1
  14. data/lib/us_core_test_kit/generated/v6.1.0/observation_granular_scope2_group.rb +1 -1
  15. data/lib/us_core_test_kit/generated/v6.1.0/us_core_test_suite.rb +18 -1
  16. data/lib/us_core_test_kit/generated/v7.0.0/condition_granular_scope1_group.rb +1 -1
  17. data/lib/us_core_test_kit/generated/v7.0.0/condition_granular_scope2_group.rb +1 -1
  18. data/lib/us_core_test_kit/generated/v7.0.0/observation_granular_scope1_group.rb +1 -1
  19. data/lib/us_core_test_kit/generated/v7.0.0/observation_granular_scope2_group.rb +1 -1
  20. data/lib/us_core_test_kit/generated/v7.0.0/us_core_test_suite.rb +18 -1
  21. data/lib/us_core_test_kit/generator/granular_scope_resource_type_group_generator.rb +1 -1
  22. data/lib/us_core_test_kit/generator/templates/granular_scope_group.rb.erb +41 -0
  23. data/lib/us_core_test_kit/generator/templates/granular_scope_read_test.rb.erb +29 -0
  24. data/lib/us_core_test_kit/generator/templates/granular_scope_resource_type_group.rb.erb +19 -0
  25. data/lib/us_core_test_kit/generator/templates/granular_scope_test.rb.erb +38 -0
  26. data/lib/us_core_test_kit/generator/templates/group.rb.erb +24 -0
  27. data/lib/us_core_test_kit/generator/templates/must_support.rb.erb +41 -0
  28. data/lib/us_core_test_kit/generator/templates/practitioner_address_test.rb.erb +32 -0
  29. data/lib/us_core_test_kit/generator/templates/provenance_revinclude_search.rb.erb +50 -0
  30. data/lib/us_core_test_kit/generator/templates/read.rb.erb +26 -0
  31. data/lib/us_core_test_kit/generator/templates/reference_resolution.rb.erb +40 -0
  32. data/lib/us_core_test_kit/generator/templates/search.rb.erb +46 -0
  33. data/lib/us_core_test_kit/generator/templates/suite.rb.erb +160 -0
  34. data/lib/us_core_test_kit/generator/templates/validation.rb.erb +31 -0
  35. data/lib/us_core_test_kit/igs/README.md +21 -0
  36. data/lib/us_core_test_kit/metadata.rb +70 -0
  37. data/lib/us_core_test_kit/reference_resolution_test.rb +1 -16
  38. data/lib/us_core_test_kit/version.rb +2 -1
  39. data/lib/us_core_test_kit.rb +1 -0
  40. metadata +31 -10
@@ -0,0 +1,41 @@
1
+ <% group_file_list.each do |file| %>require_relative '<%= file %>'
2
+ <% end %>
3
+ module USCoreTestKit
4
+ module <%= module_name %>
5
+ class SmartGranularScopes<%= group_number %>Group < Inferno::TestGroup
6
+ id :<%= group_id %>
7
+ title 'US Core FHIR API w/Granular Scopes <%= group_number %>'
8
+
9
+ description %(
10
+ <%= description %>
11
+ )
12
+
13
+ input :granular_scopes_<%= group_number %>_credentials,
14
+ title: 'SMART Credentials for Granular Scopes <%= group_number %>',
15
+ type: :oauth_credentials,
16
+ locked: true
17
+
18
+ config(
19
+ inputs: {
20
+ patient_ids: {
21
+ locked: true
22
+ },
23
+ received_scopes: {
24
+ title: 'Received Scopes',
25
+ locked: true
26
+ },
27
+ url: {
28
+ locked: true
29
+ }
30
+ }
31
+ )
32
+
33
+ fhir_client do
34
+ oauth_credentials :granular_scopes_<%= group_number %>_credentials
35
+ url :url
36
+ end
37
+ <% group_id_list.each do |group_id| %>
38
+ group from: :<%= group_id %><% end %>
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,29 @@
1
+ require_relative '../../../../generator/group_metadata'
2
+ require_relative '../../../../granular_scope_read_test'
3
+
4
+ module USCoreTestKit
5
+ module <%= module_name %>
6
+ class <%= class_name %> < Inferno::Test
7
+ include USCoreTestKit::GranularScopeReadTest
8
+
9
+ title 'Server filters results for <%= resource_type %> reads based on granular scopes'
10
+ description %(
11
+ <%= description %>
12
+ )
13
+
14
+ id :<%= test_id %>
15
+
16
+ def resource_type
17
+ '<%= resource_type %>'
18
+ end
19
+
20
+ def self.metadata
21
+ @metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
22
+ end
23
+
24
+ run do
25
+ run_scope_read_test
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,19 @@
1
+ <% test_file_list.each do |file_name| %>require_relative '<%= file_name %>'
2
+ <% end %>
3
+ module USCoreTestKit
4
+ module <%= module_name %>
5
+ class <%= class_name %> < Inferno::TestGroup
6
+ title '<%= title %> Tests'
7
+ short_description '<%= short_description %>'
8
+ description %(
9
+ <%= description %>
10
+ )
11
+
12
+ id :<%= group_id %>
13
+ run_as_group
14
+
15
+ <% test_id_list.each do |id| %>
16
+ test from: :<%= id %><% end %>
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,38 @@
1
+ require_relative '../../../../search_test'
2
+ require_relative '../../../../generator/group_metadata'
3
+ require_relative '../../../../granular_scope_search_test'
4
+
5
+ module USCoreTestKit
6
+ module <%= module_name %>
7
+ class <%= class_name %> < Inferno::Test
8
+ include USCoreTestKit::SearchTest
9
+ include USCoreTestKit::GranularScopeSearchTest
10
+
11
+ title 'Server filters results for <%= resource_type %> search by <%= search_param_name_string %> based on granular scopes'
12
+ description %(
13
+ <%= description %>
14
+ )
15
+
16
+ id :<%= test_id %><% if optional? %>
17
+ optional
18
+ <% end %><% if needs_patient_id? %>
19
+ input :patient_ids,
20
+ title: 'Patient IDs',
21
+ description: 'Comma separated list of patient IDs that in sum contain all MUST SUPPORT elements'
22
+ <% end %>
23
+ def self.properties
24
+ @properties ||= SearchTestProperties.new(
25
+ <%= search_test_properties_string %>
26
+ )
27
+ end
28
+
29
+ def self.metadata
30
+ @metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
31
+ end
32
+
33
+ run do
34
+ run_scope_search_test
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,24 @@
1
+ <% test_file_list.each do |file_name| %>require_relative '<%= file_name %>'
2
+ <% end %>
3
+ module USCoreTestKit
4
+ module <%= module_name %>
5
+ class <%= class_name %> < Inferno::TestGroup
6
+ title '<%= title %> Tests'
7
+ short_description '<%= short_description %>'
8
+ description %(
9
+ <%= description %>
10
+ )
11
+
12
+ id :<%= group_id %>
13
+ run_as_group<% if optional? %>
14
+ optional
15
+ <% end %>
16
+
17
+ def self.metadata
18
+ @metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, '<%= profile_identifier %>', 'metadata.yml'), aliases: true))
19
+ end
20
+ <% test_id_list.each do |id| %>
21
+ test from: :<%= id %><% end %>
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,41 @@
1
+ require_relative '../../../must_support_test'
2
+
3
+ module USCoreTestKit
4
+ module <%= module_name %>
5
+ class <%= class_name %> < Inferno::Test
6
+ include USCoreTestKit::MustSupportTest
7
+
8
+ title 'All must support elements are provided in the <%= resource_type %> resources returned'
9
+ description %(
10
+ US Core Responders SHALL be capable of populating all data elements as
11
+ part of the query results as specified by the US Core Server Capability
12
+ Statement. This test will look through the <%= resource_type %> resources
13
+ found previously for the following must support elements:
14
+
15
+ <%= must_support_list_string %><% if uscdi_list_string.present? %>
16
+
17
+ For ONC USCDI requirements, each <%= resource_type %> must support the following additional elements:
18
+
19
+ <%= uscdi_list_string %><% end %>
20
+ )
21
+
22
+ id :<%= test_id %>
23
+
24
+ def resource_type
25
+ '<%= resource_type %>'
26
+ end
27
+
28
+ def self.metadata
29
+ @metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
30
+ end
31
+
32
+ def scratch_resources
33
+ scratch[:<%= profile_identifier %>_resources] ||= {}
34
+ end
35
+
36
+ run do
37
+ perform_must_support_test(<%= resource_collection_string %>)
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,32 @@
1
+ require_relative '../../../practitioner_address_test'
2
+
3
+ module USCoreTestKit
4
+ module <%= module_name %>
5
+ class <%= class_name %> < Inferno::Test
6
+ include USCoreTestKit::PractitionerAddressTest
7
+
8
+ title 'Server support either Practitioner.address or PractitionerRole'
9
+ description %(
10
+ US Core Responders SHALL support either US Core PractitionerRole Profile or
11
+ these data elements in US Core Practitioner Profile
12
+
13
+ * Practitioner.address
14
+ * Practitioner.address.city
15
+ * Practitioner.address.country
16
+ * Practitioner.address.line
17
+ * Practitioner.address.postalCode
18
+ * Practitioner.address.state
19
+ )
20
+
21
+ id :<%= test_id %>
22
+
23
+ def self.metadata
24
+ @metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
25
+ end
26
+
27
+ run do
28
+ verify_practitioner_address
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,50 @@
1
+ require_relative '../../../search_test'
2
+ require_relative '../../../generator/group_metadata'
3
+
4
+ module USCoreTestKit
5
+ module <%= module_name %>
6
+ class <%= class_name %> < Inferno::Test
7
+ include USCoreTestKit::SearchTest
8
+
9
+ title 'Server returns Provenance resources from <%= resource_type %> search by <%= search_param_name_string %>'
10
+ description %(
11
+ A server SHALL be capable of supporting _revIncludes:Provenance:target.
12
+
13
+ This test will perform a search by <%= search_param_name_string %> and
14
+ will pass if a Provenance resource is found in the response.
15
+ %)
16
+
17
+ id :<%= test_id %>
18
+ <% if needs_patient_id? %>
19
+ input :patient_ids,
20
+ title: 'Patient IDs',
21
+ description: 'Comma separated list of patient IDs that in sum contain all MUST SUPPORT elements'
22
+ <% end %>
23
+ def properties
24
+ @properties ||= SearchTestProperties.new(
25
+ <%= search_test_properties_string %>
26
+ )
27
+ end
28
+
29
+ def self.metadata
30
+ @metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml')))
31
+ end
32
+
33
+ def self.provenance_metadata
34
+ @provenance_metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, '..', 'provenance', 'metadata.yml'), aliases: true))
35
+ end
36
+
37
+ def scratch_resources
38
+ scratch[:<%= profile_identifier %>_resources] ||= {}
39
+ end
40
+
41
+ def scratch_provenance_resources
42
+ scratch[:provenance_resources] ||= {}
43
+ end
44
+
45
+ run do
46
+ run_provenance_revinclude_search_test
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,26 @@
1
+ require_relative '../../../read_test'
2
+
3
+ module USCoreTestKit
4
+ module <%= module_name %>
5
+ class <%= class_name %> < Inferno::Test
6
+ include USCoreTestKit::ReadTest
7
+
8
+ title 'Server returns correct <%= resource_type %> resource from <%= resource_type %> read interaction'
9
+ description 'A server <%= conformance_expectation %> support the <%= resource_type %> read interaction.'
10
+
11
+ id :<%= test_id %>
12
+
13
+ def resource_type
14
+ '<%= resource_type %>'
15
+ end
16
+
17
+ def scratch_resources
18
+ scratch[:<%= profile_identifier %>_resources] ||= {}
19
+ end
20
+
21
+ run do
22
+ perform_read_test(<%= resource_collection_string %>)
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,40 @@
1
+ require_relative '../../../reference_resolution_test'
2
+
3
+ module USCoreTestKit
4
+ module <%= module_name %>
5
+ class <%= class_name %> < Inferno::Test
6
+ include USCoreTestKit::ReferenceResolutionTest
7
+
8
+ title 'MustSupport references within <%= resource_type %> resources are valid'
9
+ description %(
10
+ This test will attempt to read external references provided within elements
11
+ marked as 'MustSupport', if any are available.
12
+
13
+ It verifies that at least one external reference for each MustSupport Reference element
14
+ can be accessed by the test client, and conforms to corresponding US Core profile.
15
+
16
+ Elements which may provide external references include:
17
+
18
+ <%= must_support_reference_list_string %>
19
+ )
20
+
21
+ id :<%= test_id %>
22
+
23
+ def resource_type
24
+ '<%= resource_type %>'
25
+ end
26
+
27
+ def self.metadata
28
+ @metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
29
+ end
30
+
31
+ def scratch_resources
32
+ scratch[:<%= profile_identifier %>_resources] ||= {}
33
+ end
34
+
35
+ run do
36
+ perform_reference_resolution_test(<%= resource_collection_string %>)
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,46 @@
1
+ require_relative '../../../search_test'
2
+ require_relative '../../../generator/group_metadata'
3
+
4
+ module USCoreTestKit
5
+ module <%= module_name %>
6
+ class <%= class_name %> < Inferno::Test
7
+ include USCoreTestKit::SearchTest
8
+
9
+ title 'Server returns valid results for <%= resource_type %> search by <%= search_param_name_string %>'
10
+ description %(
11
+ <%= description %>
12
+ )
13
+
14
+ id :<%= test_id %><% if optional? %>
15
+ optional
16
+ <% end %><% if needs_patient_id? %>
17
+ input :patient_ids,
18
+ title: 'Patient IDs',
19
+ description: 'Comma separated list of patient IDs that in sum contain all MUST SUPPORT elements'
20
+ <% end %><% if resource_type == 'Device' %>
21
+ input :implantable_device_codes,
22
+ title: 'Implantable Device Type Code',
23
+ description: 'Enter the code for an Implantable Device type, or multiple codes separated by commas. '\
24
+ 'If blank, Inferno will validate all Device resources against the Implantable Device profile',
25
+ optional: true
26
+ <% end %>
27
+ def self.properties
28
+ @properties ||= SearchTestProperties.new(
29
+ <%= search_test_properties_string %>
30
+ )
31
+ end
32
+
33
+ def self.metadata
34
+ @metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
35
+ end
36
+
37
+ def scratch_resources
38
+ scratch[:<%= profile_identifier %>_resources] ||= {}
39
+ end
40
+
41
+ run do
42
+ run_search_test
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,160 @@
1
+ require 'inferno/dsl/oauth_credentials'
2
+ require_relative '../../version'
3
+ require_relative '<%= capability_statement_file_name %>'
4
+ require_relative '<%= clinical_notes_guidance_file_name %>'
5
+ require_relative '../../custom_groups/data_absent_reason_group'
6
+ require_relative '../../custom_groups/smart_app_launch_group'<% if us_core_6_and_above? %>
7
+ require_relative '<%= granular_scopes_file_name %>'
8
+ require_relative '<%= screening_assessment_file_name %>'<% end %>
9
+ require_relative '../../provenance_validator'
10
+ require_relative '../../us_core_options'<% if us_core_7_and_above? %>
11
+ require_relative '<%= smart_app_launch_file_name %>'
12
+ require_relative '<%= stu2_2_smart_app_launch_file_name %>'<% end %>
13
+
14
+ <% group_file_list.each do |file_name| %>require_relative '<%= file_name %>'
15
+ <% end %>
16
+ module USCoreTestKit
17
+ module <%= module_name %>
18
+ class <%= class_name %> < Inferno::TestSuite
19
+ title '<%= title %>'
20
+ description %(
21
+ The US Core Test Kit tests systems for their conformance to the [US Core
22
+ Implementation Guide](<%=ig_link %>).
23
+
24
+ HL7® FHIR® resources are validated with the Java validator using
25
+ `tx.fhir.org` as the terminology server. Users should note that the
26
+ although the ONC Certification (g)(10) Standardized API Test Suite
27
+ includes tests from this suite, [it uses a different method to perform
28
+ terminology
29
+ validation](https://github.com/onc-healthit/onc-certification-g10-test-kit/wiki/FAQ#q-why-do-some-resources-fail-in-us-core-test-kit-with-terminology-validation-errors).
30
+ As a result, resource validation results may not be consistent between
31
+ the US Core Test Suite and the ONC Certification (g)(10) Standardized
32
+ API Test Suite.
33
+ )
34
+
35
+ GENERAL_MESSAGE_FILTERS = [
36
+ %r{Sub-extension url 'introspect' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris},
37
+ %r{Sub-extension url 'revoke' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris},
38
+ /Observation\.effective\.ofType\(Period\): .*vs-1:/, # Invalid invariant in FHIR v4.0.1
39
+ /Observation\.effective\.ofType\(Period\): .*us-core-1:/, # Invalid invariant in US Core v3.1.1
40
+ /Provenance.agent\[\d*\]: Constraint failed: provenance-1/, #Invalid invariant in US Core v5.0.1
41
+ %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
42
+ %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
43
+ /\A\S+: \S+: URL value '.*' does not resolve/,
44
+ %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
45
+ ].freeze
46
+ <% if version_specific_message_filters.empty? %>
47
+ VERSION_SPECIFIC_MESSAGE_FILTERS = [].freeze
48
+ <% else %>
49
+ VERSION_SPECIFIC_MESSAGE_FILTERS = [
50
+ <%= version_specific_message_filters.map { |filter| "%r{#{filter.source}}" }.join(",\n ") %>
51
+ ].freeze
52
+ <% end %>
53
+ VALIDATION_MESSAGE_FILTERS = GENERAL_MESSAGE_FILTERS + VERSION_SPECIFIC_MESSAGE_FILTERS
54
+
55
+ def self.metadata
56
+ @metadata ||= YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true)[:groups].map do |raw_metadata|
57
+ Generator::GroupMetadata.new(raw_metadata)
58
+ end
59
+ end
60
+
61
+ id :<%= suite_id %>
62
+
63
+ fhir_resource_validator do
64
+ igs '<%= ig_identifier %>'
65
+ message_filters = VALIDATION_MESSAGE_FILTERS
66
+
67
+ exclude_message do |message|
68
+
69
+ message_filters.any? { |filter| filter.match? message.message }
70
+ end
71
+
72
+ perform_additional_validation do |resource, profile_url|
73
+ ProvenanceValidator.validate(resource) if resource.instance_of?(FHIR::Provenance)
74
+ end
75
+ end
76
+
77
+ input :url,
78
+ title: 'FHIR Endpoint',
79
+ description: 'URL of the FHIR endpoint'
80
+
81
+ suite_option :smart_app_launch_version,
82
+ title: 'SMART App Launch Version',
83
+ list_options: [
84
+ {
85
+ label: 'SMART App Launch 1.0.0',
86
+ value: USCoreOptions::SMART_1
87
+ },
88
+ {
89
+ label: 'SMART App Launch 2.0.0',
90
+ value: USCoreOptions::SMART_2
91
+ },
92
+ {
93
+ label: 'SMART App Launch 2.2.0',
94
+ value: USCoreOptions::SMART_2_2
95
+ }
96
+ ]
97
+
98
+ group from: :<%= smart_app_launch_id %><% if us_core_7_and_above? %>,
99
+ required_suite_options: USCoreOptions::SMART_1_REQUIREMENT
100
+ group from: :<%= smart_app_launch_id %>,
101
+ required_suite_options: USCoreOptions::SMART_2_REQUIREMENT,
102
+ id: :<%= smart_app_launch_id %>_stu2
103
+ group from: :<%= smart_app_launch_id %>_stu2_2,
104
+ required_suite_options: USCoreOptions::SMART_2_2_REQUIREMENT<% end %>
105
+
106
+ group do
107
+ input :smart_credentials,
108
+ title: 'OAuth Credentials',
109
+ type: :oauth_credentials,
110
+ optional: true
111
+
112
+ fhir_client do
113
+ url :url
114
+ oauth_credentials :smart_credentials
115
+ end
116
+
117
+ title 'US Core FHIR API'
118
+ id :<%= fhir_api_group_id %><% if us_core_6_and_above? %>
119
+
120
+ config(
121
+ options: {
122
+ tag_requests: true
123
+ }
124
+ )<% end %>
125
+
126
+ group from: :<%= capability_statement_group_id %>
127
+ <% group_id_list.each do |id| %>
128
+ group from: :<%= id %><% end %>
129
+ group from: :<%= clinical_notes_guidance_group_id %><%if us_core_6_and_above? %>
130
+ group from: :<%= screening_assessment_id %><% end %>
131
+ group from: :us_core_311_data_absent_reason
132
+ end<% if us_core_6_and_above? %>
133
+
134
+ group from: :<%= granular_scopes_id %>,
135
+ required_suite_options: USCoreOptions::SMART_2_REQUIREMENT
136
+ group from: :<%= granular_scopes_id %>,
137
+ id: :<%= granular_scopes_id %>_stu2_2,
138
+ required_suite_options: USCoreOptions::SMART_2_2_REQUIREMENT
139
+ <% end %>
140
+
141
+ links [
142
+ {
143
+ type: 'report_issue',
144
+ label: 'Report Issue',
145
+ url: 'https://github.com/inferno-framework/us-core-test-kit/issues/'
146
+ },
147
+ {
148
+ type: 'source_code',
149
+ label: 'Open Source',
150
+ url: 'https://github.com/inferno-framework/us-core-test-kit/'
151
+ },
152
+ {
153
+ type: 'download',
154
+ label: 'Download',
155
+ url: 'https://github.com/inferno-framework/us-core-test-kit/releases/'
156
+ }
157
+ ]
158
+ end
159
+ end
160
+ end
@@ -0,0 +1,31 @@
1
+ require_relative '../../../validation_test'
2
+
3
+ module USCoreTestKit
4
+ module <%= module_name %>
5
+ class <%= class_name %> < Inferno::Test
6
+ include USCoreTestKit::ValidationTest
7
+
8
+ id :<%= test_id %>
9
+ title '<%= resource_type %> resources returned during previous tests conform to the <%= profile_name %>'
10
+ description %(
11
+ <%= description %>
12
+ )
13
+ output :dar_code_found, :dar_extension_found
14
+
15
+ def resource_type
16
+ '<%= resource_type %>'
17
+ end
18
+
19
+ def scratch_resources
20
+ scratch[:<%= profile_identifier %>_resources] ||= {}
21
+ end
22
+
23
+ run do
24
+ perform_validation_test(scratch_resources[:all] || [],
25
+ '<%= profile_url %>',
26
+ '<%= profile_version %>',
27
+ skip_if_empty: <%= skip_if_empty %>)
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,21 @@
1
+ # Note on this IGs folder
2
+
3
+ There are three reasons why it would be necessary to put an IG package.tgz in this folder. If none of these apply, you do not need to put any files here, or can consider removing any existing files to make it clear they are unused.
4
+
5
+ ## 1. Generated Test Suites
6
+ Some test kits use a "generator" to automatically generate the contents of a test suite for an IG. The IG files are required every time the test suites need to be regenerated. Examples of test kits that use this approach are the US Core Test Kit and CARIN IG for Blue Button® Test Kit.
7
+
8
+
9
+ ## 2. Non-published IG
10
+ If your IG, or the specific version of the IG you want to test against, is not published, then the validator service needs to load the IG from file in order to be able to validate resources with it. The IG must be referenced in the `fhir_resource_validator` block in the test suite definition by filename, ie:
11
+
12
+ ```ruby
13
+ fhir_resource_validator do
14
+ igs 'igs/filename.tgz'
15
+
16
+ ...
17
+ end
18
+ ```
19
+
20
+ ## 3. Inferno Validator UI
21
+ The Inferno Validator UI is configured to auto-load any IGs present in the igs folder and include them in all validations. The Inferno Validator UI is currently disabled by default, so this is only relevant if you choose to re-enable it. In general, the Inferno team is currently leaving IGs in this folder even if not otherwise necessary to make it easy to re-enable the validator UI.