Sha256: e08749b9fe16547e10955d0d6daaeb3a367b7cdeaaf65677702be329f84bed3f

Contents?: true

Size: 733 Bytes

Versions: 16

Compression:

Stored size: 733 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/renal"

module Renalware
  module Renal
    class AKIAlert < ApplicationRecord
      include Accountable
      include PatientsRansackHelper
      scope :ordered, ->{ order(created_at: :desc) }
      belongs_to :patient, class_name: "Renal::Patient", touch: true
      belongs_to :action, class_name: "Renal::AKIAlertAction"
      belongs_to :hospital_ward, class_name: "Hospitals::Ward"
      validates :patient, presence: true
      validates :max_aki, inclusion: 1..3, allow_nil: true
      alias_attribute :decided_by, :updated_by

      scope :today, ->{ where(created_at: Time.zone.today.all_day) }
      scope :hotlist, ->{ where(hotlist: true) }
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
renalware-core-2.0.41 app/models/renalware/renal/aki_alert.rb
renalware-core-2.0.40 app/models/renalware/renal/aki_alert.rb
renalware-core-2.0.39 app/models/renalware/renal/aki_alert.rb
renalware-core-2.0.38 app/models/renalware/renal/aki_alert.rb
renalware-core-2.0.37 app/models/renalware/renal/aki_alert.rb
renalware-core-2.0.36 app/models/renalware/renal/aki_alert.rb
renalware-core-2.0.35 app/models/renalware/renal/aki_alert.rb
renalware-core-2.0.34 app/models/renalware/renal/aki_alert.rb
renalware-core-2.0.33 app/models/renalware/renal/aki_alert.rb
renalware-core-2.0.32 app/models/renalware/renal/aki_alert.rb
renalware-core-2.0.31 app/models/renalware/renal/aki_alert.rb
renalware-core-2.0.30 app/models/renalware/renal/aki_alert.rb
renalware-core-2.0.28 app/models/renalware/renal/aki_alert.rb
renalware-core-2.0.27 app/models/renalware/renal/aki_alert.rb
renalware-core-2.0.26 app/models/renalware/renal/aki_alert.rb
renalware-core-2.0.25 app/models/renalware/renal/aki_alert.rb