Sha256: 0e93e963736f8db25ab35db631fa69f03c6e595f46111da6d86c9a1942918e1c

Contents?: true

Size: 525 Bytes

Versions: 7

Compression:

Stored size: 525 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/letters"

module Renalware
  module Letters
    class PrimaryCarePhysician < ActiveType::Record[Renalware::Patients::PrimaryCarePhysician]
      has_many :patients, dependent: :restrict_with_exception
      has_many :letters, through: :patients

      def cc_on_letter?(letter)
        return false unless letter.patient.assigned_to_primary_care_physician?(self)
        letter.main_recipient.patient? || letter.main_recipient.contact?
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
renalware-core-2.0.46 app/models/renalware/letters/primary_care_physician.rb
renalware-core-2.0.45 app/models/renalware/letters/primary_care_physician.rb
renalware-core-2.0.44 app/models/renalware/letters/primary_care_physician.rb
renalware-core-2.0.43 app/models/renalware/letters/primary_care_physician.rb
renalware-core-2.0.42 app/models/renalware/letters/primary_care_physician.rb
renalware-core-2.0.41 app/models/renalware/letters/primary_care_physician.rb
renalware-core-2.0.40 app/models/renalware/letters/primary_care_physician.rb