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.0.84 lib/tasks/audit.rake
renalware-core-2.0.83 lib/tasks/audit.rake
renalware-core-2.0.82 lib/tasks/audit.rake
renalware-core-2.0.81 lib/tasks/audit.rake
renalware-core-2.0.80 lib/tasks/audit.rake
renalware-core-2.0.79 lib/tasks/audit.rake
renalware-core-2.0.78 lib/tasks/audit.rake
renalware-core-2.0.77 lib/tasks/audit.rake
renalware-core-2.0.76 lib/tasks/audit.rake
renalware-core-2.0.75 lib/tasks/audit.rake
renalware-core-2.0.74 lib/tasks/audit.rake
renalware-core-2.0.73 lib/tasks/audit.rake
renalware-core-2.0.72 lib/tasks/audit.rake
renalware-core-2.0.71 lib/tasks/audit.rake
renalware-core-2.0.70 lib/tasks/audit.rake
renalware-core-2.0.69 lib/tasks/audit.rake
renalware-core-2.0.68 lib/tasks/audit.rake
renalware-core-2.0.67 lib/tasks/audit.rake
renalware-core-2.0.64 lib/tasks/audit.rake
renalware-core-2.0.63 lib/tasks/audit.rake