Skip to content

Commit 5769614

Browse files
authored
Merge pull request #5196 from nhsuk/rename-outcome-and-register
Rename values to be more consistent
2 parents 0111b1a + 6b2e205 commit 5769614

24 files changed

Lines changed: 97 additions & 99 deletions

app/components/app_patient_search_form_component.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,16 @@ class AppPatientSearchFormComponent < ViewComponent::Base
8686
<% end %>
8787
<% end %>
8888
89-
<% if register_statuses.any? %>
90-
<%= f.govuk_radio_buttons_fieldset :register_status,
89+
<% if registration_statuses.any? %>
90+
<%= f.govuk_radio_buttons_fieldset :registration_status,
9191
legend: { text: "Registration status", size: "s" },
9292
small: true do %>
93-
<%= f.govuk_radio_button :register_status, "", checked: form.register_status.blank?, label: { text: "Any" } %>
94-
<% register_statuses.each do |status| %>
95-
<%= f.govuk_radio_button :register_status,
93+
<%= f.govuk_radio_button :registration_status, "", checked: form.registration_status.blank?, label: { text: "Any" } %>
94+
<% registration_statuses.each do |status| %>
95+
<%= f.govuk_radio_button :registration_status,
9696
status,
97-
checked: form.register_status == status,
98-
label: { text: t(status, scope: %i[status register label]) } %>
97+
checked: form.registration_status == status,
98+
label: { text: t(status, scope: %i[status registration label]) } %>
9999
<% end %>
100100
<% end %>
101101
<% end %>
@@ -236,7 +236,7 @@ def initialize(
236236
url:,
237237
programmes: [],
238238
consent_statuses: [],
239-
register_statuses: [],
239+
registration_statuses: [],
240240
triage_statuses: [],
241241
vaccination_statuses: [],
242242
patient_specific_direction_statuses: [],
@@ -252,7 +252,7 @@ def initialize(
252252

253253
@programmes = programmes
254254
@consent_statuses = consent_statuses
255-
@register_statuses = register_statuses
255+
@registration_statuses = registration_statuses
256256
@triage_statuses = triage_statuses
257257
@vaccination_statuses = vaccination_statuses
258258
@patient_specific_direction_statuses = patient_specific_direction_statuses
@@ -270,7 +270,7 @@ def initialize(
270270
:url,
271271
:programmes,
272272
:consent_statuses,
273-
:register_statuses,
273+
:registration_statuses,
274274
:triage_statuses,
275275
:vaccination_statuses,
276276
:patient_specific_direction_statuses,
@@ -296,7 +296,7 @@ def open_details?
296296
def show_buttons_in_details?
297297
!(
298298
consent_statuses.any? || vaccination_statuses.any? ||
299-
register_statuses.any? || triage_statuses.any? || year_groups.any?
299+
registration_statuses.any? || triage_statuses.any? || year_groups.any?
300300
)
301301
end
302302

app/components/app_patient_session_search_result_card_component.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def status_tags
170170
when :record
171171
[]
172172
when :register
173-
[register_status_tag, vaccination_status_tag]
173+
[registration_status_tag, vaccination_status_tag]
174174
when :consent
175175
[consent_status_tag]
176176
when :triage
@@ -196,14 +196,14 @@ def vaccination_status_tag
196196
}
197197
end
198198

199-
def register_status_tag
199+
def registration_status_tag
200200
{
201-
key: :register,
201+
key: :registration,
202202
value:
203203
render(
204204
AppStatusTagComponent.new(
205205
patient.registration_status(session:)&.status || "unknown",
206-
context: :register
206+
context: :registration
207207
)
208208
)
209209
}

app/components/app_session_actions_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def register_attendance_row
9696

9797
status = "unknown"
9898
count = patients.has_registration_status(status, session:).count
99-
href = session_register_path(session, register_status: status)
99+
href = session_register_path(session, registration_status: status)
100100

101101
generate_row(:children_to_register, count:, href:)
102102
end

app/controllers/concerns/patient_search_form_concern.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def patient_search_form_params
3030
:missing_nhs_number,
3131
:patient_specific_direction_status,
3232
:q,
33-
:register_status,
33+
:registration_status,
3434
:still_to_vaccinate,
3535
:triage_status,
3636
:vaccination_status,

app/forms/patient_search_form.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class PatientSearchForm < SearchForm
1414
attribute :patient_specific_direction_status, :string
1515
attribute :programme_types, array: true
1616
attribute :q, :string
17-
attribute :register_status, :string
17+
attribute :registration_status, :string
1818
attribute :still_to_vaccinate, :boolean
1919
attribute :triage_status, :string
2020
attribute :vaccination_status, :string
@@ -84,7 +84,7 @@ def apply(scope)
8484
scope = filter_programmes(scope)
8585
scope = filter_consent_statuses(scope)
8686
scope = filter_vaccination_statuses(scope)
87-
scope = filter_register_status(scope)
87+
scope = filter_registration_status(scope)
8888
scope = filter_triage_status(scope)
8989
scope = filter_vaccine_criteria(scope)
9090
scope = filter_patient_specific_direction_status(scope)
@@ -237,8 +237,8 @@ def filter_patient_specific_direction_status(scope)
237237
end
238238
end
239239

240-
def filter_register_status(scope)
241-
if (status = register_status&.to_sym).present?
240+
def filter_registration_status(scope)
241+
if (status = registration_status&.to_sym).present?
242242
scope.has_registration_status(status, session:)
243243
else
244244
scope

app/lib/fhir_mapper/vaccination_record.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,7 @@ def fhir_status
136136
case outcome
137137
when "administered"
138138
"completed"
139-
when "refused", "not_well", "contraindications", "already_had",
140-
"absent_from_school", "absent_from_session"
139+
when "refused", "unwell", "contraindicated", "already_had", "absent"
141140
"not-done"
142141
else
143142
raise ArgumentError, "Unknown outcome: #{outcome}"

app/lib/mavis_cli/stats/vaccinations.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ class Vaccinations < Dry::CLI::Command
1818
option :outcome,
1919
values: %w[
2020
administered
21-
not_well
21+
unwell
2222
already_had
23-
contraindications
24-
absent_from_session
23+
contraindicated
24+
absent
2525
refused
2626
],
2727
desc: "Filter by specific outcome"

app/lib/status_generator/vaccination.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,20 +117,19 @@ def status_should_be_due?
117117
def status_should_be_eligible? = is_eligible?
118118

119119
def latest_session_status_should_be_contraindicated?
120-
vaccination_records.first&.contraindications?
120+
vaccination_records.first&.contraindicated?
121121
end
122122

123123
def latest_session_status_should_be_refused?
124124
vaccination_records.first&.refused?
125125
end
126126

127127
def latest_session_status_should_be_absent?
128-
vaccination_records.first&.absent_from_session? ||
129-
attendance_record&.attending == false
128+
vaccination_records.first&.absent? || attendance_record&.attending == false
130129
end
131130

132131
def latest_session_status_should_be_unwell?
133-
vaccination_records.first&.not_well?
132+
vaccination_records.first&.unwell?
134133
end
135134

136135
def latest_session_status_should_be_already_had?

app/models/immunisation_import_row.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ class ImmunisationImportRow
7575

7676
REASONS_NOT_ADMINISTERED = {
7777
"refused" => :refused,
78-
"unwell" => :not_well,
79-
"vaccination contraindicated" => :contraindications,
78+
"unwell" => :unwell,
79+
"vaccination contraindicated" => :contraindicated,
8080
"already had elsewhere" => :already_had,
81-
"did not attend" => :absent_from_session
81+
"did not attend" => :absent
8282
}.freeze
8383

8484
SCHOOL_URN_HOME_EDUCATED = "999999"

app/models/vaccination_record.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,10 @@ class ActiveRecord_Relation < ActiveRecord::Relation
163163
{
164164
administered: 0,
165165
refused: 1,
166-
not_well: 2,
167-
contraindications: 3,
166+
unwell: 2,
167+
contraindicated: 3,
168168
already_had: 4,
169-
absent_from_session: 6
169+
absent: 6
170170
},
171171
validate: true
172172

0 commit comments

Comments
 (0)