Sha256: 283b9d0704cd22325dad24544f86e35dbea6f4f340f1d4675baf0363904ecc7b

Contents?: true

Size: 870 Bytes

Versions: 35

Compression:

Stored size: 870 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/accesses"
require "document/base"

module Renalware
  module Accesses
    class Assessment < ApplicationRecord
      include Document::Base
      include Accountable
      extend Enumerize

      belongs_to :patient, touch: true
      belongs_to :type, class_name: "Type"

      has_document class_name: "Renalware::Accesses::AssessmentDocument"
      has_paper_trail class_name: "Renalware::Accesses::Version"

      scope :ordered, -> { order(performed_on: :desc) }

      validates :type, presence: true
      validates :side, presence: true
      validates :performed_on, presence: true
      validates :performed_on, timeliness: { type: :date, allow_blank: false }
      validates :procedure_on, timeliness: { type: :date, allow_blank: true }

      enumerize :side, in: %i(left right)
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
renalware-core-2.0.46 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.45 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.44 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.43 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.42 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.41 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.40 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.39 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.38 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.37 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.36 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.35 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.34 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.33 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.32 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.31 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.30 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.28 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.27 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.26 app/models/renalware/accesses/assessment.rb