Class: USCoreTestKit::Generator::IGMetadata
- Inherits:
-
Object
- Object
- USCoreTestKit::Generator::IGMetadata
- Defined in:
- lib/us_core_test_kit/generator/ig_metadata.rb
Instance Attribute Summary collapse
-
#groups ⇒ Object
Returns the value of attribute groups.
-
#ig_version ⇒ Object
Returns the value of attribute ig_version.
Instance Method Summary collapse
- #delayed_groups ⇒ Object
- #delayed_profiles ⇒ Object
- #granular_scope_groups ⇒ Object
- #granular_scope_resource_type_groups ⇒ Object
- #non_delayed_groups ⇒ Object
- #ordered_groups ⇒ Object
- #patient_group ⇒ Object
- #postprocess_groups(ig_resources) ⇒ Object
- #reformatted_version ⇒ Object
- #to_hash ⇒ Object
Instance Attribute Details
#groups ⇒ Object
Returns the value of attribute groups.
4 5 6 |
# File 'lib/us_core_test_kit/generator/ig_metadata.rb', line 4 def groups @groups end |
#ig_version ⇒ Object
Returns the value of attribute ig_version.
4 5 6 |
# File 'lib/us_core_test_kit/generator/ig_metadata.rb', line 4 def ig_version @ig_version end |
Instance Method Details
#delayed_groups ⇒ Object
20 21 22 23 |
# File 'lib/us_core_test_kit/generator/ig_metadata.rb', line 20 def delayed_groups @delayed_groups ||= groups.select { |group| group.delayed? } end |
#delayed_profiles ⇒ Object
30 31 32 33 |
# File 'lib/us_core_test_kit/generator/ig_metadata.rb', line 30 def delayed_profiles @delayed_profiles ||= delayed_groups.map(&:profile_url) end |
#granular_scope_groups ⇒ Object
46 47 48 |
# File 'lib/us_core_test_kit/generator/ig_metadata.rb', line 46 def granular_scope_groups @granular_scope_groups ||= [] end |
#granular_scope_resource_type_groups ⇒ Object
41 42 43 44 |
# File 'lib/us_core_test_kit/generator/ig_metadata.rb', line 41 def granular_scope_resource_type_groups @granular_scope_resource_type_groups ||= Hash.new { |hash, key| hash[key] = [] } end |
#non_delayed_groups ⇒ Object
25 26 27 28 |
# File 'lib/us_core_test_kit/generator/ig_metadata.rb', line 25 def non_delayed_groups @non_delayed_groups ||= groups.reject { |group| group.delayed? } - [patient_group] end |
#ordered_groups ⇒ Object
10 11 12 13 |
# File 'lib/us_core_test_kit/generator/ig_metadata.rb', line 10 def ordered_groups @ordered_groups ||= [patient_group] + non_delayed_groups + delayed_groups end |
#patient_group ⇒ Object
15 16 17 18 |
# File 'lib/us_core_test_kit/generator/ig_metadata.rb', line 15 def patient_group @patient_group ||= groups.find { |group| group.resource == 'Patient' } end |
#postprocess_groups(ig_resources) ⇒ Object
35 36 37 38 39 |
# File 'lib/us_core_test_kit/generator/ig_metadata.rb', line 35 def postprocess_groups(ig_resources) groups.each do |group| group.add_delayed_references(delayed_profiles, ig_resources) end end |
#reformatted_version ⇒ Object
6 7 8 |
# File 'lib/us_core_test_kit/generator/ig_metadata.rb', line 6 def reformatted_version @reformatted_version ||= ig_version.delete('.').gsub('-', '_') end |
#to_hash ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'lib/us_core_test_kit/generator/ig_metadata.rb', line 50 def to_hash { ig_version:, groups: groups.map(&:to_hash), granular_scope_resource_type_groups:, granular_scope_groups: } end |