class OpenEHR::AM::Archetype::Archetype

Attributes

adl_version[RW]
archetype_id[R]
concept[R]
definition[R]
invariants[RW]
ontology[R]
parent_archetype_id[RW]
uid[RW]

Public Class Methods

create(args ={}) { |archetype| ... } click to toggle source
# File lib/openehr/am/archetype.rb, line 95
def self.create(args ={}, &block)
  archetype = new(args)
  if block_given?
    yield archetype
  end
  return archetype
end
new(args = {}) click to toggle source
# File lib/openehr/am/archetype.rb, line 16
def initialize(args = {})
  super(args)
  self.adl_version = args[:adl_version] 
  self.archetype_id = args[:archetype_id]
  self.uid = args[:uid]
  self.concept = args[:concept]
  self.parent_archetype_id = args[:parent_archetype_id]
  self.definition = args[:definition]
  self.ontology = args[:ontology]
  self.invariants = args[:invariants]
end

Public Instance Methods

archetype_id=(archetype_id) click to toggle source
# File lib/openehr/am/archetype.rb, line 28
def archetype_id=(archetype_id)
  if archetype_id.nil?
    raise ArgumentError, 'archetype_id is mandatory'
  end
  @archetype_id = archetype_id
end
concept=(concept) click to toggle source
# File lib/openehr/am/archetype.rb, line 35
def concept=(concept)
  if concept.nil?
    raise ArgumentError, 'concept is mandatory'
  end
  @concept = concept
end
concept_name(a_lang) click to toggle source
# File lib/openehr/am/archetype.rb, line 64
def concept_name(a_lang)
  return @ontology.term_definition(:lang => a_lang, :code => @concept).items['text']
end
constraint_references_valid?() click to toggle source
# File lib/openehr/am/archetype.rb, line 68
def constraint_references_valid?
end
definition=(definition) click to toggle source
# File lib/openehr/am/archetype.rb, line 42
def definition=(definition)
  if definition.nil?
    raise ArgumentError, 'definition is mandatory'
  end
  @definition = definition
end
internal_references_valid?() click to toggle source
# File lib/openehr/am/archetype.rb, line 71
def internal_references_valid?
end
is_specialised?() click to toggle source
# File lib/openehr/am/archetype.rb, line 74
def is_specialised?
end
is_valid?() click to toggle source
# File lib/openehr/am/archetype.rb, line 77
def is_valid?
end
logical_paths(a_lang) click to toggle source
# File lib/openehr/am/archetype.rb, line 80
def logical_paths(a_lang) 
end
node_ids_vaild?() click to toggle source
# File lib/openehr/am/archetype.rb, line 83
def node_ids_vaild?
end
ontology=(ontology) click to toggle source
# File lib/openehr/am/archetype.rb, line 49
def ontology=(ontology)
  if ontology.nil?
    raise ArgumentError, 'ontology is mandatory'
  end
  @ontology = ontology
end
physical_paths() click to toggle source
# File lib/openehr/am/archetype.rb, line 86
def physical_paths
end
previous_version() click to toggle source
# File lib/openehr/am/archetype.rb, line 89
def previous_version
end
short_concept_name() click to toggle source
# File lib/openehr/am/archetype.rb, line 60
def short_concept_name
  return @archetype_id.concept_name
end
specialisation_depth() click to toggle source
# File lib/openehr/am/archetype.rb, line 92
def specialisation_depth
end
to_rm() click to toggle source
# File lib/openehr/am/archetype.rb, line 103
def to_rm
  ::OpenEHR::RM::Factory.create(definition.rm_type_name,
                                archetype_node_id: definition.archetype_node_id,
                                name: definition
                                )
end
version() click to toggle source
# File lib/openehr/am/archetype.rb, line 56
def version
  return @archetype_id.version_id
end