Sha256: 94b1368581cdc7ef55f0debb11f70fb8b39d311f544bc1cc67ce8a30c6f1ce82
Contents?: true
Size: 983 Bytes
Versions: 35
Compression:
Stored size: 983 Bytes
Contents
# This job when executed will store a snapshot of last month's HD session statistics # for each HD patient. module Renalware module HD class GenerateMonthlyStatisticsJob < ApplicationJob queue_as :hd_patient_statistics # :reek:UtilityFunction def perform patients.each do |patient| GenerateMonthlyStatisticsForPatientJob.perform_later( patient: patient, month: month, year: year ) end end private def patients @patients ||= Sessions::AuditablePatientsInPeriodQuery.new(period: period).call end def period @period ||= MonthPeriod.new(month: month, year: year) end def month date_falling_in_the_previous_month.month end def year date_falling_in_the_previous_month.year end def date_falling_in_the_previous_month @date ||= Time.zone.today - 1.month end end end end
Version data entries
35 entries across 35 versions & 1 rubygems