Class: OpenEHR::RM::Support::Identification::UIDBasedID

Inherits:
ObjectID
  • Object
show all
Defined in:
lib/open_ehr/rm/support/identification.rb

Direct Known Subclasses

HierObjectID, ObjectVersionID

Instance Attribute Summary collapse

Attributes inherited from ObjectID

#value

Instance Method Summary collapse

Methods inherited from ObjectID

#==

Constructor Details

#initialize(args = {}) ⇒ UIDBasedID

Returns a new instance of UIDBasedID.



221
222
223
# File 'lib/open_ehr/rm/support/identification.rb', line 221

def initialize(args = {})
  super(args)
end

Instance Attribute Details

#extensionObject (readonly)

Returns the value of attribute extension.



219
220
221
# File 'lib/open_ehr/rm/support/identification.rb', line 219

def extension
  @extension
end

#rootObject (readonly)

Returns the value of attribute root.



219
220
221
# File 'lib/open_ehr/rm/support/identification.rb', line 219

def root
  @root
end

Instance Method Details

#has_extension?Boolean

Returns:

  • (Boolean)


236
237
238
# File 'lib/open_ehr/rm/support/identification.rb', line 236

def has_extension?
  return !@extension.empty?
end

#value=(value) ⇒ Object



225
226
227
228
229
230
231
232
233
234
# File 'lib/open_ehr/rm/support/identification.rb', line 225

def value=(value)
  super(value)
  if /(\S+)::(\S+)/ =~ value
    @root = UID.new(:value => $1)
    @extension = $2
  else
    @root = UID.new(:value => value)
    @extension = ''
  end
end