Changeset 373


Ignore:
Timestamp:
Dec 15, 2009, 9:42:09 PM (14 years ago)
Author:
KOBAYASHI, Shinji
Message:

refs #72

Location:
ruby/trunk
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • ruby/trunk/lib/open_ehr/am/archetype.rb

    r372 r373  
    6363        end
    6464
    65         def self.create(args ={}, &block)
    66           archetype = new(args)
    67           if block_given?
    68             yield archetype
    69           end
    70           return archetype
    71         end
    72 
    7365        def concept_name(a_lang)
     66         
    7467        end
    7568
     
    10194        end
    10295       
     96        def self.create(args ={}, &block)
     97          archetype = new(args)
     98          if block_given?
     99            yield archetype
     100          end
     101          return archetype
     102        end
     103
    103104      end # end of Archetype
    104105      # original file:
     
    106107
    107108      class VALIDITY_KIND
     109
    108110      end
    109111    end
  • ruby/trunk/lib/open_ehr/am/archetype/constraint_model.rb

    r372 r373  
    55      module ConstraintModel
    66        class ArchetypeConstraint
     7          attr_reader :path
     8          attr_accessor :parent
    79
     10          def initialize(args = { })
     11            self.path = args[:path]
     12            self.parent = args[:parent]
     13          end
     14
     15          def path=(path)
     16            if path.nil?
     17              raise ArgumentError, 'path is mandatory'
     18            end
     19            @path = path
     20          end
     21
     22          def has_path?(path)
     23            return @path.include?(path)
     24          end
     25
     26          def congruent?
     27            if @path.index(@parent.path) == 0
     28              return true
     29            else
     30              return false
     31            end
     32          end
     33
     34          alias is_congruent? congruent?
     35
     36          def node_conforms_to?(other)
     37            if @path.index(other.path) == 0
     38              return true
     39            else
     40              return false
     41            end
     42          end
    843        end
    944
Note: See TracChangeset for help on using the changeset viewer.