Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2a8c48a
Add empty state for no pharmacies
caitlinroach-nhs Jun 16, 2026
74c95ef
Merge branch 'main' of https://github.com/NHSDigital/record-a-vaccina…
caitlinroach-nhs Jun 17, 2026
25aba43
Merge branch 'main' of https://github.com/NHSDigital/record-a-vaccina…
caitlinroach-nhs Jun 17, 2026
bc7a20c
Merge branch 'main' of https://github.com/NHSDigital/record-a-vaccina…
caitlinroach-nhs Jun 17, 2026
7c878c3
Merge branch 'main' of https://github.com/NHSDigital/record-a-vaccina…
caitlinroach-nhs Jun 18, 2026
e8f6a32
Merge branch 'main' of https://github.com/NHSDigital/record-a-vaccina…
caitlinroach-nhs Jul 2, 2026
849369f
Merge branch 'main' of https://github.com/NHSDigital/record-a-vaccina…
caitlinroach-nhs Jul 6, 2026
fe671c1
Merge branch 'main' of https://github.com/NHSDigital/record-a-vaccina…
caitlinroach-nhs Jul 13, 2026
7357ef2
Merge branch 'main' of https://github.com/NHSDigital/record-a-vaccina…
caitlinroach-nhs Jul 20, 2026
0059675
Merge branch 'main' of https://github.com/NHSDigital/record-a-vaccina…
caitlinroach-nhs Jul 21, 2026
2b44e2d
Merge branch 'main' of https://github.com/NHSDigital/record-a-vaccina…
caitlinroach-nhs Jul 22, 2026
4b791da
Merge branch 'main' of https://github.com/NHSDigital/record-a-vaccina…
caitlinroach-nhs Jul 30, 2026
93723fd
Merge branch 'main' of https://github.com/NHSDigital/record-a-vaccina…
caitlinroach-nhs Aug 4, 2026
faa3c75
couple of changes that didn't get pushed last week
caitlinroach-nhs Aug 10, 2026
20ba278
Update warning message for deceased patient
Anna-Sutton Aug 10, 2026
f913a13
Update vaccination date prompt and hint text
Anna-Sutton Aug 10, 2026
69c4883
Enhance warning message for deceased patient vaccinations
Anna-Sutton Aug 10, 2026
70c7310
Update vaccination date prompt wording
Anna-Sutton Aug 10, 2026
78174ed
Add error when date input is after patient has died
caitlinroach-nhs Aug 10, 2026
567f434
Merge branch 'deceased-patient' of https://github.com/NHSDigital/reco…
caitlinroach-nhs Aug 10, 2026
d0ac50d
Added date of death and warning to check and confirm
caitlinroach-nhs Aug 10, 2026
8e94340
Removed second sentence in warning on check and confirm
caitlinroach-nhs Aug 10, 2026
745afef
Remove hint text for vaccination date
Anna-Sutton Aug 10, 2026
0a720d5
Modify warning text for deceased patient vaccinations
Anna-Sutton Aug 10, 2026
f0a8683
Update vaccination date error message
Anna-Sutton Aug 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions app/routes/record-vaccinations.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,72 @@ module.exports = router => {
res.redirect('/record-vaccinations/delivery-team')
})

router.get('/record-vaccinations/patient-history-deceased', (req, res) => {
const data = req.session.data
data.firstName = 'Jodie'
data.lastName = 'Brown'
data.dateOfBirth = { day: '15', month: '3', year: '1984' }
data.nhsNumber = '9123456789'
res.render('record-vaccinations/patient-history-deceased')
})

router.get('/record-vaccinations/vaccination-date-deceased', (req, res) => {
const data = req.session.data
const vaccinationDate = data.vaccinationDate || {}
const vaccinationDateAsDate = dateFromYearMonthDay(vaccinationDate.year, vaccinationDate.month, vaccinationDate.day)
let vaccinationDateError
const dateOfDeath = new Date(2024, 3, 20, 12) // 20 April 2024

if (req.query.showError === 'yes') {
if (!vaccinationDateAsDate) {
vaccinationDateError = 'Enter the vaccination date'
} else {
const today = new Date()
today.setHours(0, 0, 0, 0)
vaccinationDateAsDate.setHours(0, 0, 0, 0)
dateOfDeath.setHours(0, 0, 0, 0)

if (vaccinationDateAsDate >= today) {
vaccinationDateError = 'Enter a date in the past'
} else if (vaccinationDateAsDate > dateOfDeath) {
vaccinationDateError = 'The date of vaccination must be the same as or before the date the patient died (20 April 2024)'
}
}
}

res.render('record-vaccinations/vaccination-date-deceased', {
vaccinationDateError
})
})

