Sha256: 2d94f27babc2d5311d24ad2e0a4c5be735530997e9861950d564640da6b0ef54

Contents?: true

Size: 807 Bytes

Versions: 11

Compression:

Stored size: 807 Bytes

Contents

require_dependency "renalware/pd"

module Renalware
  module PD
    class ExitSiteInfection < ApplicationRecord
      include PatientScope

      belongs_to :patient, class_name: "Renalware::Patient", touch: true

      has_many :prescriptions, as: :treatable, class_name: "Renalware::Medications::Prescription"
      has_many :medication_routes, through: :prescriptions
      has_many :patients, through: :prescriptions, as: :treatable
      has_many :infection_organisms, as: :infectable
      has_many :organism_codes, -> { uniq }, through: :infection_organisms, as: :infectable

      validates :patient, presence: true
      validates :diagnosis_date, presence: true

      scope :ordered, -> { order(diagnosis_date: :desc) }

      def self.policy_class
        BasePolicy
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.rc3 app/models/renalware/pd/exit_site_infection.rb
renalware-core-2.0.0.pre.rc1 app/models/renalware/pd/exit_site_infection.rb
renalware-core-2.0.0.pre.beta12 app/models/renalware/pd/exit_site_infection.rb
renalware-core-2.0.0.pre.beta11 app/models/renalware/pd/exit_site_infection.rb
renalware-core-2.0.0.pre.beta10 app/models/renalware/pd/exit_site_infection.rb
renalware-core-2.0.0.pre.beta9 app/models/renalware/pd/exit_site_infection.rb
renalware-core-2.0.0.pre.beta8 app/models/renalware/pd/exit_site_infection.rb
renalware-core-2.0.0.pre.beta7 app/models/renalware/pd/exit_site_infection.rb
renalware-core-2.0.0.pre.beta6 app/models/renalware/pd/exit_site_infection.rb
renalware-core-2.0.0.pre.beta5 app/models/renalware/pd/exit_site_infection.rb
renalware-core-2.0.0.pre.beta4 app/models/renalware/pd/exit_site_infection.rb