Skip to content

Commit a069fb7

Browse files
committed
Rename none programme outcome
To none yet. This avoids potential confusion with the built in Rails `none?` method and helps to clarify exactly what this status is for. I've also removed the label and colour for the partially vaccinated status as this status doesn't exist in the service.
1 parent c4850bd commit a069fb7

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

app/models/patient/programme_outcome.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ def initialize(patient)
88
STATUSES = [
99
VACCINATED = :vaccinated,
1010
COULD_NOT_VACCINATE = :could_not_vaccinate,
11-
NONE = :none
11+
NONE_YET = :none_yet
1212
].freeze
1313

1414
def vaccinated?(programme) = status[programme] == VACCINATED
1515

1616
def could_not_vaccinate?(programme) = status[programme] == COULD_NOT_VACCINATE
1717

18-
def none?(programme) = status[programme] == NONE
18+
def none_yet?(programme) = status[programme] == NONE_YET
1919

2020
def status
2121
@status ||=
@@ -43,7 +43,7 @@ def programme_status(programme)
4343
elsif programme_could_not_vaccinate?(programme)
4444
COULD_NOT_VACCINATE
4545
else
46-
NONE
46+
NONE_YET
4747
end
4848
end
4949

app/models/patient_session.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def destroy_if_safe!
109109
end
110110

111111
def can_record_as_already_vaccinated?(programme:)
112-
!session.today? && patient.programme_outcome.none?(programme)
112+
!session.today? && patient.programme_outcome.none_yet?(programme)
113113
end
114114

115115
def programmes

config/locales/status.en.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,9 @@ en:
5757
programme:
5858
label:
5959
could_not_vaccinate: Could not vaccinate
60-
none: No outcome yet
61-
partially_vaccinated: Partially vaccinated
60+
none_yet: No outcome yet
6261
vaccinated: Vaccinated
6362
colour:
6463
could_not_vaccinate: red
65-
none: grey
66-
partially_vaccinated: green
64+
none_yet: grey
6765
vaccinated: green

spec/models/patient/programme_outcome_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
subject(:status) { instance.status[programme] }
1313

1414
context "with no vaccination record" do
15-
it { should be(described_class::NONE) }
15+
it { should be(described_class::NONE_YET) }
1616
end
1717

1818
context "with a vaccination administered" do
@@ -40,7 +40,7 @@
4040
create(:vaccination_record, :not_administered, patient:, programme:)
4141
end
4242

43-
it { should be(described_class::NONE) }
43+
it { should be(described_class::NONE_YET) }
4444
end
4545

4646
context "with a consent refused" do
@@ -58,7 +58,7 @@
5858
context "with a discarded vaccination administered" do
5959
before { create(:vaccination_record, :discarded, patient:, programme:) }
6060

61-
it { should be(described_class::NONE) }
61+
it { should be(described_class::NONE_YET) }
6262
end
6363
end
6464

0 commit comments

Comments
 (0)