router.post('/record-vaccinations/answer-date-deceased', (req, res) => {
const data = req.session.data
const vaccinationDate = data.vaccinationDate || {}
const vaccinationDateAsDate = dateFromYearMonthDay(vaccinationDate.year, vaccinationDate.month, vaccinationDate.day)
const dateOfDeath = new Date(2024, 3, 20, 12) // 20 April 2024

if (!vaccinationDateAsDate) {
return res.redirect('/record-vaccinations/vaccination-date-deceased?showError=yes')
}

const today = new Date()
today.setHours(0, 0, 0, 0)
vaccinationDateAsDate.setHours(0, 0, 0, 0)
dateOfDeath.setHours(0, 0, 0, 0)

if (vaccinationDateAsDate >= today) {
return res.redirect('/record-vaccinations/vaccination-date-deceased?showError=yes')
}

if (vaccinationDateAsDate > dateOfDeath) {
return res.redirect('/record-vaccinations/vaccination-date-deceased?showError=yes')
}

data.vaccinationToday = 'no'
data.patientIsDeceased = true
res.redirect('/record-vaccinations/delivery-team')
})

router.get('/record-vaccinations/delivery-team', (req, res) => {
let errors = []
const data = req.session.data
Expand Down
6 changes: 6 additions & 0 deletions app/views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ <h2>Main interface</h2>
<li><a href="/prototype-setup/quick-access/pharmacy?next=/user-profile">Profile page</a></li>
</ul>

<h2>Special circumstances</h2>

<ul>
<li><a href="/prototype-setup/quick-access/pharmacy?next=/record-vaccinations/patient-history-deceased">Deceased patient history</a></li>
</ul>

<h2>Regions interface</h2>

<ul>
Expand Down
18 changes: 17 additions & 1 deletion app/views/record-vaccinations/check.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@

<h1 class="nhsuk-heading-l">Check and confirm</h1>

{% if data.patientIsDeceased %}
{% from "warning-callout/macro.njk" import warningCallout %}
{{ warningCallout({
heading: "Important",
text: "This patient has died according to the Personal Demographics Service."
}) }}
{% endif %}

<h2 class="nhsuk-heading-m">Patient</h2>

{{ summaryList({
Expand All @@ -86,7 +94,7 @@ <h2 class="nhsuk-heading-m">Patient</h2>
text: "Date of birth"
},
value: {
html: (data.dateOfBirth | formatDate) + "<br>(76 years old)"
html: (data.dateOfBirth | formatDate) + ("" if data.patientIsDeceased else "<br>(76 years old)")
},
actions: {
items: [
Expand All @@ -98,6 +106,14 @@ <h2 class="nhsuk-heading-m">Patient</h2>
]
}
},
{
key: {
text: "Date of death"
},
value: {
html: "20 April 2024<br><div class=\"nhsuk-u-secondary-text-colour\">40 years old</div>"
}
} if data.patientIsDeceased,
{
key: {
text: "Address"
Expand Down
144 changes: 121 additions & 23 deletions app/views/record-vaccinations/patient-history-deceased.html
Original file line number Diff line number Diff line change
@@ -1,31 +1,42 @@
{% extends 'layout.html' %}

{% set pageName = "Check the patient details" %}
{% set pageName = "Check the patient's details" %}

{% set currentSection = "vaccinate" %}

{% if ((data.vaccine == "RSV") and (data.eligibility | arrayOrStringIncludes("Pregnant"))) or (data.vaccine == "Pertussis") %}
{% set nextPage = "/record-vaccinations/patient-estimated-due-date" %}

{% set patientFirstName = "Jodie" %}
{% set patientLastName = "Brown" %}
{% set patientFullName = patientFirstName + " " + patientLastName %}

{% set nextPage = "/record-vaccinations/vaccination-date-deceased" %}

{% if data.from == "appointments" %}
{% set previousPage = "/appointments" %}
{% elseif data.repeatVaccination === "yes" %}
{% set previousPage = "/record-vaccinations/patient" %}
{% elseif data.repeatPatient === "yes" %}
{% set previousPage = "/record-vaccinations/done" %}
{% else %}
{% set nextPage = "/record-vaccinations/consent" %}
{% set previousPage = "/record-vaccinations" %}
{% endif %}

{% set dateOfBirthHtml %}
{% if data.dateOfBirth %}
{{ (data.dateOfBirth | isoDateFromDateInput | govukDate) }}
<br>(75 years old)
{% endif %}
{% endset %}

{% block beforeContent %}
{{ backLink({ href: "/record-vaccinations/patient" }) }}
{{ backLink({ href: previousPage }) }}
{% endblock %}

{% block content %}
<div class="nhsuk-grid-row">
<div class="nhsuk-grid-column-two-thirds">

<h1 class="nhsuk-heading-l">Check {{ data.firstName }} {{ data.lastName }}’s details and vaccination history</h1>
<h1 class="nhsuk-heading-l">Check {{ patientFullName }}’s details and vaccination history</h1>

{% from "warning-callout/macro.njk" import warningCallout %}

{{ warningCallout({
heading: "Important",
text: "This patient has died according to the Personal Demographics Service. Continue if you want to record a vaccination given before they died."
}) }}

{{ summaryList({
rows: [
Expand All @@ -34,23 +45,23 @@ <h1 class="nhsuk-heading-l">Check {{ data.firstName }} {{ data.lastName }}’s d
text: "Name"
},
value: {
text: (data.firstName + " " + data.lastName)
text: patientFullName
}
},
{
key: {
text: "Date of birth"
},
value: {
html: "15 January 1954"
}
html: "15 March 1984"
}
},
{
key: {
text: "Date of death"
},
value: {
html: "20 March 2024<br>(70 years old)"
html: "20 April 2024<br><div class=\"nhsuk-u-secondary-text-colour\">40 years old</div>"
}
},
{
Expand All @@ -66,7 +77,15 @@ <h1 class="nhsuk-heading-l">Check {{ data.firstName }} {{ data.lastName }}’s d
text: "NHS number"
},
value: {
text: data.nhsNumber
text: "9123456789"
}
},
{
key: {
text: "GP surgery"
},
value: {
html: "Beech House surgery <br>1 Ash Tree Road<br>Knaresborough<br>HG5 0UB"
}
}
]
Expand All @@ -91,9 +110,17 @@ <h1 class="nhsuk-heading-l">Check {{ data.firstName }} {{ data.lastName }}’s d

<h2 class="nhsuk-heading-m">Vaccination history</h2>

<p>This shows NHS vaccinations given in England. Currently it includes COVID-19, flu, pertussis and RSV.</p>

<p>However, pertussis vaccinations given at a GP surgery are not shown.</p>
{% set insetTextHtml %}
<p>This shows NHS vaccinations given in England. It includes all vaccinations recorded in RAVS but only some recorded in other systems.</p>

{% endset %}

{{ insetText({
html: insetTextHtml,
classes: "nhsuk-u-padding-top-2 nhsuk-u-padding-bottom-2 nhsuk-u-margin-top-2 nhsuk-u-margin-bottom-4"
}) }}

</div>
</div>
<div class="nhsuk-grid-row">
Expand All @@ -117,14 +144,24 @@ <h2 class="nhsuk-heading-m">Vaccination history</h2>
rows: [
[
{
text: "1 December 2024"
text: "15 April 2025"
},
{
text: "COVID-19"
},
{
text: "Spikevax JN.1"
}
],[
{
text: "9 November 2024"
},
{
text: "MMR (2nd dose)"
},
{
text: "Priorix"
}
],[
{
text: "11 November 2024"
Expand All @@ -136,12 +173,23 @@ <h2 class="nhsuk-heading-m">Vaccination history</h2>
text: "Abrysvo"
}
],
[
{
text: "29 October 2024"
},
{
text: "Pneumococcal"
},
{
text: "Pneumovax"
}
],
[
{
text: "25 October 2024"
},
{
text: "Flu"
text: "Flu (1st dose)"
},
{
text: "Adjuvanted Quadrivalent Influenza Vaccine (aQIV)"
Expand All @@ -166,7 +214,19 @@ <h2 class="nhsuk-heading-m">Vaccination history</h2>
text: "Flu"
},
{
text: "Adjuvanted Quadrivalent Influenza Vaccine (aQIV)"
text: "Not known",
classes: "nhsuk-u-secondary-text-color"
}
],
[
{
text: "7 October 2023"
},
{
text: "Pertussis"
},
{
text: "Boostrix-IPV suspension"
}
],
[
Expand All @@ -179,10 +239,48 @@ <h2 class="nhsuk-heading-m">Vaccination history</h2>
{
text: "Moderna mRNA (Spikevax) Original"
}
],
[
{
text: "4 December 2023"
},
{
text: "MMR"
},
{
text: "Priorix"
}
]
]
}) }}

{{ pagination({
next: {
href: "#"
},
items: [
{
href: "#",
number: 1,
current: true
},
{
href: "#",
number: 2
},
{
href: "#",
number: 3
}
]
}) }}


<form action="{{ nextPage }}" method="post" novalidate>
{{ button({
text: "Continue"
})}}
</form>

</div>
</div>
Expand Down
Loading