Sha256: 54254ead04b5b111963e27efb155fb04dce3de214069785d3145f8f70002696d

Contents?: true

Size: 741 Bytes

Versions: 18

Compression:

Stored size: 741 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/pd"

module Renalware
  module PD
    class Patient < ActiveType::Record[Renalware::Patient]
      has_many :pet_adequacy_results, dependent: :restrict_with_exception
      has_many :pet_results, dependent: :restrict_with_exception
      has_many :adequacy_results, dependent: :restrict_with_exception

      def treated?
        modality_descriptions.exists?(type: "Renalware::PD::ModalityDescription")
      end

      # rubocop:disable Naming/PredicateName
      def has_ever_been_on_pd?
        @has_ever_been_on_pd ||=
          modality_descriptions.exists?(type: "Renalware::PD::ModalityDescription")
      end
      # rubocop:enable Naming/PredicateName
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
renalware-core-2.1.1 app/models/renalware/pd/patient.rb
renalware-core-2.1.0 app/models/renalware/pd/patient.rb
renalware-core-2.0.167 app/models/renalware/pd/patient.rb
renalware-core-2.0.166 app/models/renalware/pd/patient.rb
renalware-core-2.0.165 app/models/renalware/pd/patient.rb
renalware-core-2.0.164 app/models/renalware/pd/patient.rb
renalware-core-2.0.163 app/models/renalware/pd/patient.rb
renalware-core-2.0.162 app/models/renalware/pd/patient.rb
renalware-core-2.0.161 app/models/renalware/pd/patient.rb
renalware-core-2.0.160 app/models/renalware/pd/patient.rb
renalware-core-2.0.159 app/models/renalware/pd/patient.rb
renalware-core-2.0.158 app/models/renalware/pd/patient.rb
renalware-core-2.0.157 app/models/renalware/pd/patient.rb
renalware-core-2.0.156 app/models/renalware/pd/patient.rb
renalware-core-2.0.155 app/models/renalware/pd/patient.rb
renalware-core-2.0.153 app/models/renalware/pd/patient.rb
renalware-core-2.0.152 app/models/renalware/pd/patient.rb
renalware-core-2.0.151 app/models/renalware/pd/patient.rb