- Timestamp:
- Sep 14, 2009, 1:21:16 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ruby/branches/0.5/lib/open_ehr/rm/support/identification.rb
r216 r259 6 6 module Support 7 7 module Identification 8 class ObjectI d8 class ObjectID 9 9 attr_reader :value 10 10 11 def initialize( value)12 self.value= value11 def initialize(args = {}) 12 self.value=args[:value] 13 13 end 14 14 … … 17 17 @value = value 18 18 end 19 19 20 def ==(object_id) 20 21 @value == object_id.value … … 32 33 33 34 def namespace=(namespace) 34 raise ArgumentError if namespace.nil? or namespace.empty? or !(/([a-z]|[A-Z]).*/ =~ namespace) # error original is =~ #([a-z][A-Z])([a-z]|[A-Z]|\s|[ 0-9]|[_-\:\/\&\+\?])*/35 raise ArgumentError if namespace.nil? or namespace.empty? or !(/([a-z]|[A-Z]).*/ =~ namespace) # error original is =~ #([a-z][A-Z])([a-z]|[A-Z]|\s|[v0-9]|[_-\:\/\&\+\?])*/ 35 36 @namespace = namespace 36 37 end … … 47 48 end 48 49 49 class ArchetypeI d < ObjectId50 class ArchetypeID < ObjectID 50 51 attr_reader :domain_concept, :rm_name, :rm_entity, :rm_originator, :specialisation, :version_id 51 52 … … 90 91 end 91 92 92 class TerminologyI d < ObjectId93 class TerminologyID < ObjectID 93 94 attr_reader :name, :version_id 94 95 95 def initialize( value)96 super( value)96 def initialize(args = {}) 97 super(args) 97 98 end 98 99 … … 129 130 end # of Terminology_ID 130 131 131 class GenericI d < ObjectId132 class GenericID < ObjectID 132 133 attr_reader :scheme 133 134 … … 143 144 end # of Generic_ID 144 145 145 class TemplateI d < ObjectId146 147 end 148 149 class U idBasedId < ObjectId146 class TemplateID < ObjectID 147 148 end 149 150 class UIDBasedID < ObjectID 150 151 def initialize(value) 151 152 super(value) … … 173 174 end 174 175 175 class ObjectVersionI d < UidBasedId176 class ObjectVersionID < UIDBasedID 176 177 attr_reader :object_id, :creating_system_id, :version_tree_id 177 178 … … 183 184 super(value) 184 185 if /^(\w+)::(\w+)::((\d|\.)+)$/ =~ value 185 self.object_id = U id.new($1)186 self.creating_system_id = U id.new($2)187 self.version_tree_id = VersionTreeI d.new($3)186 self.object_id = UID.new($1) 187 self.creating_system_id = UID.new($2) 188 self.version_tree_id = VersionTreeID.new($3) 188 189 else 189 190 raise ArgumentError, 'invalid format' … … 249 250 end 250 251 251 class HierObjectI d < UidBasedId252 253 end 254 255 class VersionTreeI d252 class HierObjectID < UIDBasedID 253 254 end 255 256 class VersionTreeID 256 257 attr_reader :value, :trunk_version, :branch_number, :branch_version 257 258 … … 302 303 end 303 304 304 class U id305 class UID 305 306 attr_reader :value 306 307 … … 315 316 end 316 317 317 class U uid < Uid318 319 end 320 321 class InternetI d <Uid318 class UUID < UID 319 320 end 321 322 class InternetID <UID 322 323 323 324 end 324 325 325 class IsoO id <Uid326 class IsoOID <UID 326 327 327 328 end
Note:
See TracChangeset
for help on using the changeset viewer.