Skip to content

Commit 78ee814

Browse files
committed
Replace outcome column with status
The outcome column isn't used in the patient's table anywhere in the prototype anymore.
1 parent 54aa074 commit 78ee814

File tree

7 files changed

+18
-11
lines changed

7 files changed

+18
-11
lines changed

app/components/app_session_patient_table_component.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def column_name(column)
4848
action: "Action needed",
4949
dob: "Date of birth",
5050
name: "Full name",
51-
outcome: "Outcome",
51+
status: "Status",
5252
postcode: "Postcode",
5353
reason: "Reason for refusal",
5454
select_for_matching: "Action",
@@ -61,9 +61,12 @@ def column_value(patient, column)
6161
patient_session = @patient_sessions[patient]
6262

6363
case column
64-
when :action, :outcome
64+
when :action
6565
state = patient_session&.state || "not_in_session"
6666
t("patient_session_statuses.#{state}.text")
67+
when :status
68+
state = patient_session&.state || "not_in_session"
69+
t("patient_session_statuses.#{state}.banner_title")
6770
when :dob
6871
patient.date_of_birth.to_fs(:long)
6972
when :name

app/controllers/concerns/patient_sorting_concern.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ def sort_by_value(obj, key)
2525
obj.try(:date_of_birth) || obj.patient.date_of_birth
2626
when "name"
2727
obj.try(:full_name) || obj.patient.full_name
28-
when "outcome"
29-
obj.state
28+
when "status"
29+
obj.try(:state) || "not_in_session"
3030
when "postcode"
3131
obj.try(:address_postcode) || obj.patient.address_postcode
3232
when "year_group"

app/views/programme/patients/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
<%= render AppSessionPatientTableComponent.new(
2323
caption: t("children", count: @pagy.count),
24-
columns: %i[name dob year_group outcome],
24+
columns: %i[name dob year_group status],
2525
params:,
2626
patients: @patients,
2727
patient_sessions: @patient_sessions,

app/views/register_attendances/index.html.erb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
<%= h1 "Register attendance" %>
1212

1313
<%= render AppSessionPatientTableComponent.new(
14-
caption: t("patients_table.register_attendance.caption", children: t("children", count: @patient_sessions.count)),
15-
columns: %i[name year_group outcome attendance],
14+
caption: t("patients_table.register_attendance.caption",
15+
children: t("children", count: @patient_sessions.count)),
16+
columns: %i[name year_group status attendance],
1617
params:,
1718
patient_sessions: @patient_sessions,
1819
section: :attendance,

app/views/vaccinations/index.html.erb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@
3636

3737
<%= render AppSessionPatientTableComponent.new(
3838
caption: t("patients_table.#{@current_tab}.caption", children: t("children", count: @patient_sessions.count)),
39-
columns: @current_tab == :vaccinate ? %i[name year_group action] : %i[name year_group outcome],
39+
columns: @current_tab == :vaccinate ?
40+
%i[name year_group action] :
41+
%i[name year_group status],
4042
params:,
4143
patient_sessions: @patient_sessions,
4244
section: :vaccinations,

config/locales/patient_session_statuses.en.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ en:
22
patient_session_statuses:
33
not_in_session:
44
text: Not in a session
5+
banner_title: Not in session
56
added_to_session:
67
colour: blue
78
text: Get consent

spec/components/app_session_patient_table_component_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ def have_column(text)
151151
it { should have_column("Action needed") }
152152
end
153153

154-
context "includes outcome" do
155-
let(:columns) { %i[name year_group outcome] }
154+
context "includes status" do
155+
let(:columns) { %i[name year_group status] }
156156

157-
it { should have_column("Outcome") }
157+
it { should have_column("Status") }
158158
end
159159
end
160160
end

0 commit comments

Comments
 (0)