Skip to content

Commit

Permalink
fix importing to not alter the imported groups
Browse files Browse the repository at this point in the history
  • Loading branch information
Jammjammjamm committed Feb 6, 2025
1 parent 1a958fa commit b89831a
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 84 deletions.
33 changes: 17 additions & 16 deletions lib/onc_certification_g10_test_kit/single_patient_api_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,24 +111,25 @@ class SinglePatientAPIGroup < Inferno::TestGroup
end
end

USCoreTestKit::USCoreV311::USCoreTestSuite.groups[1].groups.each do |group|
test_group = group.ancestors[1]

next if test_group.optional?

id = test_group.id

group_config = {}
if test_group.respond_to?(:metadata) &&
test_group.metadata.delayed? &&
!test_group.metadata.searchable_delayed_resource?
test_group.children.reject! { |child| child.include? USCoreTestKit::SearchTest }
group_config[:options] = { read_all_resources: true }
USCoreTestKit::USCoreV311::USCoreTestSuite
.groups
.find { |g| g.title == 'US Core FHIR API' }
.groups
.each do |group|
test_group = group.ancestors[1]

next if test_group.optional?

group(from: test_group.id, exclude_optional: true)

if test_group.respond_to?(:metadata) && # rubocop:disable Style/Next
test_group.metadata.delayed? &&
!test_group.metadata.searchable_delayed_resource?
groups.last.children.reject! { |child| child.include? USCoreTestKit::SearchTest }
groups.last.config(options: { read_all_resources: true })
end
end

group(from: id, exclude_optional: true, config: group_config)
end

groups.first.description %(
The Capability Statement test verifies a FHIR server's ability support the
[capabilities
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,24 +123,25 @@ class SinglePatientUSCore4APIGroup < Inferno::TestGroup
end
end

USCoreTestKit::USCoreV400::USCoreTestSuite.groups[1].groups.each do |group|
test_group = group.ancestors[1]

next if test_group.optional?

id = test_group.id

group_config = {}
if test_group.respond_to?(:metadata) &&
test_group.metadata.delayed? &&
!test_group.metadata.searchable_delayed_resource?
test_group.children.reject! { |child| child.include? USCoreTestKit::SearchTest }
group_config[:options] = { read_all_resources: true }
USCoreTestKit::USCoreV400::USCoreTestSuite
.groups
.find { |g| g.title == 'US Core FHIR API' }
.groups
.each do |group|
test_group = group.ancestors[1]

next if test_group.optional?

group(from: test_group.id, exclude_optional: true)

if test_group.respond_to?(:metadata) && # rubocop:disable Style/Next
test_group.metadata.delayed? &&
!test_group.metadata.searchable_delayed_resource?
groups.last.children.reject! { |child| child.include? USCoreTestKit::SearchTest }
groups.last.config(options: { read_all_resources: true })
end
end

group(from: id, exclude_optional: true, config: group_config)
end

groups.first.description %(
The Capability Statement test verifies a FHIR server's ability support the
[capabilities
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,24 +137,25 @@ def self.user_runnable?
end
end

USCoreTestKit::USCoreV501::USCoreTestSuite.groups[1].groups.each do |group|
test_group = group.ancestors[1]

next if test_group.optional?

id = test_group.id

group_config = {}
if test_group.respond_to?(:metadata) &&
test_group.metadata.delayed? &&
!test_group.metadata.searchable_delayed_resource?
test_group.children.reject! { |child| child.include? USCoreTestKit::SearchTest }
group_config[:options] = { read_all_resources: true }
USCoreTestKit::USCoreV501::USCoreTestSuite
.groups
.find { |g| g.title == 'US Core FHIR API' }
.groups
.each do |group|
test_group = group.ancestors[1]

next if test_group.optional?

group(from: test_group.id, exclude_optional: true)

if test_group.respond_to?(:metadata) && # rubocop:disable Style/Next
test_group.metadata.delayed? &&
!test_group.metadata.searchable_delayed_resource?
groups.last.children.reject! { |child| child.include? USCoreTestKit::SearchTest }
groups.last.config(options: { read_all_resources: true })
end
end

group(from: id, exclude_optional: true, config: group_config)
end

groups.first.description %(
The Capability Statement test verifies a FHIR server's ability support the
[capabilities
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,27 +166,28 @@ class SinglePatientUSCore6APIGroup < Inferno::TestGroup
end
end

USCoreTestKit::USCoreV610::USCoreTestSuite.groups[1].groups.each do |group|
test_group = group.ancestors[1]

next if test_group.optional?

id = test_group.id

group_config = {}
if test_group.respond_to?(:metadata) &&
test_group.metadata.delayed? &&
!test_group.metadata.searchable_delayed_resource?
test_group.children.reject! do |child|
child.include?(USCoreTestKit::SearchTest) &&
!child.include?(USCoreTestKit::PractitionerAddressTest)
USCoreTestKit::USCoreV610::USCoreTestSuite
.groups
.find { |g| g.title == 'US Core FHIR API' }
.groups
.each do |group|
test_group = group.ancestors[1]

next if test_group.optional?

group(from: test_group.id, exclude_optional: true)

if test_group.respond_to?(:metadata) && # rubocop:disable Style/Next
test_group.metadata.delayed? &&
!test_group.metadata.searchable_delayed_resource?
groups.last.children.reject! do |child|
child.include?(USCoreTestKit::SearchTest) &&
!child.include?(USCoreTestKit::PractitionerAddressTest)
end
groups.last.config(options: { read_all_resources: true })
end
group_config[:options] = { read_all_resources: true }
end

group(from: id, exclude_optional: true, config: group_config)
end

groups.first.description %(
The Capability Statement test verifies a FHIR server's ability support the
[capabilities
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,27 +171,28 @@ class SinglePatientUSCore7APIGroup < Inferno::TestGroup
end
end

USCoreTestKit::USCoreV700::USCoreTestSuite.groups.find { |g| g.title == 'US Core FHIR API' }.groups.each do |group|
test_group = group.ancestors[1]

next if test_group.optional?

id = test_group.id

group_config = {}
if test_group.respond_to?(:metadata) &&
test_group.metadata.delayed? &&
!test_group.metadata.searchable_delayed_resource?
test_group.children.reject! do |child|
child.include?(USCoreTestKit::SearchTest) &&
!child.include?(USCoreTestKit::PractitionerAddressTest)
USCoreTestKit::USCoreV700::USCoreTestSuite
.groups
.find { |g| g.title == 'US Core FHIR API' }
.groups
.each do |group|
test_group = group.ancestors[1]

next if test_group.optional?

group(from: test_group.id, exclude_optional: true)

if test_group.respond_to?(:metadata) && # rubocop:disable Style/Next
test_group.metadata.delayed? &&
!test_group.metadata.searchable_delayed_resource?
groups.last.children.reject! do |child|
child.include?(USCoreTestKit::SearchTest) &&
!child.include?(USCoreTestKit::PractitionerAddressTest)
end
groups.last.config(options: { read_all_resources: true })
end
group_config[:options] = { read_all_resources: true }
end

group(from: id, exclude_optional: true, config: group_config)
end

groups.first.description %(
The Capability Statement test verifies a FHIR server's ability support the
[capabilities
Expand Down

0 comments on commit b89831a

Please sign in to comment.