Skip to content

Commit e8b8f3b

Browse files
authored
Merge pull request #4165 from nhsuk/show-notify-parents-on-vaccination
Show `notify_parents_on_vaccination` on confirmation
2 parents 3ef6832 + da33f46 commit e8b8f3b

File tree

6 files changed

+51
-3
lines changed

6 files changed

+51
-3
lines changed

app/components/app_consent_summary_component.rb

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,22 @@ def call
5454
end
5555
end
5656

57+
unless consent.notify_parents_on_vaccination.nil?
58+
summary_list.with_row do |row|
59+
row.with_key { "Confirmation of vaccination sent to parent?" }
60+
row.with_value do
61+
consent.notify_parents_on_vaccination ? "Yes" : "No"
62+
end
63+
if (href = change_links[:notify_parents_on_vaccination])
64+
row.with_action(
65+
text: "Change",
66+
visually_hidden_text: "decision",
67+
href:
68+
)
69+
end
70+
end
71+
end
72+
5773
if consent.reason_for_refusal.present?
5874
summary_list.with_row do |row|
5975
row.with_key { "Reason for refusal" }
@@ -63,7 +79,7 @@ def call
6379

6480
unless consent.notify_parent_on_refusal.nil?
6581
summary_list.with_row do |row|
66-
row.with_key { "Confirmation of decision sent to parent" }
82+
row.with_key { "Confirmation of decision sent to parent?" }
6783
row.with_value { consent.notify_parent_on_refusal ? "Yes" : "No" }
6884
end
6985
end

app/views/draft_consents/confirm.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<%= render AppConsentSummaryComponent.new(@draft_consent, change_links: {
1717
response: wizard_path("agree"),
1818
route: wizard_path(@draft_consent.via_self_consent? ? "who" : "route"),
19+
notify_parents_on_vaccination: wizard_path("notify-parents-on-vaccination"),
1920
}) %>
2021
<% end %>
2122

spec/components/app_consent_summary_component_spec.rb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,30 @@
3535
it { should have_content("Notes") }
3636
end
3737

38+
it { should_not have_content("Confirmation of vaccination sent to parent?") }
39+
40+
context "when the child doesn't want the parents to know about the vaccination" do
41+
let(:consent) { create(:consent, :given, :self_consent) }
42+
43+
it do
44+
expect(rendered).to have_content(
45+
"Confirmation of vaccination sent to parent?\nNo"
46+
)
47+
end
48+
end
49+
50+
context "when the child wants the parents to know about the vaccination" do
51+
let(:consent) do
52+
create(:consent, :given, :self_consent, :notify_parents_on_vaccination)
53+
end
54+
55+
it do
56+
expect(rendered).to have_content(
57+
"Confirmation of vaccination sent to parent?\nYes"
58+
)
59+
end
60+
end
61+
3862
it { should_not have_content("Consent also given for injected vaccine?") }
3963

4064
context "with the flu programme" do

spec/features/self_consent_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ def and_the_child_can_give_their_own_consent_that_the_nurse_records
246246
choose "Child (Gillick competent)"
247247
5.times { click_on "Continue" }
248248

249+
expect(page).to have_content("Confirmation of vaccination sent to parent")
250+
249251
click_on "Confirm"
250252

251253
expect(page).to have_content("Consent recorded for #{@patient.full_name}")

spec/features/verbal_consent_given_spec.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ def record_that_verbal_consent_was_given(
159159
def then_i_see_the_check_and_confirm_page
160160
expect(page).to have_content("Check and confirm answers")
161161
expect(page).to have_content(["Method", "By phone"].join)
162+
expect(page).not_to have_content(
163+
"Confirmation of vaccination sent to parent"
164+
)
162165
end
163166

164167
def and_i_see_the_flu_injection_consent_given

spec/features/verbal_consent_refused_personal_choice_spec.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@ def when_i_record_the_consent_refusal_and_reason(notify_parent:)
6565
expect(page).to have_content(["Name", @parent.full_name].join)
6666

6767
if notify_parent
68-
expect(page).to have_content("Confirmation of decision sent to parentYes")
68+
expect(page).to have_content(
69+
"Confirmation of decision sent to parent?Yes"
70+
)
6971
else
70-
expect(page).to have_content("Confirmation of decision sent to parentNo")
72+
expect(page).to have_content("Confirmation of decision sent to parent?No")
7173
end
7274

7375
click_button "Confirm"

0 commit comments

Comments
 (0)