Class: OpenEHR::RM::Support::Identification::ObjectVersionID
- Inherits:
-
UIDBasedID
- Object
- ObjectID
- UIDBasedID
- OpenEHR::RM::Support::Identification::ObjectVersionID
- Defined in:
- lib/openehr/rm/support/identification.rb
Instance Attribute Summary collapse
-
#creating_system_id ⇒ Object
Returns the value of attribute creating_system_id.
-
#version_tree_id ⇒ Object
Returns the value of attribute version_tree_id.
Attributes inherited from UIDBasedID
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ ObjectVersionID
constructor
A new instance of ObjectVersionID.
- #is_branch? ⇒ Boolean
- #objectid ⇒ Object
- #objectid=(oid) ⇒ Object
- #value ⇒ Object
- #value=(value) ⇒ Object
Methods inherited from UIDBasedID
Methods inherited from ObjectID
Constructor Details
#initialize(args = {}) ⇒ ObjectVersionID
Returns a new instance of ObjectVersionID.
243 244 245 |
# File 'lib/openehr/rm/support/identification.rb', line 243 def initialize(args= {}) super end |
Instance Attribute Details
#creating_system_id ⇒ Object
Returns the value of attribute creating_system_id.
241 242 243 |
# File 'lib/openehr/rm/support/identification.rb', line 241 def creating_system_id @creating_system_id end |
#version_tree_id ⇒ Object
Returns the value of attribute version_tree_id.
241 242 243 |
# File 'lib/openehr/rm/support/identification.rb', line 241 def version_tree_id @version_tree_id end |
Instance Method Details
#is_branch? ⇒ Boolean
286 287 288 |
# File 'lib/openehr/rm/support/identification.rb', line 286 def is_branch? return @version_tree_id.is_branch? end |
#objectid ⇒ Object
263 264 265 |
# File 'lib/openehr/rm/support/identification.rb', line 263 def objectid return @oid end |
#objectid=(oid) ⇒ Object
267 268 269 270 |
# File 'lib/openehr/rm/support/identification.rb', line 267 def objectid=(oid) raise ArgumentError, 'objectid is mandatory' if oid.nil? @oid = oid end |
#value ⇒ Object
257 258 259 260 261 |
# File 'lib/openehr/rm/support/identification.rb', line 257 def value return @oid.value + '::' + @creating_system_id.value + '::' + @version_tree_id.value end |
#value=(value) ⇒ Object
247 248 249 250 251 252 253 254 255 |
# File 'lib/openehr/rm/support/identification.rb', line 247 def value=(value) if /^(\S+)::(\S+)::((\d|\.)+)$/ =~ value self.objectid = UID.new(:value => $1) self.creating_system_id = UID.new(:value => $2) self.version_tree_id = VersionTreeID.new(:value => $3) else raise ArgumentError, 'invalid format' end end |