class OpenEHR::RM::Demographic::Party

Attributes

contacts[R]
details[RW]
identities[R]
relationships[R]
reverse_relationships[R]
uid[R]

Public Class Methods

new(args = { }) click to toggle source
# File lib/openehr/rm/demographic.rb, line 15
def initialize(args = { })
  super(args)
  self.uid = args[:uid]
  self.identities = args[:identities]
  self.contacts = args[:contacts]
  self.relationships = args[:relationships]
  self.reverse_relationships =
    args[:reverse_relationships]
  self.details = args[:details]
end

Public Instance Methods

contacts=(contacts) click to toggle source
# File lib/openehr/rm/demographic.rb, line 38
def contacts=(contacts)
  if !contacts.nil? && contacts.empty?
    raise ArgumentError, 'contacts should not be empty'
  end
  @contacts = contacts
end
identities=(identities) click to toggle source
# File lib/openehr/rm/demographic.rb, line 31
def identities=(identities)
  if identities.nil? || identities.empty?
    raise ArgumentError, 'identities are mandatory'
  end
  @identities = identities
end
parent=(parent) click to toggle source
# File lib/openehr/rm/demographic.rb, line 45
def parent=(parent)
  @parent = nil
end
relationships=(relationships) click to toggle source
# File lib/openehr/rm/demographic.rb, line 49
def relationships=(relationships)
  unless relationships.nil?
    if relationships.empty?
      raise ArgumentError, 'relationships should not be empty?'
    else
      relationships.each do |rel|
        if rel.source.id.value != @uid.value
          raise ArgumentError, 'invalid source of relationships'
        end
      end
    end
  end
  @relationships = relationships
end
reverse_relationships=(reverse_relationships) click to toggle source
# File lib/openehr/rm/demographic.rb, line 64
def reverse_relationships=(reverse_relationships)
  if !reverse_relationships.nil? && reverse_relationships.empty?
    raise ArgumentError, 'reverse_relationships should not be empty'
  end
  @reverse_relationships = reverse_relationships
end
uid=(uid) click to toggle source
# File lib/openehr/rm/demographic.rb, line 26
def uid=(uid)
  raise ArgumentError, 'uid is mandatory' if uid.nil?
  @uid = uid
end