Sha256: 2873cdaa4b1624d10473a9adc3b6f61363e4e25ae69e862abd08ac5f98991243

Contents?: true

Size: 655 Bytes

Versions: 19

Compression:

Stored size: 655 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/admissions"

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

      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

19 entries across 19 versions & 1 rubygems

Version Path
renalware-core-2.0.77 app/models/renalware/admissions/request.rb
renalware-core-2.0.76 app/models/renalware/admissions/request.rb
renalware-core-2.0.75 app/models/renalware/admissions/request.rb
renalware-core-2.0.74 app/models/renalware/admissions/request.rb
renalware-core-2.0.73 app/models/renalware/admissions/request.rb
renalware-core-2.0.72 app/models/renalware/admissions/request.rb
renalware-core-2.0.71 app/models/renalware/admissions/request.rb
renalware-core-2.0.70 app/models/renalware/admissions/request.rb
renalware-core-2.0.69 app/models/renalware/admissions/request.rb
renalware-core-2.0.68 app/models/renalware/admissions/request.rb
renalware-core-2.0.67 app/models/renalware/admissions/request.rb
renalware-core-2.0.64 app/models/renalware/admissions/request.rb
renalware-core-2.0.63 app/models/renalware/admissions/request.rb
renalware-core-2.0.62 app/models/renalware/admissions/request.rb
renalware-core-2.0.61 app/models/renalware/admissions/request.rb
renalware-core-2.0.60 app/models/renalware/admissions/request.rb
renalware-core-2.0.58 app/models/renalware/admissions/request.rb
renalware-core-2.0.57 app/models/renalware/admissions/request.rb
renalware-core-2.0.56 app/models/renalware/admissions/request.rb