Sha256: 831d110e0e106929b7749cca253113d87baacfbaab68789920517515958a4373

Contents?: true

Size: 1.92 KB

Versions: 26

Compression:

Stored size: 1.92 KB

Contents

# rm::data_structures::item_structure::representation
# representation module
# http://www.openehr.org/uml/release-1.0.1/Browsable/_9_0_76d0249_1109066789167_738055_2581Report.html
# refs #53
module OpenEHR
  module RM
    module DataStructures
      module ItemStructure
        module Representation
          class Item < OpenEHR::RM::Common::Archetyped::Locatable
            def initialize(args = {})
              super(args)
            end
          end

          class Element < Item
            attr_accessor :value
            attr_reader :null_flavor
            def initialize(args = {})
              super(args)
              self.value = args[:value]
              self.null_flavor= args[:null_flavor]
            end

            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

            def is_null?
              return @value.nil?
            end
          end

          class Cluster < Item
            attr_reader :items

            def initialize(args = {})
              super(args)
              self.items = args[:items]
            end

            def items=(items)
              if !items.nil? and items.empty?
                raise ArgumentError, 'items should not empty'
              end
              @items = items
            end
          end
        end # of Representation
      end # of ItemStructure
    end # of DataStructures
  end # of RM
end # of OpenEHR

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
openehr-1.2.8 lib/openehr/rm/data_structures/item_structure/representation.rb
openehr-1.2.7 lib/openehr/rm/data_structures/item_structure/representation.rb
openehr-1.2.6 lib/openehr/rm/data_structures/item_structure/representation.rb
openehr-1.2.5 lib/openehr/rm/data_structures/item_structure/representation.rb
openehr-1.2.4 lib/openehr/rm/data_structures/item_structure/representation.rb
openehr-1.2.3 lib/openehr/rm/data_structures/item_structure/representation.rb
openehr-1.2.2 lib/openehr/rm/data_structures/item_structure/representation.rb
openehr-1.2.1 lib/openehr/rm/data_structures/item_structure/representation.rb
openehr-1.2.0 lib/openehr/rm/data_structures/item_structure/representation.rb
openehr-1.1.6 lib/openehr/rm/data_structures/item_structure/representation.rb
openehr-1.1.5 lib/openehr/rm/data_structures/item_structure/representation.rb
openehr-1.1.4 lib/openehr/rm/data_structures/item_structure/representation.rb
openehr-1.1.3 lib/openehr/rm/data_structures/item_structure/representation.rb
openehr-1.1.2 lib/openehr/rm/data_structures/item_structure/representation.rb
openehr-1.1.1 lib/openehr/rm/data_structures/item_structure/representation.rb
openehr-1.1.0 lib/openehr/rm/data_structures/item_structure/representation.rb
open_ehr-1.0.2 lib/open_ehr/rm/data_structures/item_structure/representation.rb
open_ehr-1.0.1 lib/open_ehr/rm/data_structures/item_structure/representation.rb
open_ehr-1.0.0 lib/open_ehr/rm/data_structures/item_structure/representation.rb
open_ehr-0.9.5 lib/open_ehr/rm/data_structures/item_structure/representation.rb