Skip to content

Commit b5c6d57

Browse files
committed
Allow HCAs to choose injection under national protocol instead of PSD
In the scenario where national protocol and PSD is enabled for a flu session and the patient has consented for nasal or injection, the HCA can choose injection as a fallback option. In any case, it's necessary for the HCA to provide the supplier of the vaccine if they want to go with injection. The vaccination record will record it as done through national protocol.
1 parent e0fd439 commit b5c6d57

File tree

3 files changed

+49
-3
lines changed

3 files changed

+49
-3
lines changed

app/components/app_vaccinate_form_component.html.erb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,20 @@
104104
size: "s",
105105
} %>
106106
<% end %>
107+
108+
<% if form.healthcare_assistant_using_psd_and_national_protocol? %>
109+
<%= f.govuk_select :supplied_by_user_id,
110+
label: { text: "Which nurse identified and pre-screened the child and supplied the vaccine?" },
111+
data: { module: "app-autocomplete" } do %>
112+
<%= tag.option "", value: "" %>
113+
<% form.supplied_by_users.each do |user| %>
114+
<%= tag.option user.full_name,
115+
value: user.id,
116+
selected: user.id == form.supplied_by_user_id,
117+
data: { hint: user.email } %>
118+
<% end %>
119+
<% end %>
120+
<% end %>
107121
<% else %>
108122
<%= f.govuk_radio_button :vaccine_method, vaccine_method, label: { text: label }, hint: { text: hint }, link_errors: index.zero? %>
109123
<% end %>

app/controllers/sessions/record_controller.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ def show
2525
scope = scope.has_registration_status(%w[attending completed])
2626
end
2727

28-
if @session.psd_enabled? && current_user.is_healthcare_assistant?
28+
if !@session.national_protocol_enabled? && @session.psd_enabled? &&
29+
current_user.is_healthcare_assistant?
2930
scope = scope.has_patient_specific_direction(programme: @programme)
3031
end
3132

spec/features/flu_vaccination_hca_national_protocol_spec.rb

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,18 @@
2020
then_i_am_able_to_vaccinate_them(nasal: false)
2121
end
2222

23-
def given_a_session_exists
23+
scenario "Administered by HCA under national protocol with PSD enabled" do
24+
given_a_session_exists(psd_enabled: true)
25+
and_patients_exist
26+
27+
when_i_visit_the_session_record_tab
28+
then_i_see_all_the_patients
29+
30+
when_i_click_on_the_nasal_and_injection_patient
31+
then_i_am_able_to_vaccinate_them_using_injection_instead_of_nasal
32+
end
33+
34+
def given_a_session_exists(psd_enabled: false)
2435
@programme = create(:programme, :flu)
2536
programmes = [@programme]
2637

@@ -52,7 +63,8 @@ def given_a_session_exists
5263
:requires_no_registration,
5364
:national_protocol_enabled,
5465
team: @team,
55-
programmes:
66+
programmes:,
67+
psd_enabled:
5668
)
5769
end
5870

@@ -125,4 +137,23 @@ def then_i_am_able_to_vaccinate_them(nasal:)
125137
click_on "Confirm"
126138
click_on "Record vaccinations"
127139
end
140+
141+
def then_i_am_able_to_vaccinate_them_using_injection_instead_of_nasal
142+
check "I have checked that the above statements are true"
143+
144+
within all("section")[1] do
145+
choose "No — but they can have the injected flu instead"
146+
choose "Left arm (upper position)"
147+
select @nurse.full_name
148+
end
149+
click_on "Continue"
150+
151+
choose @injection_batch.name
152+
click_on "Continue"
153+
154+
expect(page).to have_content("ProtocolNational")
155+
156+
click_on "Confirm"
157+
click_on "Record vaccinations"
158+
end
128159
end

0 commit comments

Comments
 (0)