Sha256: d7144b0318ebd994de98f043b5021457f4e7b744ce209e19236b43b15b23c7b5

Contents?: true

Size: 679 Bytes

Versions: 15

Compression:

Stored size: 679 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/admissions"

module Renalware
  module Admissions
    class Request < ApplicationRecord
      include Accountable
      extend Enumerize
      include Sortable

      acts_as_paranoid

      belongs_to :patient, touch: true
      belongs_to :hospital_unit, class_name: "Hospitals::Unit"
      belongs_to :reason, class_name: "RequestReason"

      validates :patient_id, presence: true, uniqueness: true
      validates :reason_id, presence: true
      validates :priority, presence: true

      enumerize :priority, in: %i(low medium high urgent)

      scope :ordered, -> { order(position: :asc) }
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
renalware-core-2.1.1 app/models/renalware/admissions/request.rb
renalware-core-2.1.0 app/models/renalware/admissions/request.rb
renalware-core-2.0.167 app/models/renalware/admissions/request.rb
renalware-core-2.0.166 app/models/renalware/admissions/request.rb
renalware-core-2.0.165 app/models/renalware/admissions/request.rb
renalware-core-2.0.164 app/models/renalware/admissions/request.rb
renalware-core-2.0.163 app/models/renalware/admissions/request.rb
renalware-core-2.0.162 app/models/renalware/admissions/request.rb
renalware-core-2.0.161 app/models/renalware/admissions/request.rb
renalware-core-2.0.160 app/models/renalware/admissions/request.rb
renalware-core-2.0.159 app/models/renalware/admissions/request.rb
renalware-core-2.0.158 app/models/renalware/admissions/request.rb
renalware-core-2.0.157 app/models/renalware/admissions/request.rb
renalware-core-2.0.156 app/models/renalware/admissions/request.rb
renalware-core-2.0.155 app/models/renalware/admissions/request.rb