Ignore:
Timestamp:
Nov 20, 2009, 3:23:48 PM (14 years ago)
Author:
KOBAYASHI, Shinji
Message:

merge operation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ruby/trunk/lib/open_ehr/rm/common/generic.rb

    r167 r370  
    22# http://www.openehr.org/uml/release-1.0.1/Browsable/_9_5_1_76d0249_1140169202660_257304_813Report.html
    33# Related to the ticket #62
    4 include OpenEhr::RM::Support::Identification
    5 include OpenEhr::RM::DataTypes::Basic
    6 module OpenEhr
     4include OpenEHR::RM::Support::Identification
     5include OpenEHR::RM::DataTypes::Basic
     6module OpenEHR
    77  module RM
    88    module Common
     
    3434          def time_committed=(time_committed)
    3535            if time_committed.nil?
    36               raise ArgumentError, 'time_commited is mandatory'
     36              raise ArgumentError, 'time_committed is mandatory'
    3737            end
    3838            @time_committed = time_committed
    3939          end
    40 
     40             
    4141          def change_type=(change_type)
    4242            raise ArgumentError, 'change_type is mandatory' if change_type.nil?
     
    4848          attr_reader :items
    4949
    50           def initialize(items)
    51             self.items = items
     50          def initialize(args = { })
     51            self.items = args[:items]
    5252          end
    5353
     
    103103        class PartyIdentified < PartyProxy
    104104          attr_reader :name, :identifier
     105
    105106          def initialize(args = { })
    106107            if args[:external_ref].nil? && args[:name].nil? &&
     
    108109              raise ArgumentError, 'cannot identified'
    109110            end
    110             super(:external_ref => args[:external_ref])
    111111            self.name = args[:name]
    112112            self.identifier = args[:identifier]
     113            super(args)
    113114          end
    114115
     
    125126              raise ArgumentError, 'cannot identified'
    126127            end
    127             unless identifier.nil? || !identifier.empty?
     128            if !identifier.nil? && identifier.empty?
    128129              raise ArgumentError, 'invaild identifier'
    129130            end
    130131            @identifier = identifier
     132          end
     133
     134          def external_ref=(external_ref)
     135            if @name.nil? && @identifier.nil? && external_ref.nil?
     136              raise ArgumentError, 'invalid external_ref'
     137            end
     138            @external_ref = external_ref
    131139          end
    132140        end
     
    176184        class Attestation < AuditDetails
    177185          attr_reader :reason
    178           attr_accessor :proof, :items
     186          attr_accessor :proof, :attested_view, :is_pending, :items
    179187
    180188          def initialize(args = { })
     
    183191            self.proof = args[:proof]
    184192            self.items = args[:items]
     193            self.attested_view = args[:attested_view]
     194            self.is_pending = args[:is_pending]
    185195          end
    186196
     
    188198            raise ArgumentError, 'reason is mandatory' if reason.nil?
    189199            @reason = reason
     200          end
     201
     202          def items=(items)
     203            if !items.nil? && items.empty?
     204              raise ArgumentError, 'items should not be empty'
     205            end
     206            @items = items
     207          end
     208         
     209          def is_pending?
     210            return is_pending
    190211          end
    191212        end
Note: See TracChangeset for help on using the changeset viewer.