Sha256: e1e775ce18c4c31f18d5a6c9b7c26ea73c26365455928e414c5f1bf039e2062a

Contents?: true

Size: 953 Bytes

Versions: 95

Compression:

Stored size: 953 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/accesses"

module Renalware
  module Accesses
    class Procedure < ApplicationRecord
      include Accountable
      extend Enumerize

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

      has_paper_trail class_name: "Renalware::Accesses::Version", on: [:create, :update, :destroy]

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

      validates :type, presence: true
      validates :performed_by, presence: true
      validates :performed_on, presence: true
      validates :performed_on, timeliness: { type: :date, allow_blank: false }
      validates :first_used_on, timeliness: { type: :date, allow_blank: true }
      validates :failed_on, timeliness: { type: :date, allow_blank: true }

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

Version data entries

95 entries across 95 versions & 1 rubygems

Version Path
renalware-core-2.0.148 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.147 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.146 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.145 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.144 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.143 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.142 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.141 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.140 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.139 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.138 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.137 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.136 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.135 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.134 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.133 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.132 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.131 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.130 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.129 app/models/renalware/accesses/procedure.rb