Sha256: 8d3b60404ed579ac79994436e5c952890375a222f7308377d3aa32e7e0826e09

Contents?: true

Size: 633 Bytes

Versions: 10

Compression:

Stored size: 633 Bytes

Contents

require_dependency "renalware/pathology"

module Renalware
  module Pathology
    class ObservationRequest < ApplicationRecord
      has_many :observations, foreign_key: :request_id
      belongs_to :description, class_name: "RequestDescription"
      belongs_to :patient, class_name: "Patient", touch: true

      accepts_nested_attributes_for :observations

      validates :patient, presence: true
      validates :requestor_name, presence: true
      validates :requested_at, presence: true

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

      def requested_on
        requested_at.to_date
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.rc1 app/models/renalware/pathology/observation_request.rb
renalware-core-2.0.0.pre.beta12 app/models/renalware/pathology/observation_request.rb
renalware-core-2.0.0.pre.beta11 app/models/renalware/pathology/observation_request.rb
renalware-core-2.0.0.pre.beta10 app/models/renalware/pathology/observation_request.rb
renalware-core-2.0.0.pre.beta9 app/models/renalware/pathology/observation_request.rb
renalware-core-2.0.0.pre.beta8 app/models/renalware/pathology/observation_request.rb
renalware-core-2.0.0.pre.beta7 app/models/renalware/pathology/observation_request.rb
renalware-core-2.0.0.pre.beta6 app/models/renalware/pathology/observation_request.rb
renalware-core-2.0.0.pre.beta5 app/models/renalware/pathology/observation_request.rb
renalware-core-2.0.0.pre.beta4 app/models/renalware/pathology/observation_request.rb