Skip to content

Commit

Permalink
Copy 2023 SPM into new 2024 version (#5043)
Browse files Browse the repository at this point in the history
* clone 2023 SPM into 2024 SPM

* additional 2023 -> 2024 SPM reference updates
  • Loading branch information
dtgreiner authored Jan 9, 2025
1 parent 4573e6f commit aab1129
Show file tree
Hide file tree
Showing 32 changed files with 2,879 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def models
IncomeBenefitsReport::Client,
MaYyaReport::Client,
HudSpmReport::Fy2023::SpmEnrollment,
HudSpmReport::Fy2024::SpmEnrollment,
GrdaWarehouse::AdHocClient,
CePerformance::Client,
GrdaWarehouse::ClientContact,
Expand Down
10 changes: 5 additions & 5 deletions app/models/grda_warehouse/utility.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ def self.clear!
tables << HudPathReport::Fy2020::PathClient if RailsDrivers.loaded.include?(:hud_path_report)
if RailsDrivers.loaded.include?(:hud_spm_report)
tables << HudSpmReport::Fy2020::SpmClient
tables << HudSpmReport::Fy2023::SpmEnrollment
tables << HudSpmReport::Fy2023::Episode
tables << HudSpmReport::Fy2023::BedNight
tables << HudSpmReport::Fy2023::EnrollmentLink
tables << HudSpmReport::Fy2023::Return
tables << HudSpmReport::Fy2024::SpmEnrollment
tables << HudSpmReport::Fy2024::Episode
tables << HudSpmReport::Fy2024::BedNight
tables << HudSpmReport::Fy2024::EnrollmentLink
tables << HudSpmReport::Fy2024::Return
end

if RailsDrivers.loaded.include?(:hud_data_quality_report)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ class BaseController < ::HudReports::BaseController
def available_report_versions
{
'FY 2020' => { slug: :fy2020, active: false },
'FY 2023 (current)' => { slug: :fy2023, active: true },
'FY 2023' => { slug: :fy2023, active: false },
'FY 2024 (current)' => { slug: :fy2024, active: true },
}.freeze
end
helper_method :available_report_versions

def default_report_version
:fy2023
:fy2024
end

private def relevant_project_types
Expand Down Expand Up @@ -96,6 +97,7 @@ def path_for_report_download(report, args)
{
fy2020: HudSpmReport::Generators::Fy2020::Generator,
fy2023: HudSpmReport::Generators::Fy2023::Generator,
fy2024: HudSpmReport::Generators::Fy2024::Generator,
}
end
end
Expand Down
2 changes: 1 addition & 1 deletion drivers/hud_spm_report/app/models/hud_spm_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

module HudSpmReport
def self.current_generator
HudSpmReport::Generators::Fy2023::Generator
HudSpmReport::Generators::Fy2024::Generator
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def generator_url
[
HudSpmReport::Generators::Fy2020::Generator,
HudSpmReport::Generators::Fy2023::Generator,
HudSpmReport::Generators::Fy2024::Generator,
]
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
###
# Copyright 2016 - 2025 Green River Data Analysis, LLC
#
# License detail: https://github.com/greenriver/hmis-warehouse/blob/production/LICENSE.md
###

module HudSpmReport::Fy2024
class BedNight < GrdaWarehouseBase
self.table_name = 'hud_report_spm_bed_nights'

belongs_to :client, class_name: 'GrdaWarehouse::Hud::Client'
belongs_to :enrollment, class_name: 'HudSpmReport::Fy2024::SpmEnrollment'
belongs_to :episode, optional: true
belongs_to :service, class_name: 'GrdaWarehouse::Hud::Service', optional: true
end
end
36 changes: 36 additions & 0 deletions drivers/hud_spm_report/app/models/hud_spm_report/fy2024/detail.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
###
# Copyright 2016 - 2025 Green River Data Analysis, LLC
#
# License detail: https://github.com/greenriver/hmis-warehouse/blob/production/LICENSE.md
###

module HudSpmReport::Fy2024::Detail
extend ActiveSupport::Concern

included do
private_class_method def self.header_label(col)
case col.to_s
when 'client_id'
'Warehouse Client ID'
when 'personal_id', 'enrollment.personal_id', 'exit_enrollment.personal_id'
'HMIS Personal ID'
when 'enrollment.first_name', 'exit_enrollment.first_name'
'First Name'
when 'enrollment.last_name', 'exit_enrollment.last_name'
'Last Name'
when 'exit_enrollment.enrollment.project.project_name'
'Exited Project Name'
when 'return_enrollment.enrollment.project.project_name'
'Returned Project Name'
when 'data_source_id'
'Data Source ID'
when 'los_under_threshold'
'LOS Under Threshold'
when 'previous_street_essh'
'Previous Street ESSH'
else
col.humanize
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
###
# Copyright 2016 - 2025 Green River Data Analysis, LLC
#
# License detail: https://github.com/greenriver/hmis-warehouse/blob/production/LICENSE.md
###

module HudSpmReport::Fy2024
class EnrollmentLink < GrdaWarehouseBase
self.table_name = 'hud_report_spm_enrollment_links'
belongs_to :enrollment, class_name: 'HudSpmReport::Fy2024::SpmEnrollment'
belongs_to :episode, optional: true
end
end
Loading

0 comments on commit aab1129

Please sign in to comment.