diff --git a/app/routes/record-vaccinations.js b/app/routes/record-vaccinations.js
index 1e20ad7f..e793a5f0 100644
--- a/app/routes/record-vaccinations.js
+++ b/app/routes/record-vaccinations.js
@@ -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
diff --git a/app/views/index.html b/app/views/index.html
index fa25b97b..887fe367 100755
--- a/app/views/index.html
+++ b/app/views/index.html
@@ -105,6 +105,12 @@
Main interface
Profile page
+ Special circumstances
+
+
+
Regions interface
diff --git a/app/views/record-vaccinations/check.html b/app/views/record-vaccinations/check.html
index b20e1643..19c9ef9d 100644
--- a/app/views/record-vaccinations/check.html
+++ b/app/views/record-vaccinations/check.html
@@ -60,6 +60,14 @@
Check and confirm
+ {% 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 %}
+
Patient
{{ summaryList({
@@ -86,7 +94,7 @@ Patient
text: "Date of birth"
},
value: {
- html: (data.dateOfBirth | formatDate) + "
(76 years old)"
+ html: (data.dateOfBirth | formatDate) + ("" if data.patientIsDeceased else "
(76 years old)")
},
actions: {
items: [
@@ -98,6 +106,14 @@ Patient
]
}
},
+ {
+ key: {
+ text: "Date of death"
+ },
+ value: {
+ html: "20 April 2024
40 years old
"
+ }
+ } if data.patientIsDeceased,
{
key: {
text: "Address"
diff --git a/app/views/record-vaccinations/patient-history-deceased.html b/app/views/record-vaccinations/patient-history-deceased.html
index 8cfac113..a2c5c9c5 100644
--- a/app/views/record-vaccinations/patient-history-deceased.html
+++ b/app/views/record-vaccinations/patient-history-deceased.html
@@ -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) }}
-
(75 years old)
- {% endif %}
-{% endset %}
-
{% block beforeContent %}
- {{ backLink({ href: "/record-vaccinations/patient" }) }}
+ {{ backLink({ href: previousPage }) }}
{% endblock %}
{% block content %}
-
Check {{ data.firstName }} {{ data.lastName }}’s details and vaccination history
+
Check {{ patientFullName }}’s details and vaccination history
+
+ {% 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: [
@@ -34,7 +45,7 @@
Check {{ data.firstName }} {{ data.lastName }}’s d
text: "Name"
},
value: {
- text: (data.firstName + " " + data.lastName)
+ text: patientFullName
}
},
{
@@ -42,15 +53,15 @@ Check {{ data.firstName }} {{ data.lastName }}’s d
text: "Date of birth"
},
value: {
- html: "15 January 1954"
- }
+ html: "15 March 1984"
+ }
},
{
key: {
text: "Date of death"
},
value: {
- html: "20 March 2024
(70 years old)"
+ html: "20 April 2024
40 years old
"
}
},
{
@@ -66,7 +77,15 @@ 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
1 Ash Tree Road
Knaresborough
HG5 0UB"
}
}
]
@@ -91,9 +110,17 @@ Check {{ data.firstName }} {{ data.lastName }}’s d
Vaccination history
-
This shows NHS vaccinations given in England. Currently it includes COVID-19, flu, pertussis and RSV.
-
However, pertussis vaccinations given at a GP surgery are not shown.
+{% set insetTextHtml %}
+
This shows NHS vaccinations given in England. It includes all vaccinations recorded in RAVS but only some recorded in other systems.
+
+{% 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"
+}) }}
+
@@ -117,7 +144,7 @@
Vaccination history
rows: [
[
{
- text: "1 December 2024"
+ text: "15 April 2025"
},
{
text: "COVID-19"
@@ -125,6 +152,16 @@ Vaccination history
{
text: "Spikevax JN.1"
}
+ ],[
+ {
+ text: "9 November 2024"
+ },
+ {
+ text: "MMR (2nd dose)"
+ },
+ {
+ text: "Priorix"
+ }
],[
{
text: "11 November 2024"
@@ -136,12 +173,23 @@ Vaccination history
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)"
@@ -166,7 +214,19 @@ Vaccination history
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"
}
],
[
@@ -179,10 +239,48 @@ Vaccination history
{
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
+ }
+ ]
+ }) }}
+
+
+
diff --git a/app/views/record-vaccinations/vaccination-date-deceased.html b/app/views/record-vaccinations/vaccination-date-deceased.html
new file mode 100644
index 00000000..98ac590a
--- /dev/null
+++ b/app/views/record-vaccinations/vaccination-date-deceased.html
@@ -0,0 +1,71 @@
+{% extends 'layout.html' %}
+
+{% set pageName = "When was the vaccination?" %}
+
+{% set currentSection = "vaccinate" %}
+
+{% block beforeContent %}
+ {{ backLink({ href: "/record-vaccinations/patient-history-deceased" }) }}
+{% endblock %}
+
+{% block content %}
+
+
+
+ {% if vaccinationDateError %}
+ {{ errorSummary({
+ titleText: "There is a problem",
+ errorList: [
+ {
+ text: vaccinationDateError,
+ href: "#vaccinationDate-day"
+ }
+ ]
+ }) }}
+ {% endif %}
+
+
+
+
+
+
+{% endblock %}