diff --git a/app/controllers/clients/anomalies_controller.rb b/app/controllers/clients/anomalies_controller.rb
index 5cc90b8182..0bd51f5432 100644
--- a/app/controllers/clients/anomalies_controller.rb
+++ b/app/controllers/clients/anomalies_controller.rb
@@ -66,7 +66,7 @@ def flash_interpolation_options
end
protected def title_for_show
- "#{@client.name} - Anomalies"
+ "#{@client.pii_provider(user: current_user).full_name} - Anomalies"
end
private def anomaly_params
diff --git a/app/controllers/clients/audits_controller.rb b/app/controllers/clients/audits_controller.rb
index 0a6e8f92cd..7ad3c48e3b 100644
--- a/app/controllers/clients/audits_controller.rb
+++ b/app/controllers/clients/audits_controller.rb
@@ -28,6 +28,6 @@ def set_client
end
def title_for_show
- "#{@client.name} - Audit"
+ "#{@client.pii_provider(user: current_user).full_name} - Audit"
end
end
diff --git a/app/controllers/clients/cas_readiness_controller.rb b/app/controllers/clients/cas_readiness_controller.rb
index b2f141bcd1..93e5cd59d0 100644
--- a/app/controllers/clients/cas_readiness_controller.rb
+++ b/app/controllers/clients/cas_readiness_controller.rb
@@ -65,7 +65,7 @@ def cas_readiness_params
end
def title_for_show
- "#{@client.name} - CAS Readiness"
+ "#{@client.pii_provider(user: current_user).full_name} - CAS Readiness"
end
end
end
diff --git a/app/controllers/clients/chronic_controller.rb b/app/controllers/clients/chronic_controller.rb
index 79961871d3..62e2ee3366 100644
--- a/app/controllers/clients/chronic_controller.rb
+++ b/app/controllers/clients/chronic_controller.rb
@@ -47,7 +47,7 @@ def cas_readiness_params
end
def title_for_show
- "#{@client.name} - Chronic"
+ "#{@client.pii_provider(user: current_user).full_name} - Chronic"
end
end
end
diff --git a/app/controllers/clients/coordinated_entry_assessments_controller.rb b/app/controllers/clients/coordinated_entry_assessments_controller.rb
index 62694b7aa7..4febe8878f 100644
--- a/app/controllers/clients/coordinated_entry_assessments_controller.rb
+++ b/app/controllers/clients/coordinated_entry_assessments_controller.rb
@@ -96,7 +96,7 @@ def update
end
private def title_for_show
- "#{@client.name} - #{Translation.translate('Coordinated Entry Assessment')}"
+ "#{@client.pii_provider(user: current_user).full_name} - #{Translation.translate('Coordinated Entry Assessment')}"
end
def flash_interpolation_options
diff --git a/app/controllers/clients/enrollment_history_controller.rb b/app/controllers/clients/enrollment_history_controller.rb
index 8eb8b2def6..b4547be8e4 100644
--- a/app/controllers/clients/enrollment_history_controller.rb
+++ b/app/controllers/clients/enrollment_history_controller.rb
@@ -40,7 +40,7 @@ def history_scope
end
def title_for_show
- "#{@client.name} - Historical Enrollments"
+ "#{@client.pii_provider(user: current_user).full_name} - Historical Enrollments"
end
end
end
diff --git a/app/controllers/clients/files_controller.rb b/app/controllers/clients/files_controller.rb
index c27c25a79c..228bed97cf 100644
--- a/app/controllers/clients/files_controller.rb
+++ b/app/controllers/clients/files_controller.rb
@@ -268,7 +268,7 @@ def file_source
end
protected def title_for_show
- "#{@client.name} - Files"
+ "#{@client.pii_provider(user: current_user).full_name} - Files"
end
def window_visible?(visibility)
diff --git a/app/controllers/clients/hud_lots_controller.rb b/app/controllers/clients/hud_lots_controller.rb
index d9ce2d66a2..758d25f099 100644
--- a/app/controllers/clients/hud_lots_controller.rb
+++ b/app/controllers/clients/hud_lots_controller.rb
@@ -29,7 +29,7 @@ def index
end
private def title_for_show
- "#{@client.name} - Client-Level System Use & Length of Time Homeless Report"
+ "#{@client.pii_provider(user: current_user).full_name} - Client-Level System Use & Length of Time Homeless Report"
end
helper_method :title_for_show
diff --git a/app/controllers/clients/notes_controller.rb b/app/controllers/clients/notes_controller.rb
index 44e4fdf8eb..268e10d71b 100644
--- a/app/controllers/clients/notes_controller.rb
+++ b/app/controllers/clients/notes_controller.rb
@@ -112,7 +112,7 @@ def destroy
end
private def title_for_show
- "#{@client.name} - Notes"
+ "#{@client.pii_provider(user: current_user).full_name} - Notes"
end
end
end
diff --git a/app/controllers/clients/releases_controller.rb b/app/controllers/clients/releases_controller.rb
index 860936df37..1a1ac6a68f 100644
--- a/app/controllers/clients/releases_controller.rb
+++ b/app/controllers/clients/releases_controller.rb
@@ -139,7 +139,7 @@ def pre_populated
private def render_pdf!
@pdf = true
- file_name = "Release of Information for #{@client.name}"
+ file_name = "Release of Information for #{@client.pii_provider(user: current_user).full_name}"
send_data roi_pdf(file_name), filename: "#{file_name}.pdf", type: 'application/pdf'
end
@@ -175,7 +175,7 @@ def file_source
end
protected def title_for_show
- "#{@client.name} - Release of Information"
+ "#{@client.pii_provider(user: current_user).full_name} - Release of Information"
end
def window_visible?(_visibility)
diff --git a/app/controllers/clients/users_controller.rb b/app/controllers/clients/users_controller.rb
index 2d5fa35ca2..ea0c6eabd1 100644
--- a/app/controllers/clients/users_controller.rb
+++ b/app/controllers/clients/users_controller.rb
@@ -76,7 +76,7 @@ def set_user
end
protected def title_for_show
- "#{@client.name} - Relationships"
+ "#{@client.pii_provider(user: current_user).full_name} - Relationships"
end
end
end
diff --git a/app/controllers/clients/vispdats_controller.rb b/app/controllers/clients/vispdats_controller.rb
index f7a2da6202..b5e5700ec7 100644
--- a/app/controllers/clients/vispdats_controller.rb
+++ b/app/controllers/clients/vispdats_controller.rb
@@ -164,7 +164,7 @@ def destroy_file
end
private def title_for_show
- "#{@client.name} - VI-SPDATs"
+ "#{@client.pii_provider(user: current_user).full_name} - VI-SPDATs"
end
end
end
diff --git a/app/controllers/clients/youth/intakes_controller.rb b/app/controllers/clients/youth/intakes_controller.rb
index 4fde5bad0d..9c83cd5a17 100644
--- a/app/controllers/clients/youth/intakes_controller.rb
+++ b/app/controllers/clients/youth/intakes_controller.rb
@@ -88,7 +88,7 @@ def remove_all_youth_data
@client.youth_follow_ups.destroy_all
# TODO: This does not remove the client from the Youth DataSource
- flash[:notice] = "All Youth information for #{@client.name} has been removed."
+ flash[:notice] = "All Youth information for #{@client.pii_provider(user: current_user).full_name} has been removed."
redirect_to client_youth_intakes_path(@client)
else
not_authorized!
diff --git a/app/controllers/cohorts/client_notes_controller.rb b/app/controllers/cohorts/client_notes_controller.rb
index 399e7d4f71..0256ffe589 100644
--- a/app/controllers/cohorts/client_notes_controller.rb
+++ b/app/controllers/cohorts/client_notes_controller.rb
@@ -83,7 +83,7 @@ def cohort_id
end
def flash_interpolation_options
- { resource_name: "Note for #{@note.client.name}" }
+ { resource_name: "Note for #{@note.client.pii_provider(user: current_user).full_name}" }
end
end
end
diff --git a/app/controllers/cohorts/clients_controller.rb b/app/controllers/cohorts/clients_controller.rb
index 805a9a2c69..6326340dab 100644
--- a/app/controllers/cohorts/clients_controller.rb
+++ b/app/controllers/cohorts/clients_controller.rb
@@ -485,7 +485,7 @@ def destroy
else
log_removal(@client.cohort_id, @client.id, params.dig(:grda_warehouse_cohort_client, :reason))
if @client.destroy
- flash[:notice] = "Removed #{@client.name}"
+ flash[:notice] = "Removed #{@client.pii_provider(user: current_user).full_name}"
redirect_to cohort_path(@cohort)
else
render :pre_destroy
diff --git a/app/controllers/cohorts/notes_controller.rb b/app/controllers/cohorts/notes_controller.rb
index d6b7435830..1cc2ce4568 100644
--- a/app/controllers/cohorts/notes_controller.rb
+++ b/app/controllers/cohorts/notes_controller.rb
@@ -88,7 +88,7 @@ def cohort_id
end
def flash_interpolation_options
- { resource_name: "Note for #{@note.client.name}" }
+ { resource_name: "Note for #{@note.client.pii_provider(user: current_user).full_name}" }
end
end
end
diff --git a/app/controllers/concerns/activity_logger.rb b/app/controllers/concerns/activity_logger.rb
index c9d3706063..ee303088d5 100644
--- a/app/controllers/concerns/activity_logger.rb
+++ b/app/controllers/concerns/activity_logger.rb
@@ -58,7 +58,7 @@ def log_activity
# override as necessary in the controller
protected def title_for_show
- return @client.name if @client.present?
+ return @client.pii_provider(user: current_user).full_name if @client.present?
return @user.name if @user.present?
end
diff --git a/app/models/grda_warehouse/pii_provider.rb b/app/models/grda_warehouse/pii_provider.rb
index adadaf420f..b7e2e5b4c9 100644
--- a/app/models/grda_warehouse/pii_provider.rb
+++ b/app/models/grda_warehouse/pii_provider.rb
@@ -17,6 +17,12 @@ def self.viewable_name(value, policy:, replacement: REDACTED)
value.presence
end
+ def self.viewable_ssn(value, policy:, replacement: REDACTED)
+ return replacement unless policy.can_view_full_ssn?
+
+ value.presence
+ end
+
def self.viewable_dob(value, policy:, replacement: REDACTED)
return replacement unless policy.can_view_full_dob?
@@ -46,32 +52,44 @@ def self.from_attributes(policy: nil, first_name: nil, last_name: nil, middle_na
new(record, policy: policy)
end
+ def redact_name?
+ ! policy.can_view_name?
+ end
+
+ def redact_ssn?
+ ! policy.can_view_full_ssn?
+ end
+
+ def redact_dob?
+ ! policy.can_view_full_dob?
+ end
+
def first_name
- return name_redacted unless policy.can_view_name?
+ return name_redacted if redact_name?
record.first_name.presence
end
def last_name
- return name_redacted unless policy.can_view_name?
+ return name_redacted if redact_name?
record.last_name.presence
end
def middle_name
- return name_redacted unless policy.can_view_name?
+ return name_redacted if redact_name?
record.middle_name.presence
end
def full_name
- return name_redacted unless policy.can_view_name?
+ return name_redacted if redact_name?
[record.first_name, record.middle_name, record.last_name].compact.join(' ').presence
end
def brief_name
- return name_redacted unless policy.can_view_name?
+ return name_redacted if redact_name?
[record.first_name, record.last_name].compact.join(' ').presence
end
@@ -84,7 +102,7 @@ def dob_and_age(force_year_only: false)
return nil unless record.dob
display_dob = record.dob
- display_dob = display_dob&.year if force_year_only || !policy.can_view_full_dob?
+ display_dob = display_dob&.year if force_year_only || redact_dob?
"#{display_dob} (#{age})"
end
@@ -101,7 +119,7 @@ def age
def ssn(force_mask: false)
value = record.ssn.presence
- mask = force_mask || !policy.can_view_full_ssn?
+ mask = force_mask || redact_ssn?
format_ssn(value, mask: mask) if value
end
diff --git a/app/views/clients/_assessment_form.html.haml b/app/views/clients/_assessment_form.html.haml
index 7fd4b24d61..f07c207165 100644
--- a/app/views/clients/_assessment_form.html.haml
+++ b/app/views/clients/_assessment_form.html.haml
@@ -1,13 +1,13 @@
- if @form[:answers].present?
- form_name = (@form.assessment_type == @form.name) ? @form.name : "#{@form.assessment_type} < #{@form.name}"
- content_for :modal_title, form_name
-
+
.d-flex
.w-100
.ssm__summary.d-flex.flex-column
.mb-2
%dt.inline Name:
- %dd.inline= @client.name
+ %dd.inline= @client.pii_provider(user: current_user).full_name
.mb-2
%dt.inline Date Completed:
%dd.inline= @form.collected_at&.to_date
@@ -29,9 +29,3 @@
.client__assessment-answer= question[:answer]
- else
- content_for :modal_title, "Assessment Form Not Found"
-
-
-
-
-
-
diff --git a/app/views/clients/_enrollment_table.haml b/app/views/clients/_enrollment_table.haml
index 19fcf5d9bc..755b0ace4d 100644
--- a/app/views/clients/_enrollment_table.haml
+++ b/app/views/clients/_enrollment_table.haml
@@ -120,7 +120,10 @@
- tooltip += "Exit: #{c['last_date_in_program']}
"
.mb-2.mt-2{ data: { toggle: :tooltip, title: tooltip, html: 'true', boundary: :window } }
= link_to client_path(c['client_id']), class: 'd-block' do
- #{c['FirstName']} #{c['LastName']}
+ - if @client.pii_provider(user: current_user).redact_name?
+ = @client.pii_provider(user: current_user).first_name
+ - else
+ #{c['FirstName']} #{c['LastName']}
- if c['head_of_household']
%i.icon-user
%br
diff --git a/app/views/clients/_match_results.html.haml b/app/views/clients/_match_results.html.haml
index ff17f23480..fb00a25e00 100644
--- a/app/views/clients/_match_results.html.haml
+++ b/app/views/clients/_match_results.html.haml
@@ -5,12 +5,12 @@
%thead
%tr
%th{colspan: 2} Client
- %th DOB
+ %th DOB/Age
%th SSN
%tbody
- clients.each do |c|
%tr.client__potential-match
- - client_name = "#{c.full_name}"
+ - client_name = "#{c.pii_provider(user: current_user).full_name}"
- sc_count = c.source_clients.count
- colspan = if sc_count == 1 then 2 else 4 end
- if sc_count == 1
@@ -23,16 +23,8 @@
%label{for:c.id, tabindex:'1' }
= link_to(client_name, client_path(c), target: "_blank")
- if sc_count == 1
- %td
- - if can_view_full_dob?
- = c.DOB
- - else
- = c.age
- %td
- - if can_view_full_ssn?
- = ssn(c.SSN)
- - else
- = masked_ssn(c.SSN)
+ %td= c.pii_provider(user: current_user).dob_or_age
+ %td= c.pii_provider(user: current_user).ssn
- else
- c.source_clients.each do |sc|
%tr
@@ -42,11 +34,6 @@
.c-checkbox.c-checkbox.mr-4
= check_box_tag input_id, sc.id, nil, id: sc.id
%label{for:sc.id, tabindex:'1' }
- %span= "#{sc.full_name} in #{sc.data_source&.short_name}
#{sc.uuid}".html_safe
- %td
- = sc.DOB
- %td
- - if can_view_full_ssn?
- = ssn(sc.SSN)
- - else
- = masked_ssn(sc.SSN)
+ %span= "#{sc.pii_provider(user: current_user).full_name} in #{sc.data_source&.short_name}
#{sc.uuid}".html_safe
+ %td= sc.pii_provider(user: current_user).dob_or_age
+ %td= sc.pii_provider(user: current_user).ssn
diff --git a/app/views/clients/_new_client_form.haml b/app/views/clients/_new_client_form.haml
index 170c53aee3..ea7a43ba8f 100644
--- a/app/views/clients/_new_client_form.haml
+++ b/app/views/clients/_new_client_form.haml
@@ -18,6 +18,7 @@
%th SSN
%tbody
- @existing_matches.each do |client|
+ - pii = client.pii_provider(user: current_user)
%tr
%td
- ds_id = client.data_source.id
@@ -30,11 +31,9 @@
- else
- link = client.destination_client.appropriate_path_for?(current_user)
= link_to link do
- = client.full_name
- %td
- = client.DOB
- %td
- = client.SSN
+ = pii.full_name
+ %td= pii.dob_or_age
+ %td= pii.ssn
%h2 New Client
%p
If none of the above match the client you are attempting to add, click
diff --git a/app/views/clients/_potential_matches.html.haml b/app/views/clients/_potential_matches.html.haml
index fd6d262788..5ffdfcb181 100644
--- a/app/views/clients/_potential_matches.html.haml
+++ b/app/views/clients/_potential_matches.html.haml
@@ -1,7 +1,7 @@
%h3 Potential Matches
-%p
- This section allows you to merge a client into
- = "#{@client.name}."
+%p
+ This section allows you to merge a client into
+ = "#{@client.pii_provider(user: current_user).full_name}."
If a potential client is the combination of merged clients, you can choose to merge with the client set, or with an individual client.
- if @potential_matches.any?
.row
@@ -12,7 +12,6 @@
= k.to_s.humanize.titlecase
= render 'match_results', f: f, clients: clients
.form-actions
- = f.button :submit, "Merge into #{@client.FirstName} #{@client.LastName}"
+ = f.button :submit, "Merge into #{@client.pii_provider(user: current_user).full_name}"
- else
%p No potential matches found
-
\ No newline at end of file
diff --git a/app/views/clients/_unmerge_form.haml b/app/views/clients/_unmerge_form.haml
index fa6f788a0b..633a9d9766 100644
--- a/app/views/clients/_unmerge_form.haml
+++ b/app/views/clients/_unmerge_form.haml
@@ -30,13 +30,14 @@
%th Data Source
%th Personal ID
%th Name
- %th DOB
+ %th DOB/Age
%th SSN
%th Merged
%th Merged By
%th
%tbody
- source_clients.each do |c|
+ - pii = c.pii_provider(user: current_user)
%tr
%td.jSplit= f.input_field :merge, as: :boolean, checked_value: c.id, unchecked_value: nil, name: input_id
- if GrdaWarehouse::Config.get(:healthcare_available)
@@ -46,9 +47,9 @@
= radio_button_tag 'grda_warehouse_hud_client[health_receiver]', c.id, false, disabled: true
%td= c.data_source&.short_name
%td= c.uuid
- %td= c.full_name
- %td= c.DOB
- %td= ssn c.SSN
+ %td= pii.full_name
+ %td= pii.dob_or_age
+ %td= pii.ssn
%td= c.warehouse_client_source.reviewed_at
%td
- if (user = reviewers[c.warehouse_client_source.reviewd_by.to_i])
@@ -59,7 +60,7 @@
Match Details
.form-actions
- = f.button :submit, "Split selected records from #{@client.FirstName} #{@client.LastName}", id: :splitButton, data: {confirm: "Are you sure you want to split #{@client.FirstName} #{@client.LastName}? Dependent data will be moved to the selected clients."}
+ = f.button :submit, "Split selected records from #{@client.pii_provider(user: current_user).full_name}", id: :splitButton, data: {confirm: "Are you sure you want to split #{@client.pii_provider(user: current_user).full_name}? Dependent data will be moved to the selected clients."}
= content_for :page_js do
:javascript
diff --git a/app/views/clients/anomalies/_breadcrumbs.haml b/app/views/clients/anomalies/_breadcrumbs.haml
index 9a8d124b59..515045c1a6 100644
--- a/app/views/clients/anomalies/_breadcrumbs.haml
+++ b/app/views/clients/anomalies/_breadcrumbs.haml
@@ -1,4 +1,4 @@
= content_for :crumbs do
= link_to client_path(@client) do
- « Back to
- = @client.name
\ No newline at end of file
+ « Back to
+ = @client.pii_provider(user: current_user).full_name
diff --git a/app/views/clients/cas_readiness/_active_clients.haml b/app/views/clients/cas_readiness/_active_clients.haml
index 7225e09e9b..240c354c5d 100644
--- a/app/views/clients/cas_readiness/_active_clients.haml
+++ b/app/views/clients/cas_readiness/_active_clients.haml
@@ -2,7 +2,7 @@
Any client with service within the past #{pluralize(GrdaWarehouse::Config.get(:cas_sync_months), 'month')}.
%p
Will
- %strong= @client.name
+ %strong= @client.pii_provider(user: current_user).full_name
sync with CAS?
%br
= yes_no @client.active_in_cas?(include_overridden: false)
diff --git a/app/views/clients/cas_readiness/_ce_with_assessment.haml b/app/views/clients/cas_readiness/_ce_with_assessment.haml
index 7fa1173e41..f7e5febf35 100644
--- a/app/views/clients/cas_readiness/_ce_with_assessment.haml
+++ b/app/views/clients/cas_readiness/_ce_with_assessment.haml
@@ -2,7 +2,7 @@
Any client currently enrolled in a Coordinated Entry project and having at least one associated assessment.
%p
Will
- %strong= @client.name
+ %strong= @client.pii_provider(user: current_user).full_name
sync with CAS?
%br
= yes_no @client.active_in_cas?(include_overridden: false)
diff --git a/app/views/clients/cas_readiness/_chronic.haml b/app/views/clients/cas_readiness/_chronic.haml
index 3a74308035..1ecb5cba31 100644
--- a/app/views/clients/cas_readiness/_chronic.haml
+++ b/app/views/clients/cas_readiness/_chronic.haml
@@ -2,7 +2,7 @@
All clients on the most recent potentially chronic list will be included in each CAS sync.
%p
Will
- %strong= @client.name
+ %strong= @client.pii_provider(user: current_user).full_name
sync with CAS?
%br
= yes_no @client.active_in_cas?(include_overridden: false)
diff --git a/app/views/clients/cas_readiness/_hud_chronic.haml b/app/views/clients/cas_readiness/_hud_chronic.haml
index 4aa7113954..f698cfc4c6 100644
--- a/app/views/clients/cas_readiness/_hud_chronic.haml
+++ b/app/views/clients/cas_readiness/_hud_chronic.haml
@@ -2,7 +2,7 @@
All clients on the most recent chronic list will be included in each CAS sync.
%p
Will
- %strong= @client.name
+ %strong= @client.pii_provider(user: current_user).full_name
sync with CAS?
%br
= yes_no @client.active_in_cas?(include_overridden: false)
diff --git a/app/views/clients/cas_readiness/_project_group.haml b/app/views/clients/cas_readiness/_project_group.haml
index d53aba4f82..404673e684 100644
--- a/app/views/clients/cas_readiness/_project_group.haml
+++ b/app/views/clients/cas_readiness/_project_group.haml
@@ -2,7 +2,7 @@
Any client in project group '#{GrdaWarehouse::Config.cas_sync_project_group.name}'.
%p
Will
- %strong= @client.name
+ %strong= @client.pii_provider(user: current_user).full_name
sync with CAS?
%br
= yes_no @client.active_in_cas?(include_overridden: false)
diff --git a/app/views/clients/cas_readiness/_release_and_project_group.haml b/app/views/clients/cas_readiness/_release_and_project_group.haml
index abfe4ba2a3..8dc68b5c6d 100644
--- a/app/views/clients/cas_readiness/_release_and_project_group.haml
+++ b/app/views/clients/cas_readiness/_release_and_project_group.haml
@@ -10,7 +10,7 @@
will sync with CAS
%p
Will
- %strong= @client.name
+ %strong= @client.pii_provider(user: current_user).full_name
sync with CAS?
%br
= yes_no @client.active_in_cas?(include_overridden: false)
diff --git a/app/views/clients/cas_readiness/_release_present.haml b/app/views/clients/cas_readiness/_release_present.haml
index 4d133c72ad..b7377e211c 100644
--- a/app/views/clients/cas_readiness/_release_present.haml
+++ b/app/views/clients/cas_readiness/_release_present.haml
@@ -5,7 +5,7 @@
%p
Will
- %strong= @client.name
+ %strong= @client.pii_provider(user: current_user).full_name
sync with CAS?
%br
= yes_no @client.active_in_cas?(include_overridden: false)
diff --git a/app/views/clients/coordinated_entry_assessments/edit.haml b/app/views/clients/coordinated_entry_assessments/edit.haml
index 18e51e50c8..8dc673f27b 100644
--- a/app/views/clients/coordinated_entry_assessments/edit.haml
+++ b/app/views/clients/coordinated_entry_assessments/edit.haml
@@ -1,4 +1,4 @@
-- title = "Editing #{_'Coordinated Entry Assessment'} for #{@client.name}"
+- title = "Editing #{_'Coordinated Entry Assessment'} for #{@client.pii_provider(user: current_user).full_name}"
- content_for :title, title
.o-page
= render 'clients/breadcrumbs'
@@ -11,4 +11,4 @@
= render 'clients/tab_navigation', current: client_coordinated_entry_assessments_path(client_id: @client)
= simple_form_for @assessment, url: client_coordinated_entry_assessment_path(@client, @assessment) do |f|
- = render 'form', f: f, readonly: false
\ No newline at end of file
+ = render 'form', f: f, readonly: false
diff --git a/app/views/clients/coordinated_entry_assessments/new.haml b/app/views/clients/coordinated_entry_assessments/new.haml
index ba4e987cfa..f49a275a5b 100644
--- a/app/views/clients/coordinated_entry_assessments/new.haml
+++ b/app/views/clients/coordinated_entry_assessments/new.haml
@@ -1,4 +1,4 @@
-- title = "New #{_'Coordinated Entry Assessment'} for #{@client.name}"
+- title = "New #{_'Coordinated Entry Assessment'} for #{@client.pii_provider(user: current_user).full_name}"
- content_for :title, title
.o-page
= render 'clients/breadcrumbs'
@@ -11,4 +11,4 @@
= render 'clients/tab_navigation', current: client_coordinated_entry_assessments_path(client_id: @client)
= simple_form_for @assessment, url: client_coordinated_entry_assessments_path(@client) do |f|
- = render 'form', f: f, readonly: false
\ No newline at end of file
+ = render 'form', f: f, readonly: false
diff --git a/app/views/clients/coordinated_entry_assessments/show.haml b/app/views/clients/coordinated_entry_assessments/show.haml
index c264a6336a..ec8d3e5ae6 100644
--- a/app/views/clients/coordinated_entry_assessments/show.haml
+++ b/app/views/clients/coordinated_entry_assessments/show.haml
@@ -1,4 +1,4 @@
-- title = "#{_'Coordinated Entry Assessment'} for #{@client.name}"
+- title = "#{_'Coordinated Entry Assessment'} for #{@client.pii_provider(user: current_user).full_name}"
- content_for :title, title
.o-page
= render 'clients/breadcrumbs'
@@ -11,4 +11,4 @@
= render 'clients/tab_navigation', current: client_coordinated_entry_assessments_path(client_id: @client)
= simple_form_for @assessment, wrapper: :readonly, url: client_coordinated_entry_assessment_path(@client, @assessment) do |f|
- = render 'form', f: f
\ No newline at end of file
+ = render 'form', f: f
diff --git a/app/views/clients/edit.haml b/app/views/clients/edit.haml
index 23aef9ff72..1bdbdf64eb 100644
--- a/app/views/clients/edit.haml
+++ b/app/views/clients/edit.haml
@@ -1,4 +1,4 @@
-- title = "Potential Duplicates for #{@client.name}"
+- title = "Potential Duplicates for #{@client.pii_provider(user: current_user).full_name}"
- content_for :title, title
= render 'breadcrumbs'
diff --git a/app/views/clients/enrollment_history/index.haml b/app/views/clients/enrollment_history/index.haml
index cea0bd859d..953bfe67de 100644
--- a/app/views/clients/enrollment_history/index.haml
+++ b/app/views/clients/enrollment_history/index.haml
@@ -1,4 +1,4 @@
-- title = "Historical Enrollment Data for #{@client.name} on #{@date}"
+- title = "Historical Enrollment Data for #{@client.pii_provider(user: current_user).full_name} on #{@date}"
- content_for :title, title
%h1= title
= render 'clients/anomalies/breadcrumbs'
diff --git a/app/views/clients/enrollments/show.haml b/app/views/clients/enrollments/show.haml
index e1b8d7f1af..51255f7591 100644
--- a/app/views/clients/enrollments/show.haml
+++ b/app/views/clients/enrollments/show.haml
@@ -1,4 +1,4 @@
-- title = "Enrollment at #{@enrollment.project&.name(current_user)} for #{@client.name} "
+- title = "Enrollment at #{@enrollment.project&.name(current_user)} for #{@client.pii_provider(user: current_user).full_name} "
- content_for :title, title
= render 'clients/anomalies/breadcrumbs'
%h1= title
diff --git a/app/views/clients/files/_permission_warning.haml b/app/views/clients/files/_permission_warning.haml
index 1356e31ce6..89784512f7 100644
--- a/app/views/clients/files/_permission_warning.haml
+++ b/app/views/clients/files/_permission_warning.haml
@@ -3,8 +3,8 @@
%i.alert__icon.icon-info
%p
- if can_manage_window_client_files? && @client.release_valid?(coc_codes: current_user.coc_codes)
- = Translation.translate("#{@client.name} has a consent form on file, you can see any client files.")
+ = Translation.translate("#{@client.pii_provider(user: current_user).full_name} has a consent form on file, you can see any client files.")
- elsif can_manage_window_client_files?
- = Translation.translate("#{@client.name} does not have a consent form on file, you can only see files you upload.")
+ = Translation.translate("#{@client.pii_provider(user: current_user).full_name} does not have a consent form on file, you can only see files you upload.")
- else
= Translation.translate("You can only see files you upload.")
diff --git a/app/views/clients/notes/index.haml b/app/views/clients/notes/index.haml
index 4a4cf4373c..7c35de849d 100644
--- a/app/views/clients/notes/index.haml
+++ b/app/views/clients/notes/index.haml
@@ -13,9 +13,9 @@
- unless can_edit_client_notes? || can_view_all_window_notes?
%p.alert.alert-info
- if can_edit_window_client_notes? && @client.release_valid?
- = Translation.translate("#{@client.name} has a consent form on file, you can see any notes about this client.")
+ = Translation.translate("#{@client.pii_provider(user: current_user).full_name} has a consent form on file, you can see any notes about this client.")
- elsif can_edit_window_client_notes?
- = Translation.translate("#{@client.name} does not have a consent form on file, you can only see notes you add.")
+ = Translation.translate("#{@client.pii_provider(user: current_user).full_name} does not have a consent form on file, you can only see notes you add.")
- else
= Translation.translate("You can only see notes you add.")
- if @notes.any?
diff --git a/app/views/clients/releases/_form.haml b/app/views/clients/releases/_form.haml
index 8d1af43786..b31e4b5174 100644
--- a/app/views/clients/releases/_form.haml
+++ b/app/views/clients/releases/_form.haml
@@ -3,7 +3,7 @@
.col-4
%dl
%dt Name:
- %dd= @client.name
+ %dd= @client.pii_provider(user: current_user).full_name
.col-4
%dl
%dt Date of Birth:
diff --git a/app/views/clients/rollup/_family.html.haml b/app/views/clients/rollup/_family.html.haml
index ad8df00eb3..75668a179b 100644
--- a/app/views/clients/rollup/_family.html.haml
+++ b/app/views/clients/rollup/_family.html.haml
@@ -9,14 +9,11 @@
%th Race
%tbody
- @client.family_members.each do |client|
+ - pii = client.pii_provider(user: current_user)
%tr
%td
- = link_to client.name, client_path(client)
- %td
- - if can_view_full_ssn?
- = ssn(client.SSN)
- - else
- = masked_ssn(client.SSN)
+ = link_to pii.full_name, client_path(client)
+ %td= pii.ssn
%td= client.age
%td= client.gender
%td= client.race_fields.map{ |f| HudUtility2024.race(f) }.join ', '
diff --git a/app/views/clients/simple.haml b/app/views/clients/simple.haml
index df60c6900f..ec78b27dfd 100644
--- a/app/views/clients/simple.haml
+++ b/app/views/clients/simple.haml
@@ -1,5 +1,5 @@
-- title = @client.full_name
+- title = @client.pii_provider(user: current_user).full_name
- content_for :title, title
= render 'breadcrumbs'
= render 'tab_navigation', current: simple_client_path(@client)
-= render 'client_card', client: @client, disable_link: true
\ No newline at end of file
+= render 'client_card', client: @client, disable_link: true
diff --git a/app/views/clients/users/index.haml b/app/views/clients/users/index.haml
index aeaae794b3..263b4ae07e 100644
--- a/app/views/clients/users/index.haml
+++ b/app/views/clients/users/index.haml
@@ -1,8 +1,8 @@
-- title = "Assigned Relationships for #{@client.name}"
+- title = "Assigned Relationships for #{@client.pii_provider(user: current_user).full_name}"
- content_for :title, title
= render 'clients/breadcrumbs'
= render 'clients/aliases'
= render 'clients/tab_navigation', current: client_users_path(@client)
-= render 'relationship_list'
\ No newline at end of file
+= render 'relationship_list'
diff --git a/app/views/clients/vispdats/_list.haml b/app/views/clients/vispdats/_list.haml
index 392660088f..93e5327801 100644
--- a/app/views/clients/vispdats/_list.haml
+++ b/app/views/clients/vispdats/_list.haml
@@ -21,7 +21,7 @@
%i.icon-group
Family
-# else
- %button.btn.btn-primary(title="#{@client.full_name} already has a VI-SPDAT in progress. Please complete that one or delete it before starting a new VI-SPDAT" data-toggle='tooltip')
+ %button.btn.btn-primary(title="#{@client.pii_provider(user: current_user).full_name} already has a VI-SPDAT in progress. Please complete that one or delete it before starting a new VI-SPDAT" data-toggle='tooltip')
%span.icon-plus
.card
diff --git a/app/views/clients/vispdats/edit.haml b/app/views/clients/vispdats/edit.haml
index 097e887f06..3bc62aecb4 100644
--- a/app/views/clients/vispdats/edit.haml
+++ b/app/views/clients/vispdats/edit.haml
@@ -16,7 +16,7 @@
%span.icon-eye
View
- if can_edit_vspdat?
- = link_to polymorphic_path(vispdat_path_generator, client_id: @client.id, id: @vispdat.id), class: 'btn btn-danger', title: 'Delete', method: :delete, data: { toggle: 'tooltip', confirm: "Are you sure you want to delete the VI-SPDAT for #{@client.full_name}?" } do
+ = link_to polymorphic_path(vispdat_path_generator, client_id: @client.id, id: @vispdat.id), class: 'btn btn-danger', title: 'Delete', method: :delete, data: { toggle: 'tooltip', confirm: "Are you sure you want to delete the VI-SPDAT for #{@client.pii_provider(user: current_user).full_name}?" } do
%span.icon-cross
Delete
= link_to polymorphic_path(vispdats_path_generator, client_id: @client.id), class: 'btn btn-default', title: 'All', data: { toggle: 'tooltip' } do
diff --git a/app/views/clients/vispdats/new.haml b/app/views/clients/vispdats/new.haml
index 0cbf163dea..cc8cc0b06d 100644
--- a/app/views/clients/vispdats/new.haml
+++ b/app/views/clients/vispdats/new.haml
@@ -1,4 +1,4 @@
-- title = "New VISPDAT for #{@client.name}"
+- title = "New VISPDAT for #{@client.pii_provider(user: current_user).full_name}"
- content_for :title, title
.o-page
= render 'clients/breadcrumbs'
diff --git a/app/views/clients/vispdats/show.haml b/app/views/clients/vispdats/show.haml
index 561227be0f..1f69c8ce0c 100644
--- a/app/views/clients/vispdats/show.haml
+++ b/app/views/clients/vispdats/show.haml
@@ -1,4 +1,4 @@
-- content_for(:title, @client.name)
+- content_for(:title, @client.pii_provider(user: current_user).full_name)
.o-page
= render 'clients/breadcrumbs'
@@ -20,7 +20,7 @@
%span.icon-pencil
Edit
- if can_edit_vspdat?
- = link_to polymorphic_path(vispdat_path_generator, client_id: @client.id, id: @vispdat.id), class: 'btn btn-danger', title: 'Delete', method: :delete, data: { confirm: "Are you sure you want to delete the VI-SPDAT for #{@client.full_name}?" } do
+ = link_to polymorphic_path(vispdat_path_generator, client_id: @client.id, id: @vispdat.id), class: 'btn btn-danger', title: 'Delete', method: :delete, data: { confirm: "Are you sure you want to delete the VI-SPDAT for #{@client.pii_provider(user: current_user).full_name}?" } do
%span.icon-cross
Delete
= link_to polymorphic_path(vispdats_path_generator, client_id: @client.id), class: 'btn btn-default', title: 'All', data: { toggle: 'tooltip' } do
diff --git a/app/views/clients/youth/housing_resolution_plans/_form.haml b/app/views/clients/youth/housing_resolution_plans/_form.haml
index 4a5034f895..8b2059d50c 100644
--- a/app/views/clients/youth/housing_resolution_plans/_form.haml
+++ b/app/views/clients/youth/housing_resolution_plans/_form.haml
@@ -1,11 +1,11 @@
.row
.col-6
- = f.input 'name', as: :string, disabled: true, label: 'YYA Name (goes by)', input_html: {value: @client.name}
+ = f.input 'name', as: :string, disabled: true, label: 'YYA Name (goes by)', input_html: {value: @client.pii_provider(user: current_user).full_name}
.col-6
= f.input :pronouns, label: 'YYA Pronouns'
.row
.col-6
- = f.input 'name', as: :string, disabled: true, label: 'YYA Legal Name', input_html: {value: @client.name}
+ = f.input 'name', as: :string, disabled: true, label: 'YYA Legal Name', input_html: {value: @client.pii_provider(user: current_user).full_name}
.col-6
= f.input :planned_on, as: :date_picker, label: 'Date'
.row
diff --git a/app/views/clients/youth/intakes/_breadcrumbs.haml b/app/views/clients/youth/intakes/_breadcrumbs.haml
index 21ef3bf25c..0bbee9443b 100644
--- a/app/views/clients/youth/intakes/_breadcrumbs.haml
+++ b/app/views/clients/youth/intakes/_breadcrumbs.haml
@@ -1,4 +1,4 @@
= content_for :crumbs do
= link_to polymorphic_path(youth_intakes_path_generator) do
«
- = Translation.translate("Youth Intakes for #{@client.name}")
+ = Translation.translate("Youth Intakes for #{@client.pii_provider(user: current_user).full_name}")
diff --git a/app/views/clients/youth/intakes/_intakes.haml b/app/views/clients/youth/intakes/_intakes.haml
index 7400e6b270..0a34f11066 100644
--- a/app/views/clients/youth/intakes/_intakes.haml
+++ b/app/views/clients/youth/intakes/_intakes.haml
@@ -1,11 +1,11 @@
- if @client.youth_follow_up_due_soon?
%div.alert.alert-warning
%i.alert__icon.icon-warning
- A 3-month follow up case note is due for #{@client.name} on #{@client.youth_follow_up_due_on}
+ A 3-month follow up case note is due for #{@client.pii_provider(user: current_user).full_name} on #{@client.youth_follow_up_due_on}
- if @client.youth_follow_up_due?
%div.alert.alert-danger
%i.alert__icon.icon-warning
- A 3-month follow up case note was due for #{@client.name} on #{@client.youth_follow_up_due_on}
+ A 3-month follow up case note was due for #{@client.pii_provider(user: current_user).full_name} on #{@client.youth_follow_up_due_on}
= render 'intake_list'
= render 'case_management_list'
- if GrdaWarehouse::Config.get(:enable_youth_hrp)
diff --git a/app/views/clients/youth/intakes/edit.haml b/app/views/clients/youth/intakes/edit.haml
index 574910ba71..4c8d38dd46 100644
--- a/app/views/clients/youth/intakes/edit.haml
+++ b/app/views/clients/youth/intakes/edit.haml
@@ -1,4 +1,4 @@
-- content_for :title, "Edit Youth Intake for #{@client.full_name}"
+- content_for :title, "Edit Youth Intake for #{@client.pii_provider(user: current_user).full_name}"
%h1.page-title= content_for :title
@@ -10,4 +10,4 @@
%i.icon-cross
Cancel
.ml-2
- = f.submit 'Save', class: 'btn btn-primary'
\ No newline at end of file
+ = f.submit 'Save', class: 'btn btn-primary'
diff --git a/app/views/clients/youth/intakes/index.haml b/app/views/clients/youth/intakes/index.haml
index eadfe5a738..c870baa8ca 100644
--- a/app/views/clients/youth/intakes/index.haml
+++ b/app/views/clients/youth/intakes/index.haml
@@ -8,6 +8,6 @@
- if can_delete_youth_intake?
.text-right
- = link_to remove_all_youth_data_client_youth_intakes_path(@client), method: :delete, class: 'btn btn-danger', data: {confirm: "Are you sure you want to delete all youth information for #{@client.name}? Deleting is non-reversible, and will remove all items on this page. Proceed?"} do
+ = link_to remove_all_youth_data_client_youth_intakes_path(@client), method: :delete, class: 'btn btn-danger', data: {confirm: "Are you sure you want to delete all youth information for #{@client.pii_provider(user: current_user).full_name}? Deleting is non-reversible, and will remove all items on this page. Proceed?"} do
%i.icon-cross
- Delete All Youth Data
\ No newline at end of file
+ Delete All Youth Data
diff --git a/app/views/clients/youth/intakes/new.haml b/app/views/clients/youth/intakes/new.haml
index ba7fea7bee..a3174847a2 100644
--- a/app/views/clients/youth/intakes/new.haml
+++ b/app/views/clients/youth/intakes/new.haml
@@ -1,4 +1,4 @@
-- content_for :title, "New Youth Intake for #{@client.full_name}"
+- content_for :title, "New Youth Intake for #{@client.pii_provider(user: current_user).full_name}"
%h1.page-title= content_for :title
@@ -10,4 +10,4 @@
%i.icon-cross
Cancel
.ml-2
- = f.submit 'Save', class: 'btn btn-primary'
\ No newline at end of file
+ = f.submit 'Save', class: 'btn btn-primary'
diff --git a/app/views/clients/youth/intakes/show.haml b/app/views/clients/youth/intakes/show.haml
index a0a1b22178..0be6727876 100644
--- a/app/views/clients/youth/intakes/show.haml
+++ b/app/views/clients/youth/intakes/show.haml
@@ -1,5 +1,5 @@
= render 'breadcrumbs'
-- content_for :title, "Youth Intake for #{@client.full_name}"
+- content_for :title, "Youth Intake for #{@client.pii_provider(user: current_user).full_name}"
.d-flex
%h1.page-title= content_for :title
@@ -10,4 +10,4 @@
Edit
= simple_form_for @intake, url: polymorphic_path(youth_intake_path_generator, id: @intake.id), wrapper: :readonly do |f|
- = render 'intake_form', f: f, readonly: true
\ No newline at end of file
+ = render 'intake_form', f: f, readonly: true
diff --git a/app/views/he/clients/boston_covid_19.haml b/app/views/he/clients/boston_covid_19.haml
index 78709e5315..b9880a29b1 100644
--- a/app/views/he/clients/boston_covid_19.haml
+++ b/app/views/he/clients/boston_covid_19.haml
@@ -1,4 +1,4 @@
-- title = @client.full_name
+- title = @client.pii_provider(user: current_user).full_name
- content_for :title, title
= render 'clients/breadcrumbs'
diff --git a/app/views/he/clients/boston_covid_19/_isolation_form.haml b/app/views/he/clients/boston_covid_19/_isolation_form.haml
index 05a5ada702..78f6fca3c8 100644
--- a/app/views/he/clients/boston_covid_19/_isolation_form.haml
+++ b/app/views/he/clients/boston_covid_19/_isolation_form.haml
@@ -2,7 +2,7 @@
.row
- if can_edit_health_emergency_clinical?
.col-md-8
- = f.input :isolation_requested_at, as: :string, label: "When was #{@client.name} asked to isolate?", input_html: { class: :date_time_picker }
+ = f.input :isolation_requested_at, as: :string, label: "When was #{@client.pii_provider(user: current_user).full_name} asked to isolate?", input_html: { class: :date_time_picker }
= f.input :location, label: 'Isolation location', collection: @isolation.location_options, input_html: { data: {tags: true} }, as: :select_two
= f.input :started_on, as: :date_picker, label: 'Isolation start date'
= f.input :scheduled_to_end_on, as: :date_picker, label: 'Scheduled isolation end date'
@@ -14,4 +14,4 @@
= render "he/clients/#{health_emergency}/previous_isolation"
- elsif can_see_health_emergency_clinical?
.col
- = render "he/clients/#{health_emergency}/previous_isolation"
\ No newline at end of file
+ = render "he/clients/#{health_emergency}/previous_isolation"
diff --git a/app/views/he/clients/boston_covid_19/_quarantine_form.haml b/app/views/he/clients/boston_covid_19/_quarantine_form.haml
index d3ad642078..c94f227130 100644
--- a/app/views/he/clients/boston_covid_19/_quarantine_form.haml
+++ b/app/views/he/clients/boston_covid_19/_quarantine_form.haml
@@ -2,7 +2,7 @@
.row
- if can_edit_health_emergency_clinical?
.col-md-8
- = f.input :isolation_requested_at, as: :string, label: "When was #{@client.name} asked to quarantine?", input_html: { class: :date_time_picker }
+ = f.input :isolation_requested_at, as: :string, label: "When was #{@client.pii_provider(user: current_user).full_name} asked to quarantine?", input_html: { class: :date_time_picker }
= f.input :location, label: 'Quarantine location', collection: @quarantine.location_options, input_html: { data: {tags: true} }, as: :select_two
= f.input :started_on, as: :date_picker, label: 'Quarantine start date'
= f.input :scheduled_to_end_on, as: :date_picker, label: 'Scheduled quarantine end date'
@@ -15,4 +15,3 @@
- elsif can_see_health_emergency_clinical?
.col
= render "he/clients/#{health_emergency}/previous_quarantine"
-
diff --git a/app/views/he/clients/boston_covid_19/_triage_form.haml b/app/views/he/clients/boston_covid_19/_triage_form.haml
index c9efac1583..ea87c52466 100644
--- a/app/views/he/clients/boston_covid_19/_triage_form.haml
+++ b/app/views/he/clients/boston_covid_19/_triage_form.haml
@@ -4,8 +4,8 @@
.col-md-8
= f.input :agency, label: 'Where do you work?', collection: Agency.all, as: :select_two, selected: @triage.agency&.id
= f.input :location, label: 'Where is this being collected?'
- = f.input :exposure, collection: @triage.exposure_options, include_blank: '', label: "Has #{@client.name} been exposed?", as: :boolean_button_group
- = f.input :symptoms, collection: @triage.symptom_options, include_blank: '', label: "Does #{@client.name} have symptoms?", as: :boolean_button_group
+ = f.input :exposure, collection: @triage.exposure_options, include_blank: '', label: "Has #{@client.pii_provider(user: current_user).full_name} been exposed?", as: :boolean_button_group
+ = f.input :symptoms, collection: @triage.symptom_options, include_blank: '', label: "Does #{@client.pii_provider(user: current_user).full_name} have symptoms?", as: :boolean_button_group
= f.input :first_symptoms_on, label: 'First symptom date', as: :date_picker
= f.input :referred_on, as: :date_picker
= f.input :referred_to
@@ -16,4 +16,4 @@
= render "he/clients/#{health_emergency}/previous_triage"
- elsif can_see_health_emergency_screening?
.col
- = render "he/clients/#{health_emergency}/previous_triage"
\ No newline at end of file
+ = render "he/clients/#{health_emergency}/previous_triage"
diff --git a/app/views/he/clients/covid_19_vaccinations_only.haml b/app/views/he/clients/covid_19_vaccinations_only.haml
index d9a87b94f1..ff3ef6fd47 100644
--- a/app/views/he/clients/covid_19_vaccinations_only.haml
+++ b/app/views/he/clients/covid_19_vaccinations_only.haml
@@ -1,4 +1,4 @@
-- title = @client.full_name
+- title = @client.pii_provider(user: current_user).full_name
- content_for :title, title
= render 'clients/breadcrumbs'
diff --git a/app/views/projects/_clients.haml b/app/views/projects/_clients.haml
index f2ad399542..2d0b69e9e9 100644
--- a/app/views/projects/_clients.haml
+++ b/app/views/projects/_clients.haml
@@ -14,7 +14,8 @@
%tr
%td
- if ! @project.confidential? || can_edit_projects? || ! project.confidential_for_user?(user)
- = link_to_if can_view_clients?, service.client.name, client_path(service.client)
+ - name = service.client.pii_provider(user: current_user).full_name
+ = link_to_if can_view_clients?, name, client_path(service.client)
- else
Confidential Client
%td= service.first_date_in_program
diff --git a/app/views/source_clients/edit.haml b/app/views/source_clients/edit.haml
index cb7bf7245a..2781101db4 100644
--- a/app/views/source_clients/edit.haml
+++ b/app/views/source_clients/edit.haml
@@ -1,4 +1,4 @@
-- title = "Edit #{@client.name} at #{@client.data_source.name}"
+- title = "Edit #{@client.pii_provider(user: current_user).full_name} at #{@client.data_source.name}"
- content_for :modal_title, title
= simple_form_for(@client, as: :client, url: polymorphic_path(source_client_path_generator, id: @client.id)) do |f|
.row
diff --git a/app/views/source_data/show.haml b/app/views/source_data/show.haml
index e61de59b95..62b6b0a22a 100644
--- a/app/views/source_data/show.haml
+++ b/app/views/source_data/show.haml
@@ -1,4 +1,10 @@
- title = "HMIS #{@type} Source Data"
+
+- pii = nil
+- redact = {}
+- if @item.class.name == 'GrdaWarehouse::Hud::Client'
+ - pii = @item.pii_provider(user: current_user)
+
- content_for :title, title
%h1= content_for :title
- if @hmis
@@ -82,10 +88,36 @@
- value = link_to @item[key], source_data_path(search: {id: @item[key], type: 'Organization'})
- elsif key == :ProjectID && @item.class.name != 'GrdaWarehouse::Hud::Project'
- value = link_to @item[key], source_data_path(search: {id: @item[key], type: 'Project'})
+ - elsif key == :FirstName && pii
+ - value = pii.first_name
+ - elsif key == :MiddleName && pii
+ - value = pii.middle_name
+ - elsif key == :LastName && pii
+ - value = pii.last_name
+ - elsif key == :SSN && pii
+ - value = pii.ssn
+ - elsif key == :DOB && pii
+ - value = pii.dob_and_age
%tr
%th= key
%td= value
- if @imported
- %td= @imported[key]
+ %td
+ - if key.in?([:FirstName, :MiddleName, :LastName])
+ = GrdaWarehouse::PiiProvider.viewable_name(@imported[key], policy: pii.policy)
+ - elsif key.in?([:SSN])
+ = GrdaWarehouse::PiiProvider.viewable_ssn(@imported[key], policy: pii.policy)
+ - elsif key.in?([:DOB])
+ = GrdaWarehouse::PiiProvider.viewable_dob(@imported[key], policy: pii.policy)
+ - else
+ = @imported[key]
- if @csv
- %td= @csv[key]
+ %td
+ - if key.in?([:FirstName, :MiddleName, :LastName])
+ = GrdaWarehouse::PiiProvider.viewable_name(@csv[key], policy: pii.policy)
+ - elsif key.in?([:SSN])
+ = GrdaWarehouse::PiiProvider.viewable_ssn(@csv[key], policy: pii.policy)
+ - elsif key.in?([:DOB])
+ = GrdaWarehouse::PiiProvider.viewable_dob(@csv[key], policy: pii.policy)
+ - else
+ = @csv[key]
diff --git a/app/views/warehouse_reports/anomalies/_section.haml b/app/views/warehouse_reports/anomalies/_section.haml
index eef30ea8d6..0455b3ccd6 100644
--- a/app/views/warehouse_reports/anomalies/_section.haml
+++ b/app/views/warehouse_reports/anomalies/_section.haml
@@ -18,7 +18,7 @@
%tr
%td
- if anomaly.client.present?
- = link_to_if can_view_clients?, anomaly.client.name, appropriate_client_path(anomaly.client)
+ = link_to_if can_view_clients?, anomaly.client.pii_provider(user: current_user).full_name, appropriate_client_path(anomaly.client)
- else
Client no longer available
%td
diff --git a/app/views/warehouse_reports/cas/health_prioritization/index.haml b/app/views/warehouse_reports/cas/health_prioritization/index.haml
index 50d35d82a6..207c8bb183 100644
--- a/app/views/warehouse_reports/cas/health_prioritization/index.haml
+++ b/app/views/warehouse_reports/cas/health_prioritization/index.haml
@@ -30,7 +30,7 @@
%tbody
- @clients.each do |client|
%tr
- %td= link_to_if can_view_clients?, client.name, appropriate_client_path(client)
+ %td= link_to_if can_view_clients?, client.pii_provider(user: current_user).full_name, appropriate_client_path(client)
%td= client.age
%td.text-center
- disability = @disabilities.key?(client.id)
diff --git a/app/views/warehouse_reports/cas/health_prioritization/index.xlsx.axlsx b/app/views/warehouse_reports/cas/health_prioritization/index.xlsx.axlsx
index 777cd92682..ff67175fd1 100644
--- a/app/views/warehouse_reports/cas/health_prioritization/index.xlsx.axlsx
+++ b/app/views/warehouse_reports/cas/health_prioritization/index.xlsx.axlsx
@@ -30,7 +30,7 @@ wb.add_worksheet(name: 'Health Prioritization') do |sheet|
row = [
client.id,
- ::GrdaWarehouse::Config.get(:include_pii_in_detail_downloads) ? client.name : 'Redacted',
+ ::GrdaWarehouse::Config.get(:include_pii_in_detail_downloads) ? client.pii_provider(user: current_user).full_name : 'Redacted',
client.age,
disability,
vispdat_disability,
diff --git a/app/views/warehouse_reports/ce_assessments/index.haml b/app/views/warehouse_reports/ce_assessments/index.haml
index 04f931d22f..4772843c0d 100644
--- a/app/views/warehouse_reports/ce_assessments/index.haml
+++ b/app/views/warehouse_reports/ce_assessments/index.haml
@@ -21,9 +21,10 @@
%th Completed?
%tbody
- @clients.each do |client|
+ - pii = client.pii_provider(user: current_user)
%tr
- %td= link_to_if can_view_clients?, client.name, appropriate_client_path(client)
- %td= client.DOB
+ %td= link_to_if can_view_clients?, pii.full_name, appropriate_client_path(client)
+ %td= pii.dob_or_age
%td= client.ce_assessment.location
%td= client.ce_assessment.score
%td= client.ce_assessment.vulnerability_score
diff --git a/app/views/warehouse_reports/conflicting_client_attributes/index.haml b/app/views/warehouse_reports/conflicting_client_attributes/index.haml
index 93a9d9cc30..13b9895950 100644
--- a/app/views/warehouse_reports/conflicting_client_attributes/index.haml
+++ b/app/views/warehouse_reports/conflicting_client_attributes/index.haml
@@ -24,10 +24,11 @@
%th SSN
%tbody
- @clients.each do |client|
+ - pii = client.pii_provider(user: current_user)
%tr
- %td= link_to_if can_view_clients?, client.name, appropriate_client_path(client)
- %td= dob_or_age client.DOB
- %td= ssn client.SSN
+ %td= link_to_if can_view_clients?, pii.full_name, appropriate_client_path(client)
+ %td= pii.dob_or_age
+ %td= pii.ssn
= render 'common/pagination_bottom', item_name: 'client'
- else
.none-found No clients found.
diff --git a/app/views/warehouse_reports/consent/index.haml b/app/views/warehouse_reports/consent/index.haml
index c1cd7bf176..8bcbdc5682 100644
--- a/app/views/warehouse_reports/consent/index.haml
+++ b/app/views/warehouse_reports/consent/index.haml
@@ -41,7 +41,7 @@
- columns_to_skip = @cohorts_for_unconfirmed.count
%tr
%td.pl-2
- = link_to_if can_view_clients?, client.full_name, appropriate_client_path(client)
+ = link_to_if can_view_clients?, client.pii_provider(user: current_user).full_name, appropriate_client_path(client)
%td.text-center
- if current_user.can_confirm_housing_release?
- if client.active_in_cas?
diff --git a/app/views/warehouse_reports/dob_entry_same/index.haml b/app/views/warehouse_reports/dob_entry_same/index.haml
index 25c3b27e6f..9af6d7dfd7 100644
--- a/app/views/warehouse_reports/dob_entry_same/index.haml
+++ b/app/views/warehouse_reports/dob_entry_same/index.haml
@@ -19,10 +19,11 @@
%th Project
%tbody
- @clients.each do |client|
+ - pii = client.pii_provider(user: current_user)
- enrollment = client.source_enrollments.select{ |m| m[:EntryDate] == client.DOB }.first
%tr
- %td= link_to_if can_view_clients?, client.name, appropriate_client_path(client)
- %td= client.DOB
+ %td= link_to_if can_view_clients?, pii.full_name, appropriate_client_path(client)
+ %td= pii.dob_or_age
%td= enrollment&.EntryDate
%td= enrollment&.project&.name(current_user)
= render 'common/pagination_bottom', item_name: 'client'
diff --git a/app/views/warehouse_reports/dv_victim_service/_table.haml b/app/views/warehouse_reports/dv_victim_service/_table.haml
index c31045d451..ceb82b0c7b 100644
--- a/app/views/warehouse_reports/dv_victim_service/_table.haml
+++ b/app/views/warehouse_reports/dv_victim_service/_table.haml
@@ -13,7 +13,7 @@
- client = source_client.destination_client
%tr
%td= client.id
- %td= link_to_if can_view_clients?, source_client.name, appropriate_client_path(client.id)
+ %td= link_to_if can_view_clients?, source_client.pii_provider(user: current_user).full_name, appropriate_client_path(client.id)
= render 'common/pagination_bottom', item_name: 'client'
- else
.none-found No clients found.
diff --git a/app/views/warehouse_reports/expiring_consent/index.haml b/app/views/warehouse_reports/expiring_consent/index.haml
index bd00e5616d..7ce21f51d8 100644
--- a/app/views/warehouse_reports/expiring_consent/index.haml
+++ b/app/views/warehouse_reports/expiring_consent/index.haml
@@ -18,7 +18,7 @@
- @unconfirmed.each do |client|
%tr
%td
- = link_to_if can_view_clients?, client.full_name, appropriate_client_path(client)
+ = link_to_if can_view_clients?, client.pii_provider(user: current_user).full_name, appropriate_client_path(client)
%td
= client.consent_form_signed_on + client.class.consent_validity_period
%td
@@ -40,7 +40,7 @@
- @expiring_clients.each do |client|
%tr
%td
- = link_to_if can_view_clients?, client.full_name, appropriate_client_path(client)
+ = link_to_if can_view_clients?, client.pii_provider(user: current_user).full_name, appropriate_client_path(client)
%td
= client.consent_form_signed_on + client.class.consent_validity_period
%td
@@ -62,7 +62,7 @@
- @expired_clients.each do |client|
%tr
%td
- = link_to_if can_view_clients?, client.full_name, appropriate_client_path(client)
+ = link_to_if can_view_clients?, client.pii_provider(user: current_user).full_name, appropriate_client_path(client)
%td
= client.consent_form_signed_on + client.class.consent_validity_period
%td
diff --git a/app/views/warehouse_reports/health_emergency/medical_restrictions/_table.haml b/app/views/warehouse_reports/health_emergency/medical_restrictions/_table.haml
index 292c755ed3..0b606471d3 100644
--- a/app/views/warehouse_reports/health_emergency/medical_restrictions/_table.haml
+++ b/app/views/warehouse_reports/health_emergency/medical_restrictions/_table.haml
@@ -21,15 +21,16 @@
%tbody
- @restrictions.each do |restriction|
- client = restriction.client
+ - pii = client.pii_provider(user: current_user)
- batch_class = if restriction.in_batch?(params[:batch_id]) then 'report-hightlight' else '' end
%tr
%td{class: batch_class}
- if @html && client.image
.client__image{ style: "background-image: url(#{ image_client_path(client) })" }
%td= link_to_if @html, client.id, polymorphic_path(['client_he', health_emergency], client_id: client)
- %td= link_to_if @html, client.name, polymorphic_path(['client_he', health_emergency], client_id: client)
- %td= client.DOB
- %td= client.age
+ %td= link_to_if @html, pii.full_name, polymorphic_path(['client_he', health_emergency], client_id: client)
+ %td= pii.dob
+ %td= pii.age
%td= restriction.created_at.to_date
%td= simple_format(restriction.notes || restriction.note)
- if @html
diff --git a/app/views/warehouse_reports/inactive_youth_intakes/_table.haml b/app/views/warehouse_reports/inactive_youth_intakes/_table.haml
index b2a94619d9..7efd28d22d 100644
--- a/app/views/warehouse_reports/inactive_youth_intakes/_table.haml
+++ b/app/views/warehouse_reports/inactive_youth_intakes/_table.haml
@@ -16,7 +16,7 @@
%tbody
- @report.clients.each do |client|
%tr
- %td= link_to client.client.name, client_youth_intakes_path(client.client)
+ %td= link_to client.client.pii_provider(user: current_user).full_name, client_youth_intakes_path(client.client)
%td= client.intake.engagement_date
- highlight_class = if client.case_mangement.present? && client.case_mangement == client.max_date then 'table-warning' else '' end
%td{class: highlight_class}= client.case_mangement
diff --git a/app/views/warehouse_reports/incomes/index.haml b/app/views/warehouse_reports/incomes/index.haml
index 380e259001..617fc4db7f 100644
--- a/app/views/warehouse_reports/incomes/index.haml
+++ b/app/views/warehouse_reports/incomes/index.haml
@@ -33,7 +33,7 @@
- @enrollments.each do |record|
%tr
%td
- = link_to_if can_view_clients?, record.client.name, appropriate_client_path(record.client)
+ = link_to_if can_view_clients?, record.client.pii_provider(user: current_user).full_name, appropriate_client_path(record.client)
%td
%ul.list-unstyled
- record.enrollment.income_benefits_at_entry&.sources_and_amounts&.each do |name, amount|
diff --git a/app/views/warehouse_reports/outflow/details.haml b/app/views/warehouse_reports/outflow/details.haml
index 019b215cbe..ef22dde1a3 100644
--- a/app/views/warehouse_reports/outflow/details.haml
+++ b/app/views/warehouse_reports/outflow/details.haml
@@ -31,7 +31,7 @@
%td{rowspan: enrollments.count+1}
= link_to_if can_view_clients?, client.id, appropriate_client_path(client.id)
%td{rowspan: enrollments.count+1}
- = link_to_if can_view_clients?, client.name, appropriate_client_path(client.id)
+ = link_to_if can_view_clients?, client.pii_provider(user: current_user).full_name, appropriate_client_path(client.id)
- enrollments.each do |enrollment|
%tr
%td= enrollment.project&.name(current_user)
diff --git a/app/views/warehouse_reports/recidivism/index.haml b/app/views/warehouse_reports/recidivism/index.haml
index b826d42059..e14a82f88c 100644
--- a/app/views/warehouse_reports/recidivism/index.haml
+++ b/app/views/warehouse_reports/recidivism/index.haml
@@ -25,7 +25,7 @@
.warehouse-reports__client
.warehouse-reports__client-name
%h4
- = link_to_if can_view_clients?, client.full_name, appropriate_client_path(client)
+ = link_to_if can_view_clients?, client.pii_provider(user: current_user).full_name, appropriate_client_path(client)
.row
.col-sm-6
%h4 PH Enrollments
diff --git a/app/views/warehouse_reports/time_homeless_for_exits/_table.haml b/app/views/warehouse_reports/time_homeless_for_exits/_table.haml
index 77675c6d78..103bae6e8e 100644
--- a/app/views/warehouse_reports/time_homeless_for_exits/_table.haml
+++ b/app/views/warehouse_reports/time_homeless_for_exits/_table.haml
@@ -15,7 +15,7 @@
%tbody
- @report.data.each do |client|
%tr
- %td= link_to_if can_view_clients?, client.client.name, appropriate_client_path(client.client)
+ %td= link_to_if can_view_clients?, client.client.pii_provider(user: current_user).full_name, appropriate_client_path(client.client)
%td= client.days
%td= client.entry_date
%td= client.exit_date
diff --git a/app/views/warehouse_reports/youth_activity/index.haml b/app/views/warehouse_reports/youth_activity/index.haml
index 3e257cdcb6..e139c98959 100644
--- a/app/views/warehouse_reports/youth_activity/index.haml
+++ b/app/views/warehouse_reports/youth_activity/index.haml
@@ -12,7 +12,7 @@
- else
%p No modifications were made to youth records between #{@filter.start} and #{@filter.end}.
- @clients.find_each do |client|
- %h3= client.name
+ %h3= client.pii_provider(user: current_user).full_name
.c-card.mb-4
.c-card__content
- # We've preloaded all, use ruby select to pick those in range
diff --git a/drivers/client_access_control/app/controllers/client_access_control/history_controller.rb b/drivers/client_access_control/app/controllers/client_access_control/history_controller.rb
index cfe3154dc1..23b859cd8a 100644
--- a/drivers/client_access_control/app/controllers/client_access_control/history_controller.rb
+++ b/drivers/client_access_control/app/controllers/client_access_control/history_controller.rb
@@ -111,7 +111,7 @@ def client_needing_processing?(client: @client)
end
private def title_for_show
- "#{@client.name} - Service History"
+ "#{@client.pii_provider(user: current_user).full_name} - Service History"
end
end
end
diff --git a/drivers/client_access_control/app/views/client_access_control/clients/enrollment_details.haml b/drivers/client_access_control/app/views/client_access_control/clients/enrollment_details.haml
index 3d2f8239b5..77049d6cde 100644
--- a/drivers/client_access_control/app/views/client_access_control/clients/enrollment_details.haml
+++ b/drivers/client_access_control/app/views/client_access_control/clients/enrollment_details.haml
@@ -1,4 +1,4 @@
-- title = @client.full_name
+- title = @client.pii_provider(user: current_user).full_name
- content_for :title, title
= render 'clients/breadcrumbs'
diff --git a/drivers/client_access_control/app/views/client_access_control/clients/simple.haml b/drivers/client_access_control/app/views/client_access_control/clients/simple.haml
index a0c0c970fd..fbc99faa19 100644
--- a/drivers/client_access_control/app/views/client_access_control/clients/simple.haml
+++ b/drivers/client_access_control/app/views/client_access_control/clients/simple.haml
@@ -1,4 +1,4 @@
-- title = @client.full_name
+- title = @client.pii_provider(user: current_user).full_name
- content_for :title, title
= render 'clients/breadcrumbs'
= render 'clients/tab_navigation', current: simple_client_path(@client)
diff --git a/drivers/client_documents_report/app/views/client_documents_report/warehouse_reports/reports/index.haml b/drivers/client_documents_report/app/views/client_documents_report/warehouse_reports/reports/index.haml
index da834cb937..59d6a622ce 100644
--- a/drivers/client_documents_report/app/views/client_documents_report/warehouse_reports/reports/index.haml
+++ b/drivers/client_documents_report/app/views/client_documents_report/warehouse_reports/reports/index.haml
@@ -46,7 +46,7 @@
%tbody
- @clients.each do |client|
%tr
- %td= link_to_if can_view_clients?, client.name, appropriate_client_path(client)
+ %td= link_to_if can_view_clients?, client.pii_provider(user: current_user).full_name, appropriate_client_path(client)
%td= @report.required_documents(client).count
%td= @report.optional_documents(client).count
%td= @report.overall_documents(client).count
diff --git a/drivers/client_location_history/app/models/client_location_history/location.rb b/drivers/client_location_history/app/models/client_location_history/location.rb
index 30474f46d4..56c7bcc07d 100644
--- a/drivers/client_location_history/app/models/client_location_history/location.rb
+++ b/drivers/client_location_history/app/models/client_location_history/location.rb
@@ -47,9 +47,9 @@ def as_marker(user = nil, label_attributes = [:seen_on, :collected_by])
private def name_for_label(user)
if user.can_view_clients?
- link_for(client_path(client), client.name)
+ link_for(client_path(client), client.pii_provider(user: current_user).full_name)
else
- client.name
+ client.pii_provider(user: current_user).full_name
end
end
diff --git a/drivers/client_location_history/app/views/client_location_history/clients/map.haml b/drivers/client_location_history/app/views/client_location_history/clients/map.haml
index 0fe4ca0e33..000679b563 100644
--- a/drivers/client_location_history/app/views/client_location_history/clients/map.haml
+++ b/drivers/client_location_history/app/views/client_location_history/clients/map.haml
@@ -1,4 +1,4 @@
-- title = "Location Map for #{@client.name}"
+- title = "Location Map for #{@client.pii_provider(user: current_user).full_name}"
- content_for :title, title
= render 'clients/breadcrumbs'
diff --git a/drivers/financial/app/views/financial/clients/rollup/_financial_clients.haml b/drivers/financial/app/views/financial/clients/rollup/_financial_clients.haml
index b9a8102820..b16bb7d4d5 100644
--- a/drivers/financial/app/views/financial/clients/rollup/_financial_clients.haml
+++ b/drivers/financial/app/views/financial/clients/rollup/_financial_clients.haml
@@ -17,7 +17,7 @@
%tbody
- clients.each do |client|
%tr
- %td= client.name
+ %td= client.pii_provider(user: current_user).full_name
%td= yes_no(client.head_of_household == 1)
%td.date-cell= client.date_of_referral_to_agency&.to_date
%td.date-cell= client.date_of_referral_to_wit&.to_date
diff --git a/drivers/financial/app/views/financial/clients/show.haml b/drivers/financial/app/views/financial/clients/show.haml
index d3e9b3a03a..e091d07f32 100644
--- a/drivers/financial/app/views/financial/clients/show.haml
+++ b/drivers/financial/app/views/financial/clients/show.haml
@@ -1,4 +1,4 @@
-- title = @client.full_name
+- title = @client.pii_provider(user: current_user).full_name
- content_for :title, title
= render 'clients/breadcrumbs'
diff --git a/drivers/inactive_client_report/app/views/inactive_client_report/warehouse_reports/reports/_report.haml b/drivers/inactive_client_report/app/views/inactive_client_report/warehouse_reports/reports/_report.haml
index 9dbad18b3d..c2996fe010 100644
--- a/drivers/inactive_client_report/app/views/inactive_client_report/warehouse_reports/reports/_report.haml
+++ b/drivers/inactive_client_report/app/views/inactive_client_report/warehouse_reports/reports/_report.haml
@@ -19,10 +19,11 @@
%th Most-Recent CE Assessor
%tbody
- @clients.each do |client|
+ - pii = client.pii_provider(user: current_user)
- projects = client.last_intentional_contacts( current_user, include_confidential_names: false, include_dates: true).select(&:present?)
%tr
- %td= link_to_if can_view_clients?, client.name, appropriate_client_path(client)
- %td= dob_or_age(client.dob)
+ %td= link_to_if can_view_clients?, pii.full_name, appropriate_client_path(client)
+ %td= pii.dob_or_age
%td
- projects.each do |p|
= p
diff --git a/drivers/start_date_dq/app/views/start_date_dq/warehouse_reports/reports/index.haml b/drivers/start_date_dq/app/views/start_date_dq/warehouse_reports/reports/index.haml
index f4458eefd3..91bffd4349 100644
--- a/drivers/start_date_dq/app/views/start_date_dq/warehouse_reports/reports/index.haml
+++ b/drivers/start_date_dq/app/views/start_date_dq/warehouse_reports/reports/index.haml
@@ -22,7 +22,7 @@
- @enrollments.each do |row|
- client = row.client
%tr
- %td= link_to_if can_view_clients?, client.name, appropriate_client_path(client)
+ %td= link_to_if can_view_clients?, client.pii_provider(user: current_user).full_name, appropriate_client_path(client)
- @report.column_values(row, current_user).each do |key, value|
- next if key == :project_type
- if key.in?([:days_between, :days_between_start_and_exit])