# File lib/redox/models/patient.rb, line 23 def primary_care_provider self[:PCP] ||= PCP.new end
class Redox::Models::Patient
Public Class Methods
query(params, meta: Meta.new)
click to toggle source
# File lib/redox/models/patient.rb, line 52 def query(params, meta: Meta.new) return Redox::Request::PatientSearch.query(params, meta: meta) end
Public Instance Methods
add_identifier(type: , value: )
click to toggle source
# File lib/redox/models/patient.rb, line 31 def add_identifier(type: , value: ) self[:Identifiers] << Identifier.new({'ID' => value, 'IDType' => type}) return self end
add_insurance(data = {})
click to toggle source
# File lib/redox/models/patient.rb, line 37 def add_insurance(data = {}) self[:Insurances] << Insurance.new(data) return self end
contacts()
click to toggle source
# File lib/redox/models/patient.rb, line 27 def contacts self[:Contacts] = self[:Contacts].map {|contact| contact.is_a?(Redox::Models::Contact) ? contact : Contact.new(contact)} end
create(meta: Meta.new)
click to toggle source
# File lib/redox/models/patient.rb, line 47 def create(meta: Meta.new) Redox::Request::PatientAdmin.create(patient: self, meta: meta) end
demographics()
click to toggle source
# File lib/redox/models/patient.rb, line 14 def demographics self[:Demographics] = Demographics.new(self[:Demographics]) unless self[:Demographics].is_a?(Redox::Models::Demographics) self[:Demographics] ||= Demographics.new end
insurances()
click to toggle source
# File lib/redox/models/patient.rb, line 19 def insurances self[:Insurances] = self[:Insurances].map {|ins| ins.is_a?(Redox::Models::Insurance) ? ins : Insurance.new(ins) } end
primary_care_provider()
click to toggle source
update(meta: Meta.new)
click to toggle source
# File lib/redox/models/patient.rb, line 43 def update(meta: Meta.new) Redox::Request::PatientAdmin.update(patient: self, meta: meta) end