Skip to content

Commit f103953

Browse files
committed
Remove MMRV feature flag
This enables MMRV across the service and removes the ability to turn it off.
1 parent 6f687b1 commit f103953

14 files changed

+55
-82
lines changed

app/lib/feature_flag_factory.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ def self.call
1717
FEATURES_FOR_DEVELOPMENT = %i[
1818
dev_tools
1919
import_review_screen
20-
mmrv
2120
reporting_api
2221
testing_api
2322
].freeze

app/models/programme.rb

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class InvalidType < StandardError
3838
"flu" => %w[Flu],
3939
"hpv" => %w[HPV],
4040
"menacwy" => %w[ACWYX4 MenACWY],
41-
"mmr" => %w[MMR],
41+
"mmr" => %w[MMR MMRV],
4242
"td_ipv" => %w[3-in-1 Td/IPV]
4343
}.freeze
4444

@@ -124,17 +124,19 @@ def <=>(other) = type <=> other.type
124124

125125
def variant_type = nil
126126

127-
def translation_key
128-
mmr? && Flipper.enabled?(:mmrv) ? "mmr_and_mmrv" : type
129-
end
127+
def translation_key = mmr? ? "mmr_and_mmrv" : type
130128

131129
TYPES.each do |programme_type|
132130
define_method("#{programme_type}?") { type == programme_type }
133131
end
134132

135-
def name = I18n.t(translation_key, scope: :programme_types)
133+
def name
134+
@name ||= I18n.t(translation_key, scope: :programme_types)
135+
end
136136

137-
def name_in_sentence = flu? ? name.downcase : name
137+
def name_in_sentence
138+
@name_in_sentence = flu? ? name.downcase : name
139+
end
138140

139141
def variant_for(disease_types: nil, patient: nil)
140142
return self if (disease_types.blank? && patient.blank?) || !mmr?
@@ -152,12 +154,7 @@ def variant_for(disease_types: nil, patient: nil)
152154
false
153155
end
154156

155-
variant_type =
156-
if eligible_for_mmrv && Flipper.enabled?(:mmrv)
157-
"mmrv"
158-
else
159-
"mmr"
160-
end
157+
variant_type = eligible_for_mmrv ? "mmrv" : "mmr"
161158

162159
Programme::Variant.new(self, variant_type:)
163160
end
@@ -212,15 +209,7 @@ def default_dose_sequence = hpv? || flu? ? 1 : nil
212209

213210
def maximum_dose_sequence = MAXIMUM_DOSE_SEQUENCES.fetch(type)
214211

215-
# TODO: add MMRV to IMPORT_NAMES once the MMRV flag is removed
216-
def import_names
217-
names = IMPORT_NAMES.fetch(type)
218-
if Flipper.enabled?(:mmrv) && type == "mmr"
219-
names + %w[MMRV]
220-
else
221-
names
222-
end
223-
end
212+
def import_names = IMPORT_NAMES.fetch(type)
224213

225214
def snomed_target_disease_codes = SNOMED_TARGET_DISEASE_CODES.fetch(type)
226215

app/models/programme/variant.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ def initialize(programme, variant_type:)
2929

3030
def translation_key = variant_type
3131

32-
def name = I18n.t(translation_key, scope: :programme_types)
32+
def name
33+
@name ||= I18n.t(translation_key, scope: :programme_types)
34+
end
3335

3436
def name_in_sentence = name
3537

config/feature_flags.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,3 @@ reporting_api: Enables the Commissioner reporting component to authenticate to M
4242
statistics from /api/reporting/
4343

4444
testing_api: Basic API useful for automated testing.
45-
46-
mmrv: Adds support for MMRV vaccinations

spec/components/app_vaccine_criteria_label_component_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
let(:vaccine_methods) { %w[injection] }
2020
let(:without_gelatine) { false }
2121

22-
it { should have_content("Record MMR vaccination") }
22+
it { should have_content("Record MMR(V) vaccination") }
2323

2424
context "with gelatine-free injection" do
2525
let(:without_gelatine) { true }
2626

2727
it do
2828
expect(rendered).to have_content(
29-
"Record MMR vaccination with gelatine-free injection"
29+
"Record MMR(V) vaccination with gelatine-free injection"
3030
)
3131
end
3232
end

spec/features/edit_session_programmes_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def then_i_see_the_warning_panel_about_unvaccinated_patients_for_hpv
165165

166166
def then_i_see_the_warning_panel_about_unvaccinated_patients_for_mmr
167167
expect(page).to have_content(
168-
"Have you imported historical vaccination records for MMR?"
168+
"Have you imported historical vaccination records for MMR(V)?"
169169
)
170170
expect(page).to have_content(
171171
"0% of children in Years 8 to 11 in this session have vaccination " \
@@ -180,7 +180,7 @@ def then_i_see_the_warning_panel_about_unvaccinated_patients_for_mmr
180180

181181
def then_i_see_the_warning_panel_about_unvaccinated_patients_for_hpv_and_mmr
182182
expect(page).to have_content(
183-
"Have you imported historical vaccination records for HPV and MMR?"
183+
"Have you imported historical vaccination records for HPV and MMR(V)?"
184184
)
185185
expect(page).to have_content(
186186
"0% of children in Years 8 to 11 in this session have vaccination " \

spec/features/mmr_vaccination_administered_spec.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,26 +107,30 @@ def and_i_am_signed_in
107107
end
108108

109109
def and_there_is_a_session_today_with_patients_safe_to_vaccinate
110+
# These children need to be old enough so they're not eligible for MMRV.
110111
@without_gelatine_only_patient =
111112
create(
112113
:patient,
113114
:consent_given_without_gelatine_triage_not_needed,
114115
:in_attendance,
115-
session: @session
116+
session: @session,
117+
year_group: 9
116118
)
117119
@without_gelatine_patient =
118120
create(
119121
:patient,
120122
:consent_given_triage_not_needed,
121123
:in_attendance,
122-
session: @session
124+
session: @session,
125+
year_group: 9
123126
)
124127
@with_gelatine_patient =
125128
create(
126129
:patient,
127130
:consent_given_triage_not_needed,
128131
:in_attendance,
129-
session: @session
132+
session: @session,
133+
year_group: 9
130134
)
131135
end
132136

spec/features/mmrv_vaccination_administered_spec.rb

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
around { |example| travel_to(Time.zone.local(2024, 10, 1)) { example.run } }
55

66
scenario "administered at community clinic" do
7-
given_mmrv_vaccinations_are_enabled
8-
and_i_am_signed_in_as_a_nurse
7+
given_i_am_signed_in_as_a_nurse
98
and_a_patient_is_ready_for_mmrv_vaccination_in_a_community_clinic
109

1110
when_i_go_to_the_patients_tab
@@ -27,8 +26,7 @@
2726
end
2827

2928
scenario "there is no more MMRV stock available" do
30-
given_mmrv_vaccinations_are_enabled
31-
and_i_am_signed_in_as_a_nurse
29+
given_i_am_signed_in_as_a_nurse
3230
and_a_patient_exists
3331

3432
when_i_visit_the_patient_mmrv_tab
@@ -40,11 +38,7 @@
4038
then_i_see_a_message_that_the_consent_is_successful
4139
end
4240

43-
def given_mmrv_vaccinations_are_enabled
44-
Flipper.enable(:mmrv)
45-
end
46-
47-
def and_i_am_signed_in_as_a_nurse
41+
def given_i_am_signed_in_as_a_nurse
4842
@programme = Programme.mmr
4943
@team = create(:team, :with_one_nurse, programmes: [@programme])
5044

spec/features/triage_without_gelatine_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def when_i_go_to_the_patients_tab
7474

7575
def then_i_see_the_patient
7676
expect(page).to have_content(@patient.full_name)
77-
expect(page).to have_content("MMRNeeds triage")
77+
expect(page).to have_content("MMRVNeeds triage")
7878
end
7979

8080
def when_i_click_on_the_patient
@@ -105,12 +105,12 @@ def when_i_record_the_triage_outcome(without_gelatine:)
105105
end
106106

107107
def then_i_see_the_triage_status_with_gelatine
108-
expect(page).to have_content("MMR: Safe to vaccinate")
108+
expect(page).to have_content("MMRV: Safe to vaccinate")
109109
end
110110

111111
def then_i_see_the_triage_status_without_gelatine
112112
expect(page).to have_content(
113-
"MMR: Safe to vaccinate with gelatine-free injection"
113+
"MMRV: Safe to vaccinate with gelatine-free injection"
114114
)
115115
end
116116
end

spec/lib/reports/offline_session_exporter_spec.rb

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,12 @@ def validation_formula(worksheet:, column_name:, row: 1)
121121
create(:batch, :not_expired, vaccine: programme.vaccines.active.first)
122122
end
123123
let(:patient_location) { create(:patient_location, patient:, session:) }
124-
let(:patient) do
125-
create(:patient, year_group: programme.default_year_groups.first)
126-
end
124+
let(:patient) { create(:patient, year_group:) }
127125

128126
it { should be_empty }
129127

130128
context "with a patient without an outcome" do
131-
let!(:patient) { create(:patient, session:) }
129+
let!(:patient) { create(:patient, session:, year_group:) }
132130

133131
it "adds a row to fill in" do
134132
expect(rows.count).to eq(1)
@@ -228,7 +226,12 @@ def validation_formula(worksheet:, column_name:, row: 1)
228226

229227
context "with a triage assessment" do
230228
let!(:patient) do
231-
create(:patient, :consent_given_triage_safe_to_vaccinate, session:)
229+
create(
230+
:patient,
231+
:consent_given_triage_safe_to_vaccinate,
232+
session:,
233+
year_group:
234+
)
232235
end
233236

234237
it "adds a row with the triage details" do
@@ -838,7 +841,7 @@ def validation_formula(worksheet:, column_name:, row: 1)
838841
it { should be_empty }
839842

840843
context "with a patient without an outcome" do
841-
let!(:patient) { create(:patient, session:) }
844+
let!(:patient) { create(:patient, session:, year_group:) }
842845

843846
it "adds a row to fill in" do
844847
expect(rows.count).to eq(1)
@@ -894,7 +897,7 @@ def validation_formula(worksheet:, column_name:, row: 1)
894897
let(:patient) do
895898
create(
896899
:patient,
897-
year_group: programme.default_year_groups.first,
900+
year_group:,
898901
school: create(:school, urn: "123456", name: "Waterloo Road")
899902
)
900903
end
@@ -1087,6 +1090,8 @@ def validation_formula(worksheet:, column_name:, row: 1)
10871090

10881091
context "Flu programme" do
10891092
let(:programme) { Programme.flu }
1093+
let(:year_group) { 6 }
1094+
10901095
let(:expected_programme) { "Flu" }
10911096
let(:expected_dose_sequence) { 1 }
10921097
let(:expected_consent_status) do
@@ -1103,7 +1108,8 @@ def validation_formula(worksheet:, column_name:, row: 1)
11031108
create(
11041109
:patient,
11051110
:consent_given_nasal_triage_safe_to_vaccinate_nasal,
1106-
session:
1111+
session:,
1112+
year_group:
11071113
)
11081114
end
11091115
let(:workbook) { RubyXL::Parser.parse_buffer(call) }
@@ -1121,6 +1127,8 @@ def validation_formula(worksheet:, column_name:, row: 1)
11211127

11221128
context "HPV programme" do
11231129
let(:programme) { Programme.hpv }
1130+
let(:year_group) { 8 }
1131+
11241132
let(:expected_programme) { "HPV" }
11251133
let(:expected_dose_sequence) { 1 }
11261134
let(:expected_consent_status) { "Consent given" }
@@ -1130,6 +1138,8 @@ def validation_formula(worksheet:, column_name:, row: 1)
11301138

11311139
context "MenACWY programme" do
11321140
let(:programme) { Programme.menacwy }
1141+
let(:year_group) { 9 }
1142+
11331143
let(:expected_programme) { "ACWYX4" }
11341144
let(:expected_dose_sequence) { nil }
11351145
let(:expected_consent_status) { "Consent given" }
@@ -1139,6 +1149,8 @@ def validation_formula(worksheet:, column_name:, row: 1)
11391149

11401150
context "MMR programme" do
11411151
let(:programme) { Programme.mmr }
1152+
let(:year_group) { 11 }
1153+
11421154
let(:expected_programme) { "MMR" }
11431155
let(:expected_dose_sequence) { nil }
11441156
let(:expected_consent_status) { "Consent given" }
@@ -1147,16 +1159,9 @@ def validation_formula(worksheet:, column_name:, row: 1)
11471159
end
11481160

11491161
context "MMRV programme" do
1150-
# We move forward in to the future where we can assume that MMRV is given
1151-
# to more children, this also ensures that the patients have a date of
1152-
# birth that makes them eligible.
1153-
1154-
before do
1155-
Flipper.enable(:mmrv)
1156-
travel 10.years
1157-
end
1158-
11591162
let(:programme) { Programme.mmr }
1163+
let(:year_group) { 0 }
1164+
11601165
let(:expected_programme) { "MMRV" }
11611166
let(:expected_dose_sequence) { nil }
11621167
let(:expected_consent_status) { "Consent given" }
@@ -1166,6 +1171,8 @@ def validation_formula(worksheet:, column_name:, row: 1)
11661171

11671172
context "Td/IPV programme" do
11681173
let(:programme) { Programme.td_ipv }
1174+
let(:year_group) { 9 }
1175+
11691176
let(:expected_programme) { "3-in-1" }
11701177
let(:expected_dose_sequence) { nil }
11711178
let(:expected_consent_status) { "Consent given" }

0 commit comments

Comments
 (0)