Sha256: 85650803c604768d1a3eecf4a23d0b09db47a9a46a76821565927986128710e1
Contents?: true
Size: 915 Bytes
Versions: 86
Compression:
Stored size: 915 Bytes
Contents
# frozen_string_literal: true require_dependency "renalware/medications" require "collection_presenter" module Renalware module Admissions class ConsultSummaryPart < Renalware::SummaryPart delegate :nhs_number, to: :patient, prefix: true def consults @consults ||= begin CollectionPresenter.new( Admissions::Consult .where(patient: patient) .includes(:created_by, :hospital_ward, :patient) .order(started_on: :desc) .limit(5), Renalware::Admissions::ConsultPresenter ) end end def consults_count title_friendly_collection_count( actual: consults.size, total: Admissions::Consult.where(patient: patient).count ) end def to_partial_path "renalware/admissions/consults/summary_part" end end end end
Version data entries
86 entries across 86 versions & 1 rubygems