Sha256: 4b5dc9fca0bfe593f713a2fabac3d178db4ee84e254e80e3dd8eddf15c1aa106

Contents?: true

Size: 944 Bytes

Versions: 19

Compression:

Stored size: 944 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(
        versions: { class_name: "Renalware::Accesses::Version" },
        on: [:create, :update, :destroy]
      )

      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

19 entries across 19 versions & 1 rubygems

Version Path
renalware-core-2.1.1 app/models/renalware/accesses/assessment.rb
renalware-core-2.1.0 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.167 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.166 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.165 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.164 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.163 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.162 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.161 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.160 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.159 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.158 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.157 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.156 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.155 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.153 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.152 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.151 app/models/renalware/accesses/assessment.rb
renalware-core-2.0.149 app/models/renalware/accesses/assessment.rb