Sha256: ddb735c2c155bd53be167fe0fe2dbcfad106898313bb142ac986e707b7b8355c

Contents?: true

Size: 908 Bytes

Versions: 8

Compression:

Stored size: 908 Bytes

Contents

class InsuranceProvider
  include Mongoid::Document
  include ThingWithCodes
  
  embedded_in :record, class_name: 'Record'
  embeds_one :payer, class_name: "Organization"
  embeds_many :guarantors, class_name: "Guarantor"
  embeds_one :subscriber, class_name: "Person"
  
  field :type, type: String
  field :time, type: Integer
  field :start_time, type: Integer
  field :end_time, type: Integer
  field :member_id, type: String
  field :relationship, type: Hash
  field :financial_responsibility_type, type: Hash
  field :name, type: String
  field :free_text, type: String
  

  def shift_dates(date_diff)
    self.start_time = self.start_time.nil? ? nil : self.start_time + date_diff
    self.end_time = self.end_time.nil? ? nil : self.end_time + date_diff
    self.time = self.time.nil? ? nil : self.time + date_diff
    self.guarantors.each do |g|
      g.shift_dates(date_diff)
    end
    
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
health-data-standards-3.2.7 lib/health-data-standards/models/insurance_provider.rb
health-data-standards-3.2.6 lib/health-data-standards/models/insurance_provider.rb
health-data-standards-3.2.5 lib/health-data-standards/models/insurance_provider.rb
health-data-standards-3.2.4 lib/health-data-standards/models/insurance_provider.rb
health-data-standards-3.2.3 lib/health-data-standards/models/insurance_provider.rb
health-data-standards-3.2.2 lib/health-data-standards/models/insurance_provider.rb
health-data-standards-3.2.1 lib/health-data-standards/models/insurance_provider.rb
health-data-standards-3.2.0 lib/health-data-standards/models/insurance_provider.rb