diff --git a/app/routes/apply.js b/app/routes/apply.js index ed168add..4419dcb7 100644 --- a/app/routes/apply.js +++ b/app/routes/apply.js @@ -9,10 +9,29 @@ const sortByNameThenPostcode = (getPostcode = (item) => item.postcode) => (a, b) return 1 } +const findOrganisationById = (data, organisationId) => { + if (!organisationId) return null + return (data.organisations || []).find((organisation) => organisation.id === organisationId) || + (data.allOrganisations || []).find((organisation) => organisation.id === organisationId) +} + module.exports = router => { router.get('/apply/start', async (req, res) => { const data = req.session.data + let errors = [] + + if (req.query.error === 'no-pharmacy') { + errors.push({ + text: 'Select a pharmacy', + href: '#organisation-code' + }) + } else if (req.query.error === 'existing-account') { + errors.push({ + text: 'This pharmacy already has an account', + href: '#organisation-code' + }) + } const allOrganisations = data.allOrganisations.sort(sortByNameThenPostcode()) const allPharmacies = allOrganisations.filter((organisation) => organisation.type === "Community pharmacy") @@ -22,7 +41,8 @@ module.exports = router => { res.render('apply/start', { allOrganisations, allPharmacies, - allPharmacyCompanies + allPharmacyCompanies, + errors }) }) @@ -51,8 +71,9 @@ module.exports = router => { router.post('/apply/answer-pharmacy', (req, res) => { const data = req.session.data - const organisationId = data.organisationId - const organisation = data.allOrganisations.find((organisation) => organisation.id === organisationId) + const organisationId = data.organisationCode || data.organisationId + data.organisationId = organisationId + const organisation = findOrganisationById(data, organisationId) if (!organisation) { res.redirect('/apply/start?error=no-pharmacy'); @@ -94,7 +115,7 @@ module.exports = router => { router.get('/apply/check-pharmacy', (req, res) => { const data = req.session.data const organisationId = data.organisationId - const organisation = data.allOrganisations.find((organisation) => organisation.id === organisationId) + const organisation = findOrganisationById(data, organisationId) if (!organisation) { res.redirect('/apply/start'); return } res.render('apply/check-pharmacy', { @@ -145,7 +166,7 @@ module.exports = router => { router.get('/apply/check', (req, res) => { const data = req.session.data const organisationId = data.organisationId - const organisation = data.allOrganisations.find((organisation) => organisation.id === organisationId) + const organisation = findOrganisationById(data, organisationId) if (!organisation) { res.redirect('/apply/start'); return } res.render('apply/check', { @@ -177,7 +198,7 @@ module.exports = router => { router.get('/apply/check-your-email', (req, res) => { const data = req.session.data const organisationId = data.organisationId - const organisation = data.allOrganisations.find((organisation) => organisation.id === organisationId) + const organisation = findOrganisationById(data, organisationId) if (!organisation) { res.redirect('/apply/start'); return } @@ -242,7 +263,7 @@ module.exports = router => { router.get('/apply/welcome-email', (req, res) => { const data = req.session.data const organisationId = data.organisationId - const organisation = data.allOrganisations.find((organisation) => organisation.id === organisationId) + const organisation = findOrganisationById(data, organisationId) if (!organisation) { res.redirect('/apply/start'); return } res.render('apply/welcome-email', { diff --git a/app/views/apply/start.html b/app/views/apply/start.html index c6e54e66..10f0f52e 100644 --- a/app/views/apply/start.html +++ b/app/views/apply/start.html @@ -1,6 +1,6 @@ {% extends 'layout.html' %} -{% set pageName = "Sign up" %} +{% set pageName = "Sign up for your pharmacy" %} {% block beforeContent %} {{ backLink({ @@ -12,35 +12,53 @@ {% block content %}
+ {% if (errors | length) > 0 %} + {{ errorSummary({ + titleText: "There is a problem", + errorList: errors + }) }} + {% endif %} + +

{{ pageName }}

+ +

From 1 September 2026, community pharmacies must use Record a vaccination for all NHS vaccinations.

+ +

If you need to sign up for more than 1 pharmacy, you can use this form multiple times.

-
+

For chains with 50 or more branches, there is a separate bulk onboarding option. Email our onboarding team for more details.

-

{{ pageName }}

+ -

Any community pharmacy offering NHS vaccinations can sign up.

+ {% set options = [] %} + {% set items = [{ text: "", value: ""}] %} -

For other NHS settings, your regions are responsible for inviting you to use the service.

+ {% for organisation in data.organisations %} + {% if organisation.type == "Community Pharmacy" %} + {% set items = (items.push({ + text: organisation.name + ", " + organisation.address.line1 + ", " + (organisation.address.postcode | upper) + " (" + organisation.id + ")", + value: organisation.id, + selected: (organisation.id === data.organisationCode) + }), items) %} + {% endif %} + {% endfor %} - {{ radios({ - name: "oneOrMany", - value: data.oneOrMany, - fieldset: { - legend: { - text: "How many pharmacies do you want to sign up?", - size: "m", - isPageHeading: true - } + {{ select({ + id: "organisation-code", + name: "organisationCode", + label: { + text: "Find your pharmacy", + classes: "nhsuk-label--m nhsuk-u-margin-bottom-1" }, - items: [ - { - value: "single", - text: "A single pharmacy" - }, - { - value: "chain", - text: "A group of pharmacies" - } - ] + hint: { + text: "Search by name or ODS code" + }, + items: items, + errorMessage: { + text: (errors | first).text + } if (errors | length), + attributes: { + "data-module": "app-autocomplete" + } }) }} {{ button({ @@ -48,6 +66,8 @@

{{ pageName }}

}) }}
+ +
{% endblock %} diff --git a/app/views/product-page.html b/app/views/product-page.html index 4621e22e..e8cae2f4 100644 --- a/app/views/product-page.html +++ b/app/views/product-page.html @@ -68,7 +68,7 @@

Sign up

-

Sign up with your NHS email and get an account.

+

Sign up for an account to access the service.

@@ -183,14 +183,14 @@

-

Switching from another pharmacy system?

+

Switching from another pharmacy system

-

You can switch point of care systems at any time, and use different systems for different pharmacies.

+

From 1 September 2026, community pharmacies must use Record a vaccination for all NHS vaccinations, including COVID-19 and flu.

+ +

You can sign up for an account to use the service any time before the start of autumn vaccinations.

You will still have access to your previous system for at least 6 months so you can download reports.

-

Other questions? Get in touch.

-

@@ -231,9 +231,9 @@

Trusts and GPs

This includes teams vaccinating in occupational health, maternity, in-patient and outreach settings.

-

Your regions are responsible for inviting you to use the service.

+

Your regions are responsible for inviting you to use Record a vaccination.

-

If you want to use RAVS, contact your Regional Vaccination Operations Centre (RVOC).

+

If you want to use the service, contact your Regional Vaccination Operations Centre (RVOC).