Skip to content

Commit

Permalink
Fix FI-3641
Browse files Browse the repository at this point in the history
  • Loading branch information
Yunwei Wang committed Jan 9, 2025
1 parent c9728e7 commit 5b0310d
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 24 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 25 additions & 8 deletions lib/us_core_test_kit/generator/must_support_test_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,31 @@ def build_must_support_list_string(uscdi_only)
.select { |extension| extension[:uscdi_only].presence == uscdi_only.presence }
.map { |extension| extension[:id] }

group_metadata.must_supports[:choices]&.each do |choice|
next unless choice[:uscdi_only].presence == uscdi_only.presence && choice.key?(:paths)

choice[:paths].each { |path| element_names.delete("#{resource_type}.#{path}") }
element_names << choice[:paths].map { |path| "#{resource_type}.#{path}" }.join(' or ')
end

(slice_names + element_names + extension_names)
choice_names = []
group_metadata.must_supports[:choices]&.map do |choice|
next unless choice[:uscdi_only].presence == uscdi_only.presence

combined = []
if (choice.key?(:paths))
choice[:paths].each { |path| element_names.delete("#{resource_type}.#{path}") }
combined << choice[:paths].map { |path| "#{resource_type}.#{path}" }.join(' or ')
end

if (choice.key?(:extension_ids))
choice[:extension_ids].each { |extesnion_id| extension_names.delete(extesnion_id) }
combined << choice[:extension_ids].join(' or ')
end

if combined.any?
choice_names << combined.join(' or ')
end
# choice_paths = choice[:paths]&.map { |path| "#{resource_type}.#{path}" } || []
# choice_extensions = choice[:extensions]&.map { |extension| extension[:id] } || []

# choice_names << (choice_paths + choice_extensions).join(' or ')
end || []

(slice_names + element_names + extension_names + choice_names)
.uniq
.sort
.map { |name| "#{' ' * 8}* #{name}" }
Expand Down

0 comments on commit 5b0310d

Please sign in to comment.