diff --git a/app/routes/record-vaccinations.js b/app/routes/record-vaccinations.js index 80dec065..c7105840 100644 --- a/app/routes/record-vaccinations.js +++ b/app/routes/record-vaccinations.js @@ -861,17 +861,39 @@ module.exports = router => { redirectPath = "/record-vaccinations/add-batch" } else if (!vaccineBatch) { redirectPath = "/record-vaccinations/batch?showError=yes" - } else if (["COVID-19", "flu", "flu (London service)", "RSV", "pneumococcal", "3-in-1 teenage booster", "HPV", "MenACWY", "MenB", "shingles"].includes(data.vaccine)) { + //} else if (["COVID-19", "flu", "flu (London service)", "RSV", "pneumococcal", "3-in-1 teenage booster", "HPV", "MenACWY", "MenB", "shingles"].includes(data.vaccine)) { + } else if (["COVID-19", "RSV", "pneumococcal", "3-in-1 teenage booster", "HPV", "MenACWY", "shingles"].includes(data.vaccine)) { redirectPath = "/record-vaccinations/eligibility" } else if (data.vaccine === "pertussis") { redirectPath = "/record-vaccinations/patient-estimated-due-date" + } else if (["6-in-1", "flu", "flu (London service)", "MenB", "MMRV", "pneumococcal"].includes(data.vaccine)) { + data.showError = "no" + redirectPath = "/record-vaccinations/dose" } else { - // MMR, MMRV, 4-in-1, 6-in-1, rotavirus, BCG, hepatitis B redirectPath = "/record-vaccinations/consent" } res.redirect(redirectPath) }) + // START: answer-dose + + router.post('/record-vaccinations/answer-dose', (req, res) => { + + const data = req.session.data + const vaccineDose = data.vaccineDose + + let redirectPath + + if (!vaccineDose) { + redirectPath = "/record-vaccinations/dose?showError=yes" + } else { + redirectPath = "/record-vaccinations/eligibility" + } + res.redirect(redirectPath) + }) + + // END: answer-dose + router.get('/record-vaccinations/add-batch', (req, res) => { const data = req.session.data let errors = [] diff --git a/app/views/record-vaccinations/dose.html b/app/views/record-vaccinations/dose.html new file mode 100644 index 00000000..97be14a5 --- /dev/null +++ b/app/views/record-vaccinations/dose.html @@ -0,0 +1,116 @@ +{% extends 'layout.html' %} + +{% set pageName = "Which dose of " + data.vaccine + " are you giving?" %} + +{% set currentSection = "vaccinate" %} +{% set organisationSetting = currentUser.organisations | findById(data.currentOrganisationId) %} + +{% set previousPage = "/record-vaccinations/batch" %} + +{% block beforeContent %} + {{ backLink({ href: previousPage }) }} +{% endblock %} + +{% block content %} + + {% set errors = [] %} + + {% if data.showError == "yes" %} + {% set errors = [{ + text: "Select which dose of " + data.vaccine + " are you giving", + href: "#vaccineDose" + }] %} + {% endif %} + +