Skip to content

Commit cc141f0

Browse files
committed
Remove the unable_to_vaccinate_not_gillick_competent state
A Gillick assessment must be passed in order to record self consent, but it in itself shouldn't affect the patient's state – instead, the presence (or absence) of self-consent should. So the logic that a failed Gillick assessment automatically leads to the child not getting vaccinated isn't quite right
1 parent d4d9b0d commit cc141f0

File tree

9 files changed

+9
-60
lines changed

9 files changed

+9
-60
lines changed

app/controllers/concerns/patient_tabs_concern.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ module PatientTabsConcern
1616
consent_given_triage_not_needed
1717
vaccinated
1818
unable_to_vaccinate
19-
unable_to_vaccinate_not_gillick_competent
2019
]
2120
},
2221
vaccinations: {
@@ -28,7 +27,6 @@ module PatientTabsConcern
2827
delay_vaccination
2928
triaged_do_not_vaccinate
3029
unable_to_vaccinate
31-
unable_to_vaccinate_not_gillick_competent
3230
]
3331
}
3432
}.with_indifferent_access.freeze

app/models/concerns/patient_session_state_concern.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ def state
1010
"vaccinated"
1111
elsif triage_delay_vaccination? || vaccination_can_be_delayed?
1212
"delay_vaccination"
13-
elsif not_gillick_competent?
14-
"unable_to_vaccinate_not_gillick_competent"
1513
elsif vaccination_not_administered?
1614
"unable_to_vaccinate"
1715
elsif triage_keep_in_triage?
@@ -43,7 +41,6 @@ def state
4341
triaged_do_not_vaccinate
4442
triaged_kept_in_triage
4543
unable_to_vaccinate
46-
unable_to_vaccinate_not_gillick_competent
4744
delay_vaccination
4845
vaccinated
4946
].each { |state| define_method("#{state}?") { self.state == state } }
@@ -103,10 +100,6 @@ def vaccination_not_administered?
103100
vaccination_records.any?(&:not_administered?)
104101
end
105102

106-
def not_gillick_competent?
107-
latest_gillick_assessment&.gillick_competent == false
108-
end
109-
110103
def vaccination_can_be_delayed?
111104
latest_vaccination_record&.not_administered? &&
112105
latest_vaccination_record&.retryable_reason?

app/models/patient_session.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def gillick_competent?
118118
end
119119

120120
def able_to_vaccinate?
121-
!unable_to_vaccinate? && !unable_to_vaccinate_not_gillick_competent?
121+
!unable_to_vaccinate?
122122
end
123123

124124
def safe_to_destroy?

app/models/patient_session_stats.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ def include_in_statistics?(patient_session, key)
5555
patient_session.delay_vaccination? || patient_session.consent_refused? ||
5656
patient_session.consent_conflicts? ||
5757
patient_session.triaged_do_not_vaccinate? ||
58-
patient_session.unable_to_vaccinate? ||
59-
patient_session.unable_to_vaccinate_not_gillick_competent?
58+
patient_session.unable_to_vaccinate?
6059
end
6160
end
6261
end

config/locales/patient_session_statuses.en.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,6 @@ en:
5959
gave_consent: "Their %{who_responded} gave consent"
6060
triaged_do_not_vaccinate: "Do not vaccinate in programme"
6161
unable_to_vaccinate: "Refused vaccine"
62-
unable_to_vaccinate_not_gillick_competent:
63-
colour: red
64-
text: Not vaccinated
65-
banner_title: Not vaccinated
66-
banner_explanation: No-one responded to our requests for consent. When assessed, the child was not Gillick competent.
6762
vaccinated:
6863
colour: green
6964
text: Vaccinated

