Sha256: ee541c6f6da147dd43a44462a668f03774d65162fc38d9585ca2ed5d33a78812

Contents?: true

Size: 786 Bytes

Versions: 6

Compression:

Stored size: 786 Bytes

Contents

class InsuranceProvider < Entry
  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 :member_id, type: String
  field :relationship, type: Hash
  field :financial_responsibility_type, type: Hash
  field :name, 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

6 entries across 6 versions & 1 rubygems

Version Path
health-data-standards-3.4.5 lib/health-data-standards/models/insurance_provider.rb
health-data-standards-3.4.4 lib/health-data-standards/models/insurance_provider.rb
health-data-standards-3.4.3 lib/health-data-standards/models/insurance_provider.rb
health-data-standards-3.4.2 lib/health-data-standards/models/insurance_provider.rb
health-data-standards-3.4.1 lib/health-data-standards/models/insurance_provider.rb
health-data-standards-3.4.0 lib/health-data-standards/models/insurance_provider.rb