Skip to content
35 changes: 28 additions & 7 deletions app/routes/apply.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -22,7 +41,8 @@ module.exports = router => {
res.render('apply/start', {
allOrganisations,
allPharmacies,
allPharmacyCompanies
allPharmacyCompanies,
errors
})
})

Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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', {
Expand Down Expand Up @@ -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', {
Expand Down Expand Up @@ -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 }

Expand Down Expand Up @@ -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', {
Expand Down
68 changes: 44 additions & 24 deletions app/views/apply/start.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends 'layout.html' %}

{% set pageName = "Sign up" %}
{% set pageName = "Sign up for your pharmacy" %}

{% block beforeContent %}
{{ backLink({
Expand All @@ -12,42 +12,62 @@
{% block content %}
<div class="nhsuk-grid-row">
<div class="nhsuk-grid-column-two-thirds">
{% if (errors | length) > 0 %}
{{ errorSummary({
titleText: "There is a problem",
errorList: errors
}) }}
{% endif %}

<h1 class="nhsuk-heading-l">{{ pageName }}</h1>

<p>From 1 September 2026, community pharmacies offering NHS vaccinations must use this service.</p>

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

<form action="/apply/start-answer" method="post">
<p>For chains with 50 or more branches, there is a separate bulk onboarding option. <a href="#">Contact us for more details</a>.</p>

<h1 class="nhsuk-heading-l">{{ pageName }}</h1>
<form action="/apply/answer-pharmacy" method="post">

<p>Any community pharmacy offering NHS vaccinations can sign up.</p>
{% set options = [] %}
{% set items = [{ text: "", value: ""}] %}

<p>For other NHS settings, your regions are responsible for inviting you to use the service.</p>
{% 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({
"text": "Continue"
}) }}
</form>



</div>
</div>
{% endblock %}
14 changes: 8 additions & 6 deletions app/views/product-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ <h3 class="nhsuk-heading-m app-numbered-heading">
<span class="app-numbered-heading__title">Sign up</span>
</h3>
<div class="app-numbered-heading__content">
<p>Sign up with your NHS email and get an account.</p>
<p>Sign up for an account to access the service.</p>
</div>
</div>
<div class="nhsuk-grid-column-one-half nhsuk-u-margin-top-0 nhsuk-u-padding-left-8 nhsuk-u-padding-left-4 nhsuk-u-padding-bottom-8">
Expand Down Expand Up @@ -183,13 +183,15 @@ <h3 class="nhsuk-heading-m app-numbered-heading">
<div class="nhsuk-grid-row">
<div class="nhsuk-grid-column-two-thirds">

<h2 class="nhsuk-heading-l nhsuk-u-margin-bottom-5">Switching from another pharmacy system?</h2>
<h2 class="nhsuk-heading-l nhsuk-u-margin-bottom-5">Switching from another pharmacy system</h2>

<p>You can switch point of care systems at any time, and use different systems for different pharmacies.</p>
<p>From 1 September 2026, community pharmacies must use Record a vaccination for all NHS vaccinations, including COVID-19 and flu.</p>

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

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

<p>Other questions? <a href="/help-and-support">Get in touch</a>.</p>
<p>Any questions? <a href="/help-and-support">Get in touch</a>.</p>

</div>
</div>
Expand Down Expand Up @@ -231,9 +233,9 @@ <h2 class="nhsuk-heading-l nhsuk-u-margin-bottom-5">Trusts and GPs</h2>

<p>This includes teams vaccinating in occupational health, maternity, in-patient and outreach settings.</p>

<p>Your regions are responsible for inviting you to use the service.</p>
<p>Your regions are responsible for inviting you to use Record a vaccination.</p>

<p>If you want to use RAVS, <a href="https://future.nhs.uk/connect.ti/vaccsandscreening/view?objectId=1004883">contact your Regional Vaccination Operations Centre (RVOC)</a>.</p>
<p>If you want to use the service, <a href="https://future.nhs.uk/connect.ti/vaccsandscreening/view?objectId=1004883">contact your Regional Vaccination Operations Centre (RVOC)</a>.</p>

</div>
</div>
Expand Down