From 07eb18405515e270de034bebb1ebf12ffa397818 Mon Sep 17 00:00:00 2001 From: Brandon Dorner Date: Tue, 11 Jul 2023 16:34:31 -0500 Subject: [PATCH] Remove all instances of CertificationStats This functionality of the app has been deprecated. More details will be placed in the corresponding PR but the original deprecation comes from the PRs: https://github.com/department-of-veterans-affairs/caseflow/pull/11934 and https://github.com/department-of-veterans-affairs/caseflow/issues/12991 More specifically it looks like this was meant to be removed but was not per: https://github.com/department-of-veterans-affairs/caseflow/issues/12991#issuecomment-578819666 Last note is that there will also be other removed sections related to this, `dispatch_stats` and potentially 'StatsContainer. These will be in another commit/PR because those are more obscure while the `certification_stats` stuff can for sure be removed. --- app/models/certification_stats.rb | 67 -------- app/views/certification_stats/show.html.erb | 172 -------------------- 2 files changed, 239 deletions(-) delete mode 100644 app/models/certification_stats.rb delete mode 100644 app/views/certification_stats/show.html.erb diff --git a/app/models/certification_stats.rb b/app/models/certification_stats.rb deleted file mode 100644 index 4ddca0f08b4..00000000000 --- a/app/models/certification_stats.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true - -## -# CertificationStats is an interface to quickly access statistics for Caseflow Certification -# it is responsible for aggregating and caching statistics. -# -class CertificationStats < Caseflow::Stats - # :nocov: - CALCULATIONS = { - certifications_started: lambda do |range| - Certification.where(created_at: range).count - end, - - certifications_completed: lambda do |range| - Certification.where(completed_at: range).count - end, - - same_period_completions: lambda do |range| - Certification.completed.where(created_at: range).count - end, - - missing_doc_same_period_completions: lambda do |range| - Certification.was_missing_doc.merge(Certification.completed).where(created_at: range).count - end, - - time_to_certify: lambda do |range| - CertificationStats.percentile(:time_to_certify, Certification.where(completed_at: range), 95) - end, - - missing_doc_time_to_certify: lambda do |range| - CertificationStats.percentile(:time_to_certify, Certification.was_missing_doc.where(created_at: range), 95) - end, - - median_time_to_certify: lambda do |range| - CertificationStats.percentile(:time_to_certify, Certification.where(completed_at: range), 50) - end, - - median_missing_doc_time_to_certify: lambda do |range| - CertificationStats.percentile(:time_to_certify, Certification.was_missing_doc.where(created_at: range), 50) - end, - - missing_doc: lambda do |range| - Certification.was_missing_doc.where(created_at: range).count - end, - - missing_nod: lambda do |range| - Certification.was_missing_nod.where(created_at: range).count - end, - - missing_soc: lambda do |range| - Certification.was_missing_soc.where(created_at: range).count - end, - - missing_ssoc: lambda do |range| - Certification.was_missing_ssoc.where(created_at: range).count - end, - - ssoc_required: lambda do |range| - Certification.ssoc_required.where(created_at: range).count - end, - - missing_form9: lambda do |range| - Certification.was_missing_form9.where(created_at: range).count - end - }.freeze - # :nocov: -end diff --git a/app/views/certification_stats/show.html.erb b/app/views/certification_stats/show.html.erb deleted file mode 100644 index aa9038a49c0..00000000000 --- a/app/views/certification_stats/show.html.erb +++ /dev/null @@ -1,172 +0,0 @@ -<% content_for :page_title do stats_header end %> - -<% content_for :head do %> - <%= javascript_include_tag 'stats' %> - -<% end %> - -
-

Certification Dashboard

-
-
    - <% CertificationStats::INTERVALS.each do |interval| %> -
  • "> - - - <%= link_to interval.to_s.capitalize, certification_stats_path(interval) %> - - -
  • - <% end %> -
- -
-

Activity

-
-

- Certifications Started -

-
- <%= @stats[0].values[:certifications_started] %> -
-
- -
-

- Certifications Completed -

-
- <%= @stats[0].values[:certifications_completed] %> -
-
-
- -
-

Certification Rate

- -
-

- Overall -

-
- <%= format_rate_stat(:same_period_completions, :certifications_started) %> -
-
- -
-

- Missing Document -

-
- <%= format_rate_stat(:missing_doc_same_period_completions, :missing_doc) %> -
-
-
- -
-

Time to Certify

-
-
-

- Overall (median) -

-
- <%= format_time_duration_stat(@stats[0].values[:median_time_to_certify]) %> -
-
-
-

- Overall (95th percentile) -

-
- <%= format_time_duration_stat(@stats[0].values[:time_to_certify]) %> -
-
-
- -
-
-

- Missing Document (median) -

-
- <%= format_time_duration_stat(@stats[0].values[:median_missing_doc_time_to_certify]) %> -
-
-
-

- Missing Document (95th percentile) -

-
- <%= format_time_duration_stat(@stats[0].values[:missing_doc_time_to_certify]) %> -
-
-
-
- -
-

Missing Documents

- -
-

- Any Document -

-
- <%= format_rate_stat(:missing_doc, :certifications_started) %> -
-
- -
-

- NOD -

-
- <%= format_rate_stat(:missing_nod, :certifications_started) %> -
-
- -
-

- SOC -

-
- <%= format_rate_stat(:missing_soc, :certifications_started) %> -
-
-
- -
- -
-

- SSOC -

-
- <%= format_rate_stat(:missing_ssoc, :ssoc_required) %> -
-
- -
-

- Form 9 -

-
- <%= format_rate_stat(:missing_form9, :certifications_started) %> -
-
-
-
-