Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose RRH Sub Types and limit HMIS DQ Tool #5112

Merged
merged 2 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/controllers/api/projects_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ def index
:id,
:ProjectName, # OK to use non-confidentialized name because list is filtered by confidentiality in project_scope
:ProjectType,
:RRHSubType,
o_t[:OrganizationName],
o_t[:id],
ds_t[:short_name],
).each do |id, p_name, type, o_name, o_id, ds_name|
).each do |id, p_name, type, rrh_sub_type, o_name, o_id, ds_name|
o_name_at_ds = "#{o_name} at #{ds_name}"
@data[[o_id, o_name_at_ds]] ||= []

p_name += " (#{HudUtility2024.project_type_brief(type)})" if HudUtility2024.project_type_brief(type).present?
p_name += " (#{HudUtility2024.brief_project_type_with_sub_type(type, rrh_sub_type)})" if HudUtility2024.brief_project_type_with_sub_type(type).present?
@data[[o_id, o_name_at_ds]] << [
p_name,
id,
Expand Down
12 changes: 12 additions & 0 deletions app/models/grda_warehouse/hud/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,18 @@ def rrh?
project_type_to_use.in?(HudUtility2024.performance_reporting[:rrh])
end

def rrh_sso_only?
rrh? && self.RRHSubType == rrh_sso_sub_type_code
end

def rrh_with_housing?
rrh? && self.RRHSubType != rrh_sso_sub_type_code
end

def rrh_sso_sub_type_code
HudUtility2024.rrh_sub_type('RRH: Services Only', true)
end

def psh?
project_type_to_use.in?(HudUtility2024.performance_reporting[:psh])
end
Expand Down
4 changes: 2 additions & 2 deletions app/views/clients/_enrollment_table.haml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
%td.nobr
.ds.jClickToCopy{class: "ds-color-#{e[:data_source_id]}", data: { toggle: :tooltip, html: 'true', title: ds_tooltip_content(e[:client_source_id], e[:data_source_id]).html_safe }}= ds_short_name_for(e[:client_source_id])
.enrollment__project_type{class: e[:class]}
%span.service-type__program-type{data: {toggle: :tooltip, title: HudUtility2024.project_type(e[:project_type_id])}}
= e[:project_type]
%span.service-type__program-type{data: {toggle: :tooltip, title: HudUtility2024.project_type_with_sub_type(e[:project_type_id], e[:rrh_sub_type])}}
= HudUtility2024.brief_project_type_with_sub_type(e[:project_type_id], e[:rrh_sub_type])
- if e[:confidential_project] && can_view_confidential_project_names?
.confidential_project{data: {toggle: :tooltip, title: GrdaWarehouse::Hud::Project.confidential_project_name}}
CP
Expand Down
4 changes: 2 additions & 2 deletions app/views/data_sources/_project.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
= link_to_if can_view_projects?, project.name(current_user, ignore_confidential_status: can_edit_projects?), project_path(project)
%td.d-flex
.enrollment__project_type.mr-2{class: "client__service_type_#{project.ProjectType}"}
.service-type__program-type{data: {toggle: :tooltip, title: HudUtility2024.project_type(project.ProjectType)}}
= HudUtility2024.project_type_brief project.ProjectType
.service-type__program-type{data: { toggle: :tooltip, title: HudUtility2024.project_type_with_sub_type(project.project_type, project.rrh_sub_type) }}
= HudUtility2024.brief_project_type_with_sub_type(project.project_type, project.rrh_sub_type)
%td.text-center
%span{data: {toggle: :tooltip, title: project.confidential_hint}}
= checkmark project.confidential
Expand Down
2 changes: 1 addition & 1 deletion app/views/projects/show.haml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
%tr
%th Project Type
%td
= HudUtility2024.project_type(@project.ProjectType)
= HudUtility2024.project_type_with_sub_type(@project.project_type, @project.rrh_sub_type)
- if @project.active_homeless_status_override.present?
%br
%em Enrolled clients are actively homeless for CAS and Cohorts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ def enrollments_for_rollup(user:, en_scope: scope, include_confidential_names: f
household: household(entry.household_id, entry.enrollment.data_source_id),
project_type: ::HudUtility2024.project_type_brief(entry.project_type),
project_type_id: entry.project_type,
rrh_sub_type: project.rrh_sub_type,
class: "client__service_type_#{entry.project_type}",
most_recent_service: most_recent_service,
new_episode: new_episode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def self.overlapping_entry_exit(enrollments:, report:)
# check for overlapping PH post-move-in
def self.overlapping_post_move_in(enrollments:, report:)
involved_enrollments = enrollments.select do |en|
en.project&.ph?
en.project&.ph? && ! en.project&.rrh_sso_only?
end

return [] if involved_enrollments.blank? || involved_enrollments.count == 1
Expand Down Expand Up @@ -288,7 +288,7 @@ def self.overlapping_homeless_post_move_in(enrollments:, report:)

# moved-in PH enrollments
involved_enrollments = enrollments.select do |en|
en.project&.ph? && en.MoveInDate.present?
en.project&.ph? && ! en.project&.rrh_sso_only? && en.MoveInDate.present?
end
return [] if involved_enrollments.blank?

Expand Down
25 changes: 25 additions & 0 deletions lib/util/hud_utility_2024.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,31 @@ def veteran_status(*args)
no_yes_reasons_for_missing_data(*args)
end

def project_type_with_sub_type(type, sub_type = nil)
[
project_type(type),
rrh_sub_type(sub_type),
].compact_blank.join(' — ')
end

def brief_project_type_with_sub_type(type, sub_type = nil)
[
project_type_brief(type),
rrh_sub_type_brief(sub_type),
].compact_blank.join(' — ')
end

def rrh_sub_types_brief
{
1 => 'SSO',
2 => 'Housing',
}.freeze
end

def rrh_sub_type_brief(id, reverse = false, raise_on_missing: false)
_translate(rrh_sub_types_brief, id, reverse, raise_on_missing: raise_on_missing)
end

def project_type_number(type)
# attempt to lookup full name
number = project_type(type, true) # reversed
Expand Down