Sha256: a04d5eb73377ba01f5bc92dd2d07c3ca269fff95c78a87dee5c4a7b86370e3e6

Contents?: true

Size: 888 Bytes

Versions: 9

Compression:

Stored size: 888 Bytes

Contents

require_dependency "renalware/admissions"

module Renalware
  module Admissions
    class Consult < ApplicationRecord
      include Accountable
      extend Enumerize
      acts_as_paranoid
      validates :patient_id, presence: true
      validates :started_on, presence: true
      validates :description, presence: true
      validates :consult_type, presence: true
      validates :other_site_or_ward, presence: {
        if: ->(consult){ consult.consult_site_id.blank? && consult.hospital_ward_id.blank? }
      }

      belongs_to :patient
      belongs_to :consult_site, class_name: "Admissions::ConsultSite"
      belongs_to :hospital_ward, class_name: "Hospitals::Ward"
      belongs_to :seen_by, class_name: "User"

      enumerize :transfer_priority, in: %i(unknown necessary desirable potential unnecessary)
      enumerize :aki_risk, in: %i(yes no unknown)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.rc11 app/models/renalware/admissions/consult.rb
renalware-core-2.0.0.pre.rc10 app/models/renalware/admissions/consult.rb
renalware-core-2.0.0.pre.rc9 app/models/renalware/admissions/consult.rb
renalware-core-2.0.0.pre.rc8 app/models/renalware/admissions/consult.rb
renalware-core-2.0.0.pre.rc7 app/models/renalware/admissions/consult.rb
renalware-core-2.0.0.pre.rc6 app/models/renalware/admissions/consult.rb
renalware-core-2.0.0.pre.rc5 app/models/renalware/admissions/consult.rb
renalware-core-2.0.0.pre.rc4 app/models/renalware/admissions/consult.rb
renalware-core-2.0.0.pre.rc3 app/models/renalware/admissions/consult.rb