spec/controllers/concerns/patient_tabs_concern_spec.rb

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,6 @@
4141
let(:unable_to_vaccinate) do
4242
create(:patient_session, :unable_to_vaccinate, programme:, session:)
4343
end
44-
let(:unable_to_vaccinate_not_gillick_competent) do
45-
create(
46-
:patient_session,
47-
:unable_to_vaccinate_not_gillick_competent,
48-
programme:,
49-
session:
50-
)
51-
end
5244
let(:vaccinated) do
5345
create(:patient_session, :vaccinated, programme:, session:)
5446
end
@@ -65,7 +57,6 @@
6557
triaged_kept_in_triage,
6658
triaged_ready_to_vaccinate,
6759
unable_to_vaccinate,
68-
unable_to_vaccinate_not_gillick_competent,
6960
vaccinated
7061
]
7162
end
@@ -88,7 +79,6 @@
8879
triaged_kept_in_triage,
8980
triaged_ready_to_vaccinate,
9081
unable_to_vaccinate,
91-
unable_to_vaccinate_not_gillick_competent,
9282
vaccinated
9383
],
9484
consent_refused: [consent_refused],
@@ -139,7 +129,6 @@
139129
consent_given_triage_not_needed,
140130
consent_refused,
141131
unable_to_vaccinate,
142-
unable_to_vaccinate_not_gillick_competent,
143132
vaccinated
144133
]
145134
}.with_indifferent_access
@@ -167,8 +156,7 @@
167156
consent_refused,
168157
delay_vaccination,
169158
triaged_do_not_vaccinate,
170-
unable_to_vaccinate,
171-
unable_to_vaccinate_not_gillick_competent
159+
unable_to_vaccinate
172160
]
173161
}.with_indifferent_access
174162
)

spec/factories/patient_sessions.rb

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -182,31 +182,6 @@
182182
end
183183
end
184184

185-
trait :unable_to_vaccinate_not_gillick_competent do
186-
patient do
187-
association :patient,
188-
:consent_given_triage_needed,
189-
:triage_ready_to_vaccinate,
190-
performed_by: user,
191-
programme:,
192-
organisation:,
193-
school: session.location
194-
end
195-
196-
after(:create) do |patient_session, evaluator|
197-
create(:gillick_assessment, :not_competent, patient_session:)
198-
199-
create(
200-
:vaccination_record,
201-
:not_administered,
202-
patient_session:,
203-
programme: evaluator.programme,
204-
performed_by: evaluator.user,
205-
reason: :already_had
206-
)
207-
end
208-
end
209-
210185
trait :vaccinated do
211186
patient do
212187
association :patient,

spec/features/self_consent_not_gillick_competent_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
when_the_nurse_assesses_the_child_as_not_being_gillick_competent
1717
then_the_child_cannot_give_their_own_consent
18+
and_the_childs_status_reflects_that_there_is_no_consent
1819
end
1920

2021
def given_an_hpv_programme_is_underway
@@ -89,5 +90,10 @@ def then_the_child_cannot_give_their_own_consent
8990
expect(page).not_to have_content(
9091
"Do they agree to them having the HPV vaccination?"
9192
)
93+
click_on "Back"
94+
end
95+
96+
def and_the_childs_status_reflects_that_there_is_no_consent
97+
expect(page).to have_content("No response")
9298
end
9399
end

spec/models/concerns/patient_session_state_concern_spec.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
consent_refused?: false,
2626
consent_conflicts?: false,
2727
no_consent?: false,
28-
not_gillick_competent?: false,
2928
triage_needed?: false,
3029
triage_not_needed?: false,
3130
triage_ready_to_vaccinate?: false,
@@ -66,10 +65,6 @@
6665
state: :consent_conflicts,
6766
conditions: [:consent_conflicts]
6867

69-
it_behaves_like "it supports the state",
70-
state: :unable_to_vaccinate_not_gillick_competent,
71-
conditions: [:not_gillick_competent]
72-
7368
it_behaves_like "it supports the state",
7469
state: :triaged_ready_to_vaccinate,
7570
conditions: [:triage_ready_to_vaccinate]

0 commit comments

Comments
 (0)