Module: CompositionUtils
Overview
Utilities for FHIR Composition resources
Constant Summary
collapse
- NO_BUNDLE_OMIT_MESSAGE =
'No AU PS Bundle was loaded by this test group (its inputs were not provided or ' \
'the Bundle could not be acquired), so this test is omitted.'
- BUNDLE_SOURCE_GROUPS =
Each top-level group keeps its Bundle under its own scratch key so that a
group can never validate a Bundle acquired by a different group.
{
'retrieve_au_ps_bundle_validation_tests' => 'retrieve',
'generate_au_ps_using_ips_summary_validation_tests' => 'summary',
'au_ps_bundle_instance' => 'instance'
}.freeze
Instance Method Summary
collapse
#all_entries_have_full_url_info?, #boolean_to_existent_string, #identifier_info?, #timestamp_info?, #type_info?
Instance Method Details
#bundle_scratch_key ⇒ Object
21
22
23
24
25
|
# File 'lib/au_ps_inferno/utils/composition_utils.rb', line 21
def bundle_scratch_key
id_str = self.class.id.to_s
_slug, source = BUNDLE_SOURCE_GROUPS.find { |slug, _| id_str.include?(slug) }
source ? :"bundle_ips_resource_#{source}" : :bundle_ips_resource
end
|
#group_section_output(section_info_array) ⇒ Object
39
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/au_ps_inferno/utils/composition_utils.rb', line 39
def group_section_output(section_info_array)
section_entities = {}
section_info_array.each do |section_info|
if section_entities.keys.include?(section_info)
section_entities[section_info] += 1
else
section_entities[section_info] = 1
end
end
section_entities.keys.map { |section_entity| "#{section_entity} x#{section_entities[section_entity]}" }
end
|
#omit_unless_bundle_in_scratch ⇒ Object
35
36
37
|
# File 'lib/au_ps_inferno/utils/composition_utils.rb', line 35
def omit_unless_bundle_in_scratch
omit_if scratch_bundle.blank?, NO_BUNDLE_OMIT_MESSAGE
end
|
#save_bundle_to_scratch(bundle) ⇒ Object
31
32
33
|
# File 'lib/au_ps_inferno/utils/composition_utils.rb', line 31
def save_bundle_to_scratch(bundle)
scratch[bundle_scratch_key] = bundle
end
|
#scratch_bundle ⇒ Object
27
28
29
|
# File 'lib/au_ps_inferno/utils/composition_utils.rb', line 27
def scratch_bundle
scratch[bundle_scratch_key]
end
|