Changeset 187 for ruby/branches/0.5/lib


Ignore:
Timestamp:
Aug 11, 2009, 11:52:14 PM (15 years ago)
Author:
KOBAYASHI, Shinji
Message:

refs #53 correct directory

Location:
ruby/branches/0.5/lib/open_ehr/rm/data_structures/item_structure
Files:
1 added
1 moved

Legend:

Unmodified
Added
Removed
  • ruby/branches/0.5/lib/open_ehr/rm/data_structures/item_structure/representation.rb

    r186 r187  
    66  module RM
    77    module DataStructures
    8       module Representation
    9         class Item < OpenEhr::RM::Common::Archetyped::Locatable
    10           def initialize(args = {})
    11             super(args)
    12           end
    13         end
    14 
    15         class Element < Item
    16           attr_accessor :value
    17           attr_reader :null_flavor
    18           def initialize(args = {})
    19             super(args)
    20             self.value = args[:value]
    21             self.null_flavor= args[:null_flavor]
    22           end
    23 
    24           def null_flavor=(null_flavor)
    25             sr = nil
    26             if !null_flavor.nil? and
    27                 null_flavor.defining_code.terminology_id.name == 'openehr'
    28               sr = Terminology.find(:first,                                 
    29                                     :conditions => "code = '#{null_flavor.defining_code.code_string}'")
    30             end
    31             if null_flavor.nil? or (!sr.nil? and sr.group == 'null flavours')
    32               @null_flavor = null_flavor
    33             else
    34               raise ArgumentError, 'null_flavor is invalid'
     8      module ItemStructure
     9        module Representation
     10          class Item < OpenEhr::RM::Common::Archetyped::Locatable
     11            def initialize(args = {})
     12              super(args)
    3513            end
    3614          end
    3715
    38           def is_null?
    39             return @value.nil?
     16          class Element < Item
     17            attr_accessor :value
     18            attr_reader :null_flavor
     19            def initialize(args = {})
     20              super(args)
     21              self.value = args[:value]
     22              self.null_flavor= args[:null_flavor]
     23            end
     24
     25            def null_flavor=(null_flavor)
     26              sr = nil
     27              if !null_flavor.nil? and
     28                  null_flavor.defining_code.terminology_id.name == 'openehr'
     29                sr = Terminology.find(:first,                                 
     30                                      :conditions => "code = '#{null_flavor.defining_code.code_string}'")
     31              end
     32              if null_flavor.nil? or (!sr.nil? and sr.group == 'null flavours')
     33                @null_flavor = null_flavor
     34              else
     35                raise ArgumentError, 'null_flavor is invalid'
     36              end
     37            end
     38
     39            def is_null?
     40              return @value.nil?
     41            end
    4042          end
    41         end
    42       end # of Representation
     43        end # of Representation
     44      end # of ItemStructure
    4345    end # of DataStructures
    4446  end # of RM
Note: See TracChangeset for help on using the changeset viewer.