Class: OpenEHR::RM::Common::Generic::PartyIdentified

Inherits:
PartyProxy
  • Object
show all
Defined in:
lib/open_ehr/rm/common/generic.rb

Direct Known Subclasses

PartyRelated

Instance Attribute Summary collapse

Attributes inherited from PartyProxy

#external_ref

Instance Method Summary collapse

Constructor Details

#initialize(args = { }) ⇒ PartyIdentified

Returns a new instance of PartyIdentified.



106
107
108
109
110
111
112
113
114
# File 'lib/open_ehr/rm/common/generic.rb', line 106

def initialize(args = { })
  if args[:external_ref].nil? && args[:name].nil? &&
      args[:identifier].nil?
    raise ArgumentError, 'cannot identified'
  end
  self.name = args[:name]
  self.identifier = args[:identifier]
  super(args)
end

Instance Attribute Details

#identifierObject

Returns the value of attribute identifier.



104
105
106
# File 'lib/open_ehr/rm/common/generic.rb', line 104

def identifier
  @identifier
end

#nameObject

Returns the value of attribute name.



104
105
106
# File 'lib/open_ehr/rm/common/generic.rb', line 104

def name
  @name
end

Instance Method Details

#external_ref=(external_ref) ⇒ Object



134
135
136
137
138
139
# File 'lib/open_ehr/rm/common/generic.rb', line 134

def external_ref=(external_ref)
  if @name.nil? && @identifier.nil? && external_ref.nil?
    raise ArgumentError, 'invalid external_ref'
  end
  @external_ref = external_ref
end