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.85 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.84 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.83 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.82 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.81 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.80 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.79 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.78 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.77 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.76 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.75 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.74 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.73 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.72 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.71 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.70 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.69 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.68 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.67 app/models/renalware/accesses/procedure.rb
renalware-core-2.0.64 app/models/renalware/accesses/procedure.rb