Skip to content

Commit 499a927

Browse files
committed
Remove MMRV feature flag
This enables MMRV across the service and removes the ability to turn it off.
1 parent 035a7af commit 499a927

24 files changed

+82
-115
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 unless mmr?
@@ -152,12 +154,7 @@ def variant_for(disease_types: nil, patient: nil)
152154

153155
return self if eligible_for_mmrv.nil?
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
@@ -33,7 +33,9 @@ def mmrv_variant? = variant_type == "mmrv"
3333

3434
def translation_key = variant_type
3535

36-
def name = I18n.t(translation_key, scope: :programme_types)
36+
def name
37+
@name ||= I18n.t(translation_key, scope: :programme_types)
38+
end
3739

3840
def name_in_sentence = name
3941

config/feature_flags.yml

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

4646
testing_api: Basic API useful for automated testing.
47-
48-
mmrv: Adds support for MMRV vaccinations

spec/components/app_activity_log_component_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,6 @@
535535
describe "vaccination records" do
536536
context "for the MMRV variant" do
537537
let(:programme) do
538-
Flipper.enable(:mmrv)
539538
Programme.mmr.variant_for(
540539
disease_types: Programme::Variant::DISEASE_TYPES.fetch("mmrv")
541540
)

spec/components/app_patient_search_result_card_component_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@
8484
let(:programme) { Programme.mmr }
8585
let(:programmes) { [programme] }
8686

87-
before { Flipper.enable(:mmrv) }
88-
8987
context "with a patient not eligible for MMRV" do
9088
let(:patient) { create(:patient, date_of_birth: Date.new(2019, 1, 1)) }
9189

spec/components/app_session_summary_component_spec.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@
3939
it { should have_link("Download the HPV consent form (PDF)") }
4040

4141
context "for MMR(V) programme" do
42-
before { Flipper.enable(:mmrv) }
43-
4442
let(:programmes) { [Programme.mmr] }
4543

4644
it { should have_link("Download the MMR consent form (PDF)") }
@@ -58,8 +56,6 @@
5856
end
5957

6058
context "for MMR(V) programme" do
61-
before { Flipper.enable(:mmrv) }
62-
6359
let(:programmes) { [Programme.mmr] }
6460

6561
it { should have_link("View the MMR online consent form") }

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/factories/patient_consent_statuses.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
factory :patient_consent_status, class: "Patient::ConsentStatus" do
2828
patient
2929
programme { Programme.sample }
30+
disease_types { programme.disease_types }
3031
academic_year { AcademicYear.current }
3132

3233
traits_for_enum :status

spec/factories/patient_programme_statuses.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
FactoryBot.define do
3030
factory :patient_programme_status, class: "Patient::ProgrammeStatus" do
3131
patient
32-
academic_year { AcademicYear.current }
3332
programme { Programme.sample }
33+
academic_year { AcademicYear.current }
3434

3535
traits_for_enum :status
3636

0 commit comments

Comments
 (0)