Sha256: 9f4f2a721b4a526e6b34e494ac220280efa332b854cdbe062b5a60fe1b0ab130

Contents?: true

Size: 1.04 KB

Versions: 116

Compression:

Stored size: 1.04 KB

Contents

# frozen_string_literal: true

begin
  namespace :audit do
    desc <<-DESC
      Queues delayed jobs to generate monthly HD audits for each patient with a signed-off HD
      Session in the specified month and year. If no year or month supplied, it will generate
      stats for last month for each patient.

      Example usage:

      To generate monthly stats for last month:
        bundle exec rake audit:patient_hd_statistics

      To generate monthly stats for a specific month:
        bundle exec rake audit:patient_hd_statistics year=2018 month=5

    DESC
    task patient_hd_statistics: :environment do
      logger           = Logger.new(STDOUT)
      logger.level     = Logger::INFO
      Rails.logger     = logger

      Renalware::HD::GenerateMonthlyStatistics.new(
        month: ENV["month"],
        year: ENV["year"]
      ).call

      # Refresh the materialized view which will aggregate the monthly hd_patient_statistics data
      RefreshMaterializedViewJob.perform_later(view_name: "renalware.reporting_hd_overall_audit")
    end
  end
end

Version data entries

116 entries across 116 versions & 1 rubygems

Version Path
renalware-core-2.1.1 lib/tasks/audit.rake
renalware-core-2.1.0 lib/tasks/audit.rake
renalware-core-2.0.167 lib/tasks/audit.rake
renalware-core-2.0.166 lib/tasks/audit.rake
renalware-core-2.0.165 lib/tasks/audit.rake
renalware-core-2.0.164 lib/tasks/audit.rake
renalware-core-2.0.163 lib/tasks/audit.rake
renalware-core-2.0.162 lib/tasks/audit.rake
renalware-core-2.0.161 lib/tasks/audit.rake
renalware-core-2.0.160 lib/tasks/audit.rake
renalware-core-2.0.159 lib/tasks/audit.rake
renalware-core-2.0.158 lib/tasks/audit.rake
renalware-core-2.0.157 lib/tasks/audit.rake
renalware-core-2.0.156 lib/tasks/audit.rake
renalware-core-2.0.155 lib/tasks/audit.rake
renalware-core-2.0.153 lib/tasks/audit.rake
renalware-core-2.0.152 lib/tasks/audit.rake
renalware-core-2.0.151 lib/tasks/audit.rake
renalware-core-2.0.149 lib/tasks/audit.rake
renalware-core-2.0.148 lib/tasks/audit.rake