Skip to content

Commit 3981776

Browse files
authored
Merge pull request #3940 from nhsuk/programme-name-in-sentence
Ensure flu is displayed lowercase in sentences
2 parents 807136e + f50d047 commit 3981776

19 files changed

Lines changed: 61 additions & 31 deletions

app/components/app_consent_confirmation_component.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ def vaccinations_text(consent_form_programmes)
7272
elsif consent_form_programme.vaccine_method_injection?
7373
"flu injection"
7474
else
75-
programme.name.downcase
75+
programme.name_in_sentence
7676
end
7777
else
78-
programme.name
78+
programme.name_in_sentence
7979
end
8080
end
8181

app/components/app_patient_session_record_component.rb

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,20 @@ def default_vaccinate_form
3838
end
3939

4040
def heading
41-
return "Record #{programme.name} vaccination" unless programme.flu?
42-
43-
if PatientSession
44-
.where(patient_id: patient.id)
45-
.has_vaccine_method(:nasal, programme:)
46-
.exists?
47-
"Record flu vaccination with nasal spray"
48-
else
49-
"Record flu vaccination with injection"
50-
end
41+
vaccination =
42+
if programme.flu?
43+
if PatientSession
44+
.where(patient_id: patient.id)
45+
.has_vaccine_method(:nasal, programme:)
46+
.exists?
47+
"vaccination with nasal spray"
48+
else
49+
"vaccination with injection"
50+
end
51+
else
52+
"vaccination"
53+
end
54+
55+
"Record #{programme.name_in_sentence} #{vaccination}"
5156
end
5257
end

app/components/app_patient_session_search_result_card_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def action_required
9696
status = patient_session.next_activity(programme:)
9797
next if status.nil?
9898

99-
"#{I18n.t(status, scope: :activity)} for #{programme.name}"
99+
"#{I18n.t(status, scope: :activity)} for #{programme.name_in_sentence}"
100100
end
101101

102102
return if next_activities.empty?

app/components/app_patient_session_triage_component.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<% end %>
1212

1313
<% if triage_status&.vaccination_history_requires_triage? %>
14-
<p>Incomplete vaccination history for <%= programme.name %>. Check if the child needs another dose.</p>
14+
<p>Incomplete vaccination history for <%= programme.name_in_sentence %>. Check if the child needs another dose.</p>
1515
<% end %>
1616

1717
<% if helpers.policy(Triage).new? %>

app/components/app_session_actions_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def ready_for_vaccinator_row
129129

130130
texts =
131131
counts_by_programme.map do |programme, count|
132-
"#{I18n.t("children", count:)} for #{programme.name}"
132+
"#{I18n.t("children", count:)} for #{programme.name_in_sentence}"
133133
end
134134

135135
href = session_record_path(session)

app/components/app_session_details_summary_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def vaccinated_row
6262
count =
6363
patient_sessions.has_session_status(:vaccinated, programme:).count
6464

65-
"#{I18n.t("vaccinations_given", count:)} for #{programme.name}"
65+
"#{I18n.t("vaccinations_given", count:)} for #{programme.name_in_sentence}"
6666
end
6767

6868
href =

app/components/app_vaccinate_form_component.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,14 @@ def common_delivery_sites_options
5757
end
5858

5959
def vaccination_name
60-
return "#{programme.name} vaccination" unless programme.flu?
60+
vaccination =
61+
if programme.flu?
62+
delivery_method == :nasal_spray ? "nasal spray" : "injection"
63+
else
64+
"vaccination"
65+
end
6166

62-
delivery_method == :nasal_spray ? "flu nasal spray" : "flu injection"
67+
"#{programme.name_in_sentence} #{vaccination}"
6368
end
6469

6570
def ask_not_taking_medication? = programme.doubles? || programme.flu?

app/controllers/draft_vaccination_records_controller.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ def handle_confirm
126126
# vaccination record.
127127
@draft_vaccination_record.update!(editing_id: @vaccination_record.id)
128128

129-
flash[:success] = "Vaccination outcome recorded for #{@programme.name}"
129+
flash[
130+
:success
131+
] = "Vaccination outcome recorded for #{@programme.name_in_sentence}"
130132
end
131133

132134
def finish_wizard_path

app/models/immunisation_import_row.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ def validate_vaccine
941941
if programme && vaccine.programme_id != programme.id
942942
errors.add(
943943
field.header,
944-
"is not given in the #{programme.name} programme"
944+
"is not given in the #{programme.name_in_sentence} programme"
945945
)
946946
end
947947
elsif vaccine_nivs_name.present?

app/models/programme.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ def to_param = type
5252

5353
def name = human_enum_name(:type)
5454

55+
def name_in_sentence = flu? ? name.downcase : name
56+
5557
def doubles? = menacwy? || td_ipv?
5658

5759
def seasonal? = flu?

0 commit comments

Comments
 (0)