Sha256: 98c0fa468f7cef14633889e0d670cc2b98bcaa73f206276afaabe94439d9ada5
Contents?: true
Size: 887 Bytes
Versions: 60
Compression:
Stored size: 887 Bytes
Contents
# frozen_string_literal: true require_dependency "renalware/clinical" module Renalware module Clinical class DryWeightsPresenter DEFAULT_LIMIT = 10_000 attr_reader :patient, :limit def initialize(patient:, dry_weights: nil, limit: nil) @patient = patient @limit = limit || DEFAULT_LIMIT @weights = dry_weights # optional otherwise we grab them ourselves end def weights @weights ||= begin Renalware::Clinical::DryWeight.for_patient(patient) .includes(:assessor) .limit(limit) .ordered end end def dry_weights @dry_weights ||= begin CollectionPresenter.new(weights, Renalware::Clinical::DryWeightPresenter) end end end end end
Version data entries
60 entries across 60 versions & 1 rubygems