Changeset 370 for ruby/trunk/lib/open_ehr/rm/common/generic.rb
- Timestamp:
- Nov 20, 2009, 3:23:48 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ruby/trunk/lib/open_ehr/rm/common/generic.rb
r167 r370 2 2 # http://www.openehr.org/uml/release-1.0.1/Browsable/_9_5_1_76d0249_1140169202660_257304_813Report.html 3 3 # Related to the ticket #62 4 include OpenE hr::RM::Support::Identification5 include OpenE hr::RM::DataTypes::Basic6 module OpenE hr4 include OpenEHR::RM::Support::Identification 5 include OpenEHR::RM::DataTypes::Basic 6 module OpenEHR 7 7 module RM 8 8 module Common … … 34 34 def time_committed=(time_committed) 35 35 if time_committed.nil? 36 raise ArgumentError, 'time_commit ed is mandatory'36 raise ArgumentError, 'time_committed is mandatory' 37 37 end 38 38 @time_committed = time_committed 39 39 end 40 40 41 41 def change_type=(change_type) 42 42 raise ArgumentError, 'change_type is mandatory' if change_type.nil? … … 48 48 attr_reader :items 49 49 50 def initialize( items)51 self.items = items50 def initialize(args = { }) 51 self.items = args[:items] 52 52 end 53 53 … … 103 103 class PartyIdentified < PartyProxy 104 104 attr_reader :name, :identifier 105 105 106 def initialize(args = { }) 106 107 if args[:external_ref].nil? && args[:name].nil? && … … 108 109 raise ArgumentError, 'cannot identified' 109 110 end 110 super(:external_ref => args[:external_ref])111 111 self.name = args[:name] 112 112 self.identifier = args[:identifier] 113 super(args) 113 114 end 114 115 … … 125 126 raise ArgumentError, 'cannot identified' 126 127 end 127 unless identifier.nil? || !identifier.empty?128 if !identifier.nil? && identifier.empty? 128 129 raise ArgumentError, 'invaild identifier' 129 130 end 130 131 @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 131 139 end 132 140 end … … 176 184 class Attestation < AuditDetails 177 185 attr_reader :reason 178 attr_accessor :proof, : items186 attr_accessor :proof, :attested_view, :is_pending, :items 179 187 180 188 def initialize(args = { }) … … 183 191 self.proof = args[:proof] 184 192 self.items = args[:items] 193 self.attested_view = args[:attested_view] 194 self.is_pending = args[:is_pending] 185 195 end 186 196 … … 188 198 raise ArgumentError, 'reason is mandatory' if reason.nil? 189 199 @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 190 211 end 191 212 end
Note:
See TracChangeset
for help on using the changeset viewer.