Sha256: 958600c01328d887c5f6f2c2e335c91d2c13b2e7eaf70b46c4a438785724f42c
Contents?: true
Size: 764 Bytes
Versions: 2
Compression:
Stored size: 764 Bytes
Contents
require_dependency "renalware/pathology" module Renalware module Pathology class Observation < ApplicationRecord belongs_to :request, class_name: "ObservationRequest", touch: true, inverse_of: :observations belongs_to :description, class_name: "ObservationDescription" validates :description, presence: true validates :result, presence: true validates :observed_at, presence: true scope :ordered, -> { order(observed_at: :desc) } scope :for_description, ->(description) { where(description: description) } scope :having_a_loinc_code, -> { joins(:description).where("loinc_code is not null") } def observed_on observed_at.to_date end delegate :to_s, to: :result end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
renalware-core-2.0.0.pre.rc10 | app/models/renalware/pathology/observation.rb |
renalware-core-2.0.0.pre.rc9 | app/models/renalware/pathology/observation.rb |