@@ -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