class OpenEHR::RM::DataStructures::ItemStructure::Representation::Element

Attributes

null_flavor[R]
value[RW]

Public Class Methods

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

Public Instance Methods

is_null?() click to toggle source
# File lib/open_ehr/rm/data_structures/item_structure/representation.rb, line 39
def is_null?
  return @value.nil?
end
null_flavor=(null_flavor) click to toggle source
# File lib/open_ehr/rm/data_structures/item_structure/representation.rb, line 25
def null_flavor=(null_flavor)
  sr = nil
  if !null_flavor.nil? and
      null_flavor.defining_code.terminology_id.name == 'openehr'
    sr = Terminology.find(:first,                                  
                          :conditions => "code = '#{null_flavor.defining_code.code_string}'")
  end
  if null_flavor.nil? or (!sr.nil? and sr.group == 'null flavours')
    @null_flavor = null_flavor
  else
    raise ArgumentError, 'null_flavor is invalid'
  end
end