class OpenEHR::RM::DataStructures::ItemStructure::ItemTree

Attributes

items[RW]

Public Class Methods

new(args ={ }) click to toggle source
# File lib/open_ehr/rm/data_structures/item_structure.rb, line 189
def initialize(args ={ })
  super(args)
  self.items = args[:items]
end

Public Instance Methods

as_hierarchy() click to toggle source
# File lib/open_ehr/rm/data_structures/item_structure.rb, line 209
def as_hierarchy
  return Cluster.new(:name => @name,
                     :archetype_node_id => @archetype_node_id,
                     :items => @items)
end
element_at_path(path) click to toggle source
# File lib/open_ehr/rm/data_structures/item_structure.rb, line 202
def element_at_path(path)
  @items.each do |item|
    return item if item.archetype_node_id == path
  end
  return nil
end
has_element_path?(path) click to toggle source
# File lib/open_ehr/rm/data_structures/item_structure.rb, line 194
def has_element_path?(path)
  paths = [ ]
  @items.each do |item|
    paths << item.archetype_node_id
  end
  return paths.include? path
end