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

Inherits:
PartyProxy
  • Object
show all
Defined in:
lib/openehr/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.



104
105
106
107
108
109
110
111
112
# File 'lib/openehr/rm/common/generic.rb', line 104

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

Instance Attribute Details

#identifiersObject

Returns the value of attribute identifiers.



102
103
104
# File 'lib/openehr/rm/common/generic.rb', line 102

def identifiers
  @identifiers
end

#nameObject

Returns the value of attribute name.



102
103
104
# File 'lib/openehr/rm/common/generic.rb', line 102

def name
  @name
end

Instance Method Details

#external_ref=(external_ref) ⇒ Object



146
147
148
149
150
151
# File 'lib/openehr/rm/common/generic.rb', line 146

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

#identifierObject

Deprecated: PartyIdentified's identifiers attribute is a List<DV_IDENTIFIER> per spec, so the plural #identifiers is the correct name; these singular aliases exist only for backward compatibility with earlier releases.



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

def identifier
  warn '[DEPRECATED] PartyIdentified#identifier is deprecated; use #identifiers instead'
  @identifiers
end

#identifier=(identifier) ⇒ Object



141
142
143
144
# File 'lib/openehr/rm/common/generic.rb', line 141

def identifier=(identifier)
  warn '[DEPRECATED] PartyIdentified#identifier= is deprecated; use #identifiers= instead'
  self.identifiers = identifier
end