Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions app/controllers/concerns/patient_tabs_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ module PatientTabsConcern
consent_given_triage_not_needed
vaccinated
unable_to_vaccinate
unable_to_vaccinate_not_gillick_competent
]
},
vaccinations: {
Expand All @@ -28,7 +27,6 @@ module PatientTabsConcern
delay_vaccination
triaged_do_not_vaccinate
unable_to_vaccinate
unable_to_vaccinate_not_gillick_competent
]
}
}.with_indifferent_access.freeze
Expand Down
7 changes: 0 additions & 7 deletions app/models/concerns/patient_session_state_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ def state
"vaccinated"
elsif triage_delay_vaccination? || vaccination_can_be_delayed?
"delay_vaccination"
elsif not_gillick_competent?
"unable_to_vaccinate_not_gillick_competent"
elsif vaccination_not_administered?
"unable_to_vaccinate"
elsif triage_keep_in_triage?
Expand Down Expand Up @@ -43,7 +41,6 @@ def state
triaged_do_not_vaccinate
triaged_kept_in_triage
unable_to_vaccinate
unable_to_vaccinate_not_gillick_competent
delay_vaccination
vaccinated
].each { |state| define_method("#{state}?") { self.state == state } }
Expand Down Expand Up @@ -103,10 +100,6 @@ def vaccination_not_administered?
vaccination_records.any?(&:not_administered?)
end

def not_gillick_competent?
latest_gillick_assessment&.gillick_competent == false
end

def vaccination_can_be_delayed?
latest_vaccination_record&.not_administered? &&
latest_vaccination_record&.retryable_reason?
Expand Down
2 changes: 1 addition & 1 deletion app/models/patient_session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def gillick_competent?
end

def able_to_vaccinate?
!unable_to_vaccinate? && !unable_to_vaccinate_not_gillick_competent?
!unable_to_vaccinate?
end

def safe_to_destroy?
Expand Down
3 changes: 1 addition & 2 deletions app/models/patient_session_stats.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ def include_in_statistics?(patient_session, key)
patient_session.delay_vaccination? || patient_session.consent_refused? ||
patient_session.consent_conflicts? ||
patient_session.triaged_do_not_vaccinate? ||
patient_session.unable_to_vaccinate? ||
patient_session.unable_to_vaccinate_not_gillick_competent?
patient_session.unable_to_vaccinate?
end
end
end
5 changes: 0 additions & 5 deletions config/locales/patient_session_statuses.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ en:
gave_consent: "Their %{who_responded} gave consent"
triaged_do_not_vaccinate: "Do not vaccinate in programme"
unable_to_vaccinate: "Refused vaccine"
unable_to_vaccinate_not_gillick_competent:
colour: red
text: Not vaccinated
banner_title: Not vaccinated
banner_explanation: No-one responded to our requests for consent. When assessed, the child was not Gillick competent.
vaccinated:
colour: green
text: Vaccinated
Expand Down
14 changes: 1 addition & 13 deletions spec/controllers/concerns/patient_tabs_concern_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,6 @@
let(:unable_to_vaccinate) do
create(:patient_session, :unable_to_vaccinate, programme:, session:)
end
let(:unable_to_vaccinate_not_gillick_competent) do
create(
:patient_session,
:unable_to_vaccinate_not_gillick_competent,
programme:,
session:
)
end
let(:vaccinated) do
create(:patient_session, :vaccinated, programme:, session:)
end
Expand All @@ -65,7 +57,6 @@
triaged_kept_in_triage,
triaged_ready_to_vaccinate,
unable_to_vaccinate,
unable_to_vaccinate_not_gillick_competent,
vaccinated
]
end
Expand All @@ -88,7 +79,6 @@
triaged_kept_in_triage,
triaged_ready_to_vaccinate,
unable_to_vaccinate,
unable_to_vaccinate_not_gillick_competent,
vaccinated
],
consent_refused: [consent_refused],
Expand Down Expand Up @@ -139,7 +129,6 @@
consent_given_triage_not_needed,
consent_refused,
unable_to_vaccinate,
unable_to_vaccinate_not_gillick_competent,
vaccinated
]
}.with_indifferent_access
Expand Down Expand Up @@ -167,8 +156,7 @@
consent_refused,
delay_vaccination,
triaged_do_not_vaccinate,
unable_to_vaccinate,
unable_to_vaccinate_not_gillick_competent
unable_to_vaccinate
]
}.with_indifferent_access
)
Expand Down
25 changes: 0 additions & 25 deletions spec/factories/patient_sessions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,31 +182,6 @@
end
end

trait :unable_to_vaccinate_not_gillick_competent do
patient do
association :patient,
:consent_given_triage_needed,
:triage_ready_to_vaccinate,
performed_by: user,
programme:,
organisation:,
school: session.location
end

after(:create) do |patient_session, evaluator|
create(:gillick_assessment, :not_competent, patient_session:)

create(
:vaccination_record,
:not_administered,
patient_session:,
programme: evaluator.programme,
performed_by: evaluator.user,
reason: :already_had
)
end
end

trait :vaccinated do
patient do
association :patient,
Expand Down
6 changes: 6 additions & 0 deletions spec/features/self_consent_not_gillick_competent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

when_the_nurse_assesses_the_child_as_not_being_gillick_competent
then_the_child_cannot_give_their_own_consent
and_the_childs_status_reflects_that_there_is_no_consent
end

def given_an_hpv_programme_is_underway
Expand Down Expand Up @@ -89,5 +90,10 @@ def then_the_child_cannot_give_their_own_consent
expect(page).not_to have_content(
"Do they agree to them having the HPV vaccination?"
)
click_on "Back"
end

def and_the_childs_status_reflects_that_there_is_no_consent
expect(page).to have_content("No response")
end
end
5 changes: 0 additions & 5 deletions spec/models/concerns/patient_session_state_concern_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
consent_refused?: false,
consent_conflicts?: false,
no_consent?: false,
not_gillick_competent?: false,
triage_needed?: false,
triage_not_needed?: false,
triage_ready_to_vaccinate?: false,
Expand Down Expand Up @@ -66,10 +65,6 @@
state: :consent_conflicts,
conditions: [:consent_conflicts]

it_behaves_like "it supports the state",
state: :unable_to_vaccinate_not_gillick_competent,
conditions: [:not_gillick_competent]

it_behaves_like "it supports the state",
state: :triaged_ready_to_vaccinate,
conditions: [:triage_ready_to_vaccinate]
Expand Down
Loading