@@ -418,9 +418,7 @@ module.exports = router => {
418418
419419 const allLegalMechanisms = data . legalMechanisms
420420
421- const legalMechanisms = allLegalMechanisms . filter ( ( legalMechanism ) => {
422- return vaccine . legalMechanisms . includes ( legalMechanism . value )
423- } )
421+ const legalMechanisms = allLegalMechanisms
424422
425423 res . render ( 'record-vaccinations/legal-mechanism' , {
426424 legalMechanisms
@@ -640,7 +638,6 @@ module.exports = router => {
640638 organisationId : currentOrganisation . id ,
641639 siteId : data . siteId ,
642640 vaccinatorId : data . vaccinatorId ,
643- legalMechanism : data . legalMechanism ,
644641 eligibility : data . eligibility ,
645642 pregnancyDueDate : data . pregnancyDueDate ,
646643 consent : data . consent ,
@@ -755,7 +752,6 @@ module.exports = router => {
755752 req . session . data . vaccineProduct = ""
756753 req . session . data . vaccineBatch = ""
757754 req . session . data . eligibility = ""
758- req . session . data . legalMechanism = ""
759755
760756 res . redirect ( '/record-vaccinations/vaccine?repeatPatient=yes&repeatVaccination=no' )
761757
@@ -766,7 +762,6 @@ module.exports = router => {
766762 req . session . data . vaccineBatch = ""
767763 req . session . data . eligibility = ""
768764 req . session . data . nhsNumber = ""
769- req . session . data . legalMechanism = ""
770765 req . session . data . healthcareWorker = ""
771766
772767 res . redirect ( '/record-vaccinations/vaccine?repeatPatient=no&repeatVaccination=no' )
@@ -856,11 +851,6 @@ module.exports = router => {
856851 } )
857852 if ( ! vaccineOptions ) { res . redirect ( '/record-vaccinations' ) ; return }
858853
859- const allLegalMechanisms = data . legalMechanisms
860-
861- const legalMechanisms = allLegalMechanisms . filter ( ( legalMechanism ) => {
862- return vaccineOptions . legalMechanisms . includes ( legalMechanism [ 'value' ] )
863- } )
864854
865855 let redirectPath
866856
@@ -870,14 +860,7 @@ module.exports = router => {
870860 redirectPath = "/record-vaccinations/batch?showError=yes"
871861 } else if ( [ "COVID-19" , "flu" , "flu (London service)" , "RSV" , "pneumococcal" ] . includes ( data . vaccine ) ) {
872862
873- if ( legalMechanisms . length > 1 ) {
874- redirectPath = "/record-vaccinations/legal-mechanism"
875- } else {
876- // Set legal mechanism to the only option available and skip
877- // the question
878- data . legalMechanism = legalMechanisms [ 0 ] . value
879- redirectPath = "/record-vaccinations/eligibility"
880- }
863+ redirectPath = "/record-vaccinations/eligibility"
881864
882865 } else if ( data . repeatPatient === "yes" ) {
883866 redirectPath = "/record-vaccinations/patient-estimated-due-date"
@@ -923,10 +906,10 @@ module.exports = router => {
923906
924907 if ( data . newBatchNumber === '' || data . newBatchExpiryDate ?. day === '' || data . newBatchExpiryDate ?. month === '' || data . newBatchExpiryDate ?. year === '' ) {
925908 nextPage = "/record-vaccinations/add-batch?showErrors=yes"
926- } else if ( ( data . vaccine === "pertussis" ) || ( data . vaccine === "MMR" ) ) {
927- nextPage = "/record-vaccinations/patient "
909+ } else if ( [ "COVID-19" , "flu" , "flu (London service)" , "RSV" , "pneumococcal" ] . includes ( data . vaccine ) ) {
910+ nextPage = "/record-vaccinations/eligibility "
928911 } else {
929- nextPage = "/record-vaccinations/legal-mechanism "
912+ nextPage = "/record-vaccinations/patient "
930913 }
931914
932915 res . redirect ( nextPage )
0 commit comments