File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,10 +31,16 @@ class Reports::SystmOneExporter
3131 1 => "Y0da5" ,
3232 nil => "Y0da5"
3333 } ,
34+ "MMR VaxPro" => {
35+ nil => "Yb9ZN"
36+ } ,
3437 "Nimenrix" => {
3538 1 => "YOfcf" ,
3639 nil => "YOfcf"
3740 } ,
41+ "Priorix" => {
42+ nil => "Yav8l"
43+ } ,
3844 "Revaxis" => {
3945 1 => "Y3417" ,
4046 2 => "Y3418" ,
@@ -231,14 +237,14 @@ def vaccination(vaccination_record)
231237 vaccine_brand = vaccination_record . vaccine . brand
232238 dose_sequence = vaccination_record . dose_sequence
233239
234- mapping =
235- if programme . mmr?
240+ if programme . mmr?
241+ procedure_mapping =
236242 PROCEDURE_DOSE_MAPPINGS . dig ( programme . variant_type , dose_sequence )
237- else
238- PRODUCT_DOSE_MAPPINGS . dig ( vaccine_brand , dose_sequence )
239- end
243+ return procedure_mapping if procedure_mapping . present?
244+ end
240245
241- return mapping if mapping . present?
246+ product_mapping = PRODUCT_DOSE_MAPPINGS . dig ( vaccine_brand , dose_sequence )
247+ return product_mapping if product_mapping . present?
242248
243249 dose_sequence ? "#{ vaccine_brand } Part #{ dose_sequence } " : vaccine_brand
244250 end
Original file line number Diff line number Diff line change 298298 context "Priorix with unknown dose sequence" do
299299 let ( :vaccine ) { Vaccine . find_by! ( brand : "Priorix" ) }
300300
301- it { should eq ( "Priorix " ) }
301+ it { should eq ( "Yav8l " ) }
302302 end
303303
304304 context "MMR VaxPro with unknown dose sequence" do
305305 let ( :vaccine ) { Vaccine . find_by! ( brand : "MMR VaxPro" ) }
306306
307- it { should eq ( "MMR VaxPro " ) }
307+ it { should eq ( "Yb9ZN " ) }
308308 end
309309
310310 context "Priorix with dose sequence 1" do
You can’t perform that action at this time.
0 commit comments