Skip to content

Commit b6ec124

Browse files
committed
Rename vaccination record outcomes
This renames the outcomes to match the naming convention we're now using across the service in the various statuses. Jira-Issue: MAV-2581
1 parent ef0d122 commit b6ec124

15 files changed

Lines changed: 58 additions & 60 deletions

File tree

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

app/views/draft_vaccination_records/outcome.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121

2222
<%= f.govuk_radio_button :outcome, "already_had",
2323
label: { text: "They have already had the vaccine" } %>
24-
<%= f.govuk_radio_button :outcome, "contraindications",
24+
<%= f.govuk_radio_button :outcome, "contraindicated",
2525
label: { text: "They had contraindications" } %>
2626
<%= f.govuk_radio_button :outcome, "refused",
2727
label: { text: "They refused it" } %>
28-
<%= f.govuk_radio_button :outcome, "not_well",
28+
<%= f.govuk_radio_button :outcome, "unwell",
2929
label: { text: "They were not well enough" } %>
3030
<% end %>
3131

config/locales/en.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,11 +296,11 @@ en:
296296
right_arm_lower_position: Right arm (lower position)
297297
right_arm_upper_position: Right arm (upper position)
298298
outcomes:
299-
absent_from_session: Absent from session
299+
absent: Absent from session
300300
administered: Vaccinated
301301
already_had: Already had the vaccine
302-
contraindications: Had contraindications
303-
not_well: Unwell
302+
contraindicated: Had contraindications
303+
unwell: Unwell
304304
refused: Refused vaccine
305305
protocols:
306306
national: National protocol
@@ -628,10 +628,10 @@ en:
628628
will_be_vaccinated_elsewhere: they will be given the vaccine elsewhere
629629
vaccination_mailer:
630630
reasons_did_not_vaccinate:
631-
absent_from_session: they were not in the vaccination session
631+
absent: they were not in the vaccination session
632632
already_had: they've already had the vaccine
633-
contraindications: they had contraindications
634-
not_well: the nurse decided %{short_patient_name} was not well
633+
contraindicated: they had contraindications
634+
unwell: the nurse decided %{short_patient_name} was not well
635635
refused: they refused when the nurse offered the vaccination
636636
notification_banner:
637637
info: Information

spec/components/app_patient_programmes_table_component_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
:vaccination_record,
7777
patient:,
7878
programme: programmes.first,
79-
outcome: :contraindications,
79+
outcome: :contraindicated,
8080
performed_at: today,
8181
session:
8282
)
@@ -95,7 +95,7 @@
9595
:vaccination_record,
9696
patient:,
9797
programme: programmes.first,
98-
outcome: :not_well,
98+
outcome: :unwell,
9999
performed_at: today,
100100
session:
101101
)

spec/components/app_vaccination_record_summary_component_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
end
5858

5959
context "when not administered" do
60-
let(:outcome) { :not_well }
60+
let(:outcome) { :unwell }
6161

6262
it do
6363
expect(rendered).to have_css(
@@ -86,7 +86,7 @@
8686
end
8787

8888
context "without a vaccine" do
89-
let(:outcome) { :not_well }
89+
let(:outcome) { :unwell }
9090
let(:vaccine) { nil }
9191
let(:batch) { nil }
9292
let(:other_batch) { nil }
@@ -122,7 +122,7 @@
122122
end
123123

124124
context "without a vaccine" do
125-
let(:outcome) { :not_well }
125+
let(:outcome) { :unwell }
126126
let(:vaccine) { nil }
127127
let(:batch) { nil }
128128
let(:other_batch) { nil }
@@ -184,7 +184,7 @@
184184
it { should have_css(".nhsuk-summary-list__row", text: "Batch IDABC") }
185185

186186
context "without a vaccine" do
187-
let(:outcome) { :not_well }
187+
let(:outcome) { :unwell }
188188
let(:vaccine) { nil }
189189
let(:batch) { nil }
190190
let(:other_batch) { nil }
@@ -202,7 +202,7 @@
202202
end
203203

204204
context "without a vaccine" do
205-
let(:outcome) { :not_well }
205+
let(:outcome) { :unwell }
206206
let(:vaccine) { nil }
207207
let(:batch) { nil }
208208
let(:other_batch) { nil }

spec/factories/vaccination_records.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
trait :not_administered do
135135
delivery_site { nil }
136136
delivery_method { nil }
137-
outcome { "not_well" }
137+
outcome { "unwell" }
138138
vaccine { nil }
139139
dose_sequence { nil }
140140
full_dose { nil }
@@ -145,19 +145,19 @@
145145
outcome { "already_had" }
146146
end
147147

148-
trait :contraindications do
148+
trait :contraindicated do
149149
not_administered
150-
outcome { "contraindications" }
150+
outcome { "contraindicated" }
151151
end
152152

153153
trait :refused do
154154
not_administered
155155
outcome { "refused" }
156156
end
157157

158-
trait :absent_from_session do
158+
trait :absent do
159159
not_administered
160-
outcome { "absent_from_session" }
160+
outcome { "absent" }
161161
end
162162

163163
trait :performed_by_not_user do

0 commit comments

Comments
 (0)