From ce856d57a2a736b22e9cfd44977955eff897487e Mon Sep 17 00:00:00 2001 From: Frankie Roberto Date: Fri, 23 Jan 2026 15:00:19 +0000 Subject: [PATCH 01/18] Add appointments view --- app/views/appointments.html | 1313 ++++++++++++++++++++++++++++++++ app/views/includes/header.html | 6 + 2 files changed, 1319 insertions(+) create mode 100644 app/views/appointments.html diff --git a/app/views/appointments.html b/app/views/appointments.html new file mode 100644 index 00000000..5bd76e7a --- /dev/null +++ b/app/views/appointments.html @@ -0,0 +1,1313 @@ +{% extends 'layout.html' %} + +{% set pageName = "Today’s appointments" %} +{% set currentSection = "appointments" %} + + +{% block content %} +
+
+ +

{{ pageName }}

+ +

Imported from Manage your appointments.

+ + {% set todayContent %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TimeName and NHS numberDate of birthContact detailsServiceAction
9:30 amKeith Napkin
534 489 28161
10 January 1998 + + +

07506049635

+ + +
Flu 18-64Record
9:40 amLynn Feather
751 850 88552
25 September 2004 + + +

07950161353

+ + +
Flu 18-64Record
9:50 amCliff Sugarbowl
698 455 21065
21 December 1961 + + +

07567976511

+ + +
COVID and Flu 18-64Record
10:00 amAlan Teapot
823 936 81939
16 April 1969 + + +

07588547704

+ + +

alan.teapot@btinternet.com

+ + +

0111432626

+ + +
COVID 18+Record
10:10 amLorna Biscuitbarrel
652 120 50986
17 August 1946 + + +

07710440128

+ + +

lorna.biscuitbarrel@icloud.com

+ + +
COVID and Flu 65+Record
10:20 amMoira Packet
695 810 15754
14 April 1950 + + +

07240669762

+ + +

moira.packet38@btinternet.com

+ + +

0148073010

+ + +
COVID and Flu 65+Record
10:30 amPeter Cabbage
598 088 77172
18 October 1970 + + +

07987145006

+ + +

peter.cabbage57@outlook.com

+ + +

0114499021

+ + +
COVID and Flu 18-64Record
10:40 amArthur Pudding
416 036 78543
15 February 1992 + + +

07282639596

+ + +

arthur.pudding@outlook.com

+ + +
COVID and Flu 18-64Record
10:50 amSue Umbrella
646 576 88737
18 August 1942 + + +

07326120481

+ + +
Flu 65+Record
11:00 amClaire Biscuittin
543 256 07440
4 July 1933 + + +

07837337014

+ + +

0127388502

+ + +
COVID and Flu 65+Record
11:10 amAnita Cheesegrater
550 992 95151
29 September 1947 + + +

07159422998

+ + +
Flu 65+Record
11:20 amPatricia Carpet
605 550 53621
30 November 1970 + +

patricia.carpet@outlook.com

+ + +
COVID and Flu 18-64Record
11:30 amTerence Flannel
554 085 51969
30 November 1931 + + +

07732385497

+ + +

terence.flannel@aol.com

+ + +
Flu 65+Record
11:40 amJoan Curtainrod
830 548 67180
26 May 1992 + + +

07518723709

+ + +
COVID and Flu 18-64Record
11:50 amAngela Curtain
552 509 65068
1 October 1997 + + +

07105844688

+ + +

angela.curtain@hotmail.com

+ + +
COVID and Flu 18-64Record
12:00 pmAlan Muffin
764 578 14136
13 January 1984 + +

alan.muffin@yahoo.co.uk

+ + +
Flu 18-64Record
12:10 pmNeville Shovel
634 088 56154
3 April 2005 + + +

07857918379

+ + +
COVID and Flu 18-64Record
12:20 pmWayne Biscuittin
796 111 56795
30 October 1970 + + +

07546020705

+ + +

wayne.biscuittin@btinternet.com

+ + +
Flu 18-64Record
12:30 pmTerry Thimble
440 092 25502
25 June 1947 + +

terry.thimble@outlook.com

+ + +
COVID and Flu 65+Record
12:40 pmRenee Saltshaker
625 838 66360
1 September 1937 + +

renee.saltshaker@icloud.com

+ + +
Flu 65+Record
12:50 pmLucy Biscuit
647 914 02568
1 February 1951 + + +

07551565282

+ + +

lucy.biscuit@icloud.com

+ + +
COVID and Flu 65+Record
2:00 pmMalcolm Biscuitjar
722 170 15094
10 December 1931 + + Flu 65+Record
2:00 pmMalcolm Biscuitjar
722 170 15094
10 December 1931 + + Flu 65+Record
2:10 pmDennis Curtainrod
813 639 49763
27 March 1945 + + +

07355313512

+ + +
COVID and Flu 65+Record
2:10 pmDennis Curtainrod
813 639 49763
27 March 1945 + + +

07355313512

+ + +
COVID and Flu 65+Record
2:20 pmLaura Biscuit
500 103 25159
5 November 1945 + + +

07762754385

+ + +
Flu 65+Record
2:20 pmLaura Biscuit
500 103 25159
5 November 1945 + + +

07762754385

+ + +
Flu 65+Record
2:30 pmRicky Biscuittin
549 207 96709
27 April 2004 + + +

07246390868

+ + +

ricky.biscuittin@hotmail.com

+ + +
Flu 18-64Record
2:30 pmRicky Biscuittin
549 207 96709
27 April 2004 + + +

07246390868

+ + +

ricky.biscuittin@hotmail.com

+ + +
Flu 18-64Record
2:40 pmGavin Muffin
743 559 64101
20 January 1976 + + Flu 18-64Record
2:40 pmGavin Muffin
743 559 64101
20 January 1976 + + Flu 18-64Record
2:50 pmBetty Blanket
807 449 96071
12 February 1958 + + +

07306930446

+ + +
COVID and Flu 65+Record
2:50 pmBetty Blanket
807 449 96071
12 February 1958 + + +

07306930446

+ + +
COVID and Flu 65+Record
3:00 pmFallback 420
666 297 51522
12 October 1954 + + +

07432075107

+ + +

fallback29@outlook.com

+ + +
COVID and Flu 65+Record
3:00 pmFallback 420
666 297 51522
12 October 1954 + + +

07432075107

+ + +

fallback29@outlook.com

+ + +
COVID and Flu 65+Record
3:10 pmTed Blanket
641 674 40175
11 April 1937 + + +

07951444425

+ + +

ted.blanket@icloud.com

+ + +
COVID and Flu 65+Record
3:10 pmTed Blanket
641 674 40175
11 April 1937 + + +

07951444425

+ + +

ted.blanket@icloud.com

+ + +
COVID and Flu 65+Record
3:20 pmMaurice Applecart
492 665 35628
24 May 1942 + + +

07686070833

+ + +

maurice.applecart@aol.com

+ + +

0163234327

+ + +
COVID 18+Record
3:20 pmMaurice Applecart
492 665 35628
24 May 1942 + + +

07686070833

+ + +

maurice.applecart@aol.com

+ + +

0163234327

+ + +
COVID 18+Record
3:30 pmGertrude Porthole
665 815 30656
6 September 1948 + + +

07200561595

+ + +

gertrude.porthole@yahoo.co.uk

+ + +
COVID 18+Record
3:30 pmGertrude Porthole
665 815 30656
6 September 1948 + + +

07200561595

+ + +

gertrude.porthole@yahoo.co.uk

+ + +
COVID 18+Record
3:40 pmJeanette Biscuit
635 430 03443
24 May 2020 + + +

07938264833

+ + +

jeanette.biscuit@aol.com

+ + +
COVID 18+Record
3:40 pmJeanette Biscuit
635 430 03443
24 May 2020 + + +

07938264833

+ + +

jeanette.biscuit@aol.com

+ + +
COVID 18+Record
3:50 pmEddie Biscuitjar
775 926 88908
26 September 2003 + + +

07284762599

+ + +

eddie.biscuitjar@yahoo.co.uk

+ + +
Flu 18-64Record
3:50 pmEddie Biscuitjar
775 926 88908
26 September 2003 + + +

07284762599

+ + +

eddie.biscuitjar@yahoo.co.uk

+ + +
Flu 18-64Record
4:00 pmAgnes Mop
656 921 58254
22 December 1964 + + +

07852550050

+ + +

agnes.mop44@yahoo.co.uk

+ + +
COVID and Flu 18-64Record
4:00 pmAgnes Mop
656 921 58254
22 December 1964 + + +

07852550050

+ + +

agnes.mop44@yahoo.co.uk

+ + +
COVID and Flu 18-64Record
4:10 pmStephen Curtainrod
480 117 56439
28 April 1965 + + +

07396583512

+ + +

stephen.curtainrod@aol.com

+ + +
COVID and Flu 18-64Record
4:10 pmStephen Curtainrod
480 117 56439
28 April 1965 + + +

07396583512

+ + +

stephen.curtainrod@aol.com

+ + +
COVID and Flu 18-64Record
4:20 pmHelen Curtain
894 547 52263
25 July 1993 + + +

07149410376

+ + +

helen.curtain@outlook.com

+ + +
COVID and Flu 18-64Record
4:20 pmHelen Curtain
894 547 52263
25 July 1993 + + +

07149410376

+ + +

helen.curtain@outlook.com

+ + +
COVID and Flu 18-64Record
4:30 pmDenise Cloudberry
718 186 53238
27 February 2005 + + +

07279530526

+ + +

denise.cloudberry@yahoo.co.uk

+ + +
Flu 18-64Record
4:30 pmDenise Cloudberry
718 186 53238
27 February 2005 + + +

07279530526

+ + +

denise.cloudberry@yahoo.co.uk

+ + +
Flu 18-64Record
4:40 pmBrian Spatula
642 479 67687
24 March 1988 + + +

07153377152

+ + +

brian.spatula@hotmail.com

+ + +
Flu 18-64Record
4:40 pmBrian Spatula
642 479 67687
24 March 1988 + + +

07153377152

+ + +

brian.spatula@hotmail.com

+ + +
Flu 18-64Record
4:50 pmChloe Teacosy
719 976 59774
16 July 1984 + + +

07470501041

+ + +

chloe.teacosy@btinternet.com

+ + +
Flu 18-64Record
4:50 pmChloe Teacosy
719 976 59774
16 July 1984 + + +

07470501041

+ + +

chloe.teacosy@btinternet.com

+ + +
Flu 18-64Record
+ {% endset %} + + {{ tabs({ + items: [ + { + label: "Scheduled", + id: "scheduled", + panel: { + html: todayContent + } + }, + { + label: "Recordled", + id: "cancelled", + panel: { + html: "TODO" + } + }, + { + label: "Vaccinations given", + id: "done", + panel: { + html: "TODO" + } + } + ] + }) }} + + +
+
+ + +{% endblock %} diff --git a/app/views/includes/header.html b/app/views/includes/header.html index af2c9c64..9212b770 100644 --- a/app/views/includes/header.html +++ b/app/views/includes/header.html @@ -12,6 +12,12 @@ }), navigationItems) %} {% if currentOrganisation %} + {% set navigationItems = (navigationItems.push({ + href: "/appointments", + html: "Appointments New", + active: (currentSection == "appointments") + }), navigationItems) %} + {% set navigationItems = (navigationItems.push({ href: "/record-vaccinations", text: "Record vaccinations", From 0b135fbe335096224e694869d89c9ebf743dfd96 Mon Sep 17 00:00:00 2001 From: Frankie Roberto Date: Fri, 23 Jan 2026 15:06:02 +0000 Subject: [PATCH 02/18] fix typo --- app/views/appointments.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/appointments.html b/app/views/appointments.html index 5bd76e7a..647f2454 100644 --- a/app/views/appointments.html +++ b/app/views/appointments.html @@ -1289,7 +1289,7 @@

{{ pageName }}

} }, { - label: "Recordled", + label: "Cancelled", id: "cancelled", panel: { html: "TODO" From 72b5284305ebb45e73110b150ea6a80f9a78a2a3 Mon Sep 17 00:00:00 2001 From: Frankie Roberto Date: Mon, 16 Mar 2026 11:30:01 +0000 Subject: [PATCH 03/18] Make appointments page more dynamic --- app/data/appointments.js | 130 ++ app/data/session-data-defaults.js | 2 + app/views/appointments.html | 1264 +---------------- .../record-vaccinations/patient-history.html | 4 +- 4 files changed, 158 insertions(+), 1242 deletions(-) create mode 100644 app/data/appointments.js diff --git a/app/data/appointments.js b/app/data/appointments.js new file mode 100644 index 00000000..657a52fd --- /dev/null +++ b/app/data/appointments.js @@ -0,0 +1,130 @@ +// These are organisations set up as using RAVS +module.exports = [ + + { + time: "10:00", + patient: { + nhsNumber: "9123123123", + firstName: "Alan", + lastName: "Teapot", + dateOfBirth: "1969-04-16", + contactDetails: { + mobile: "07588547704", + phone: "0111432626", + email: "alan.teapot@btinternet.com" + } + }, + vaccinations: [ + "COVID-19" + ] + }, + { + time: "10:30", + patient: { + nhsNumber: "9841414141", + firstName: "Keith", + lastName: "Napkin", + dateOfBirth: "1976-02-12", + contactDetails: { + mobile: "077345813941" + } + }, + vaccinations: [ + "COVID-19", + "Flu" + ] + }, + { + time: "10:40", + patient: { + nhsNumber: "9841515715", + firstName: "Lynn", + lastName: "Feather", + dateOfBirth: "1963-05-23", + contactDetails: { + email: "lynn.feather@gmail.com" + } + }, + vaccinations: [ + "Flu", "RSV" + ] + }, + { + time: "11:10", + patient: { + nhsNumber: "98357151513", + firstName: "Lorna", + lastName: "Biscuitbarrel", + dateOfBirth: "1962-08-19", + contactDetails: { + mobile: "07364824944" + } + }, + vaccinations: [ + "Flu" + ] + }, + { + time: "11:20", + patient: { + nhsNumber: "9847471413", + firstName: "Moira", + lastName: "Packet", + dateOfBirth: "1950-04-14", + contactDetails: { + mobile: "07623842424" + } + }, + vaccinations: [ + "COVID-19" + ] + }, + { + time: "11:30", + patient: { + nhsNumber: "9841411411", + firstName: "Cliff", + lastName: "Sugarbowl", + dateOfBirth: "1957-01-23", + contactDetails: { + mobile: "07623913141" + } + }, + vaccinations: [ + "COVID-19" + ] + }, + { + time: "11:40", + patient: { + nhsNumber: "9841411411", + firstName: "James", + lastName: "Brown", + dateOfBirth: "1952-04-19", + contactDetails: { + mobile: "0723456123", + email: "james.brown@hotmail.com" + } + }, + vaccinations: [ + "COVID-19" + ] + }, + { + time: "11:50", + patient: { + nhsNumber: "9917425141", + firstName: "Emma", + lastName: "Blue", + dateOfBirth: "1973-01-23", + contactDetails: { + mobile: "07524222525", + email: "emma.blue123@nhs.net" + } + }, + vaccinations: [ + "COVID-19", "RSV" + ] + } + +] diff --git a/app/data/session-data-defaults.js b/app/data/session-data-defaults.js index 63629e74..07407815 100644 --- a/app/data/session-data-defaults.js +++ b/app/data/session-data-defaults.js @@ -5,6 +5,7 @@ const users = require('./users') const vaccinationsRecorded = require('./vaccinations-recorded') const vaccineStock = require('./vaccine-stock') const vaccines = require('./vaccines') +const appointments = require('./appointments') module.exports = { organisations: organisations, @@ -13,6 +14,7 @@ module.exports = { users: users, vaccines: vaccines, vaccineStock: vaccineStock, + appointments: appointments, lists: [], nhsNumberKnown: "yes", currentUserId: "2387441662601", diff --git a/app/views/appointments.html b/app/views/appointments.html index 647f2454..058942e0 100644 --- a/app/views/appointments.html +++ b/app/views/appointments.html @@ -13,14 +13,15 @@

{{ pageName }}

Imported from Manage your appointments.

{% set todayContent %} - + +
- - + + - + @@ -28,1253 +29,34 @@

{{ pageName }}

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + {% for appointment in data.appointments %} - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + {% endfor %}
TimeName and NHS numberTimeName Date of birth Contact detailsServiceVaccines Action
9:30 amKeith Napkin
534 489 28161
10 January 1998 - - -

07506049635

- - -
Flu 18-64Record
9:40 amLynn Feather
751 850 88552
25 September 2004 - - -

07950161353

- - -
Flu 18-64Record
9:50 amCliff Sugarbowl
698 455 21065
21 December 1961 - - -

07567976511

- - -
COVID and Flu 18-64Record
10:00 amAlan Teapot
823 936 81939
16 April 1969 - - -

07588547704

- - -

alan.teapot@btinternet.com

- - -

0111432626

- - -
COVID 18+Record
10:10 amLorna Biscuitbarrel
652 120 50986
17 August 1946 - - -

07710440128

- - -

lorna.biscuitbarrel@icloud.com

- - -
COVID and Flu 65+Record
10:20 amMoira Packet
695 810 15754
14 April 1950 - - -

07240669762

- - -

moira.packet38@btinternet.com

- - -

0148073010

- - -
COVID and Flu 65+Record
10:30 amPeter Cabbage
598 088 77172
18 October 1970 - - -

07987145006

- - -

peter.cabbage57@outlook.com

- - -

0114499021

- - -
COVID and Flu 18-64Record
10:40 amArthur Pudding
416 036 78543
15 February 1992 - - -

07282639596

- - -

arthur.pudding@outlook.com

- - -
COVID and Flu 18-64Record
10:50 amSue Umbrella
646 576 88737
18 August 1942 - - -

07326120481

- - -
Flu 65+Record
11:00 amClaire Biscuittin
543 256 07440
4 July 1933 - - -

07837337014

- - -

0127388502

- - -
COVID and Flu 65+Record
11:10 amAnita Cheesegrater
550 992 95151
29 September 1947 - - -

07159422998

- - -
Flu 65+Record
11:20 amPatricia Carpet
605 550 53621
30 November 1970 - -

patricia.carpet@outlook.com

- - -
COVID and Flu 18-64Record
11:30 amTerence Flannel
554 085 51969
30 November 1931 - - -

07732385497

- - -

terence.flannel@aol.com

- - +
{{ appointment.time }} am + {{ appointment.patient.firstName }} + {{ appointment.patient.lastName }} Flu 65+Record
11:40 amJoan Curtainrod
830 548 67180
26 May 1992 - - -

07518723709

- - +
+ {{ appointment.patient.dateOfBirth | govukDate }} COVID and Flu 18-64Record
11:50 amAngela Curtain
552 509 65068
1 October 1997 - - -

07105844688

- - -

angela.curtain@hotmail.com

- - + {% if appointment.patient.contactDetails.mobile %} + {{ appointment.patient.contactDetails.mobile }}
+ {% endif %} + {% if appointment.patient.contactDetails.email %} + {{ appointment.patient.contactDetails.email }}
+ {% endif %}
COVID and Flu 18-64Record
12:00 pmAlan Muffin
764 578 14136
13 January 1984 - -

alan.muffin@yahoo.co.uk

- - +
+ {{ appointment.vaccinations | join(", ") }} Flu 18-64Record
12:10 pmNeville Shovel
634 088 56154
3 April 2005 - - -

07857918379

- - +
+ Record COVID and Flu 18-64Record
12:20 pmWayne Biscuittin
796 111 56795
30 October 1970 - - -

07546020705

- - -

wayne.biscuittin@btinternet.com

- - -
Flu 18-64Record
12:30 pmTerry Thimble
440 092 25502
25 June 1947 - -

terry.thimble@outlook.com

- - -
COVID and Flu 65+Record
12:40 pmRenee Saltshaker
625 838 66360
1 September 1937 - -

renee.saltshaker@icloud.com

- - -
Flu 65+Record
12:50 pmLucy Biscuit
647 914 02568
1 February 1951 - - -

07551565282

- - -

lucy.biscuit@icloud.com

- - -
COVID and Flu 65+Record
2:00 pmMalcolm Biscuitjar
722 170 15094
10 December 1931 - - Flu 65+Record
2:00 pmMalcolm Biscuitjar
722 170 15094
10 December 1931 - - Flu 65+Record
2:10 pmDennis Curtainrod
813 639 49763
27 March 1945 - - -

07355313512

- - -
COVID and Flu 65+Record
2:10 pmDennis Curtainrod
813 639 49763
27 March 1945 - - -

07355313512

- - -
COVID and Flu 65+Record
2:20 pmLaura Biscuit
500 103 25159
5 November 1945 - - -

07762754385

- - -
Flu 65+Record
2:20 pmLaura Biscuit
500 103 25159
5 November 1945 - - -

07762754385

- - -
Flu 65+Record
2:30 pmRicky Biscuittin
549 207 96709
27 April 2004 - - -

07246390868

- - -

ricky.biscuittin@hotmail.com

- - -
Flu 18-64Record
2:30 pmRicky Biscuittin
549 207 96709
27 April 2004 - - -

07246390868

- - -

ricky.biscuittin@hotmail.com

- - -
Flu 18-64Record
2:40 pmGavin Muffin
743 559 64101
20 January 1976 - - Flu 18-64Record
2:40 pmGavin Muffin
743 559 64101
20 January 1976 - - Flu 18-64Record
2:50 pmBetty Blanket
807 449 96071
12 February 1958 - - -

07306930446

- - -
COVID and Flu 65+Record
2:50 pmBetty Blanket
807 449 96071
12 February 1958 - - -

07306930446

- - -
COVID and Flu 65+Record
3:00 pmFallback 420
666 297 51522
12 October 1954 - - -

07432075107

- - -

fallback29@outlook.com

- - -
COVID and Flu 65+Record
3:00 pmFallback 420
666 297 51522
12 October 1954 - - -

07432075107

- - -

fallback29@outlook.com

- - -
COVID and Flu 65+Record
3:10 pmTed Blanket
641 674 40175
11 April 1937 - - -

07951444425

- - -

ted.blanket@icloud.com

- - -
COVID and Flu 65+Record
3:10 pmTed Blanket
641 674 40175
11 April 1937 - - -

07951444425

- - -

ted.blanket@icloud.com

- - -
COVID and Flu 65+Record
3:20 pmMaurice Applecart
492 665 35628
24 May 1942 - - -

07686070833

- - -

maurice.applecart@aol.com

- - -

0163234327

- - -
COVID 18+Record
3:20 pmMaurice Applecart
492 665 35628
24 May 1942 - - -

07686070833

- - -

maurice.applecart@aol.com

- - -

0163234327

- - -
COVID 18+Record
3:30 pmGertrude Porthole
665 815 30656
6 September 1948 - - -

07200561595

- - -

gertrude.porthole@yahoo.co.uk

- - -
COVID 18+Record
3:30 pmGertrude Porthole
665 815 30656
6 September 1948 - - -

07200561595

- - -

gertrude.porthole@yahoo.co.uk

- - -
COVID 18+Record
3:40 pmJeanette Biscuit
635 430 03443
24 May 2020 - - -

07938264833

- - -

jeanette.biscuit@aol.com

- - -
COVID 18+Record
3:40 pmJeanette Biscuit
635 430 03443
24 May 2020 - - -

07938264833

- - -

jeanette.biscuit@aol.com

- - -
COVID 18+Record
3:50 pmEddie Biscuitjar
775 926 88908
26 September 2003 - - -

07284762599

- - -

eddie.biscuitjar@yahoo.co.uk

- - -
Flu 18-64Record
3:50 pmEddie Biscuitjar
775 926 88908
26 September 2003 - - -

07284762599

- - -

eddie.biscuitjar@yahoo.co.uk

- - -
Flu 18-64Record
4:00 pmAgnes Mop
656 921 58254
22 December 1964 - - -

07852550050

- - -

agnes.mop44@yahoo.co.uk

- - -
COVID and Flu 18-64Record
4:00 pmAgnes Mop
656 921 58254
22 December 1964 - - -

07852550050

- - -

agnes.mop44@yahoo.co.uk

- - -
COVID and Flu 18-64Record
4:10 pmStephen Curtainrod
480 117 56439
28 April 1965 - - -

07396583512

- - -

stephen.curtainrod@aol.com

- - -
COVID and Flu 18-64Record
4:10 pmStephen Curtainrod
480 117 56439
28 April 1965 - - -

07396583512

- - -

stephen.curtainrod@aol.com

- - -
COVID and Flu 18-64Record
4:20 pmHelen Curtain
894 547 52263
25 July 1993 - - -

07149410376

- - -

helen.curtain@outlook.com

- - -
COVID and Flu 18-64Record
4:20 pmHelen Curtain
894 547 52263
25 July 1993 - - -

07149410376

- - -

helen.curtain@outlook.com

- - -
COVID and Flu 18-64Record
4:30 pmDenise Cloudberry
718 186 53238
27 February 2005 - - -

07279530526

- - -

denise.cloudberry@yahoo.co.uk

- - -
Flu 18-64Record
4:30 pmDenise Cloudberry
718 186 53238
27 February 2005 - - -

07279530526

- - -

denise.cloudberry@yahoo.co.uk

- - -
Flu 18-64Record
4:40 pmBrian Spatula
642 479 67687
24 March 1988 - - -

07153377152

- - -

brian.spatula@hotmail.com

- - -
Flu 18-64Record
4:40 pmBrian Spatula
642 479 67687
24 March 1988 - - -

07153377152

- - -

brian.spatula@hotmail.com

- - -
Flu 18-64Record
4:50 pmChloe Teacosy
719 976 59774
16 July 1984 - - -

07470501041

- - -

chloe.teacosy@btinternet.com

- - -
Flu 18-64Record
4:50 pmChloe Teacosy
719 976 59774
16 July 1984 - - -

07470501041

- - -

chloe.teacosy@btinternet.com

- - -
Flu 18-64Record
{% endset %} diff --git a/app/views/record-vaccinations/patient-history.html b/app/views/record-vaccinations/patient-history.html index 2b5bb47b..e0ee8c06 100644 --- a/app/views/record-vaccinations/patient-history.html +++ b/app/views/record-vaccinations/patient-history.html @@ -24,7 +24,9 @@ {% set nextPage = "/record-vaccinations/vaccination-date" %} {% endif %} -{% if data.repeatVaccination === "yes" %} +{% 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" %} From b090a78b7e818b5ec6931e2060999a88ff9e681d Mon Sep 17 00:00:00 2001 From: Frankie Roberto Date: Mon, 16 Mar 2026 12:04:08 +0000 Subject: [PATCH 04/18] Code style fix --- app/data/session-data-defaults.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/data/session-data-defaults.js b/app/data/session-data-defaults.js index 07407815..cb2120a0 100644 --- a/app/data/session-data-defaults.js +++ b/app/data/session-data-defaults.js @@ -1,11 +1,11 @@ const allOrganisations = require('./all-organisations') +const appointments = require('./appointments') const featureFlags = require('./feature-flags') const organisations = require('./organisations') const users = require('./users') const vaccinationsRecorded = require('./vaccinations-recorded') const vaccineStock = require('./vaccine-stock') const vaccines = require('./vaccines') -const appointments = require('./appointments') module.exports = { organisations: organisations, From f89fccea79eca756e72adf4b6a41935f58ebf9fe Mon Sep 17 00:00:00 2001 From: Frankie Roberto Date: Fri, 17 Apr 2026 11:20:39 +0100 Subject: [PATCH 05/18] Move file into folder --- app/views/{appointments.html => appointments/index.html} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename app/views/{appointments.html => appointments/index.html} (100%) diff --git a/app/views/appointments.html b/app/views/appointments/index.html similarity index 100% rename from app/views/appointments.html rename to app/views/appointments/index.html From 53e741bfc38770291ced62cb3cd21af2a1f16848 Mon Sep 17 00:00:00 2001 From: Frankie Roberto Date: Fri, 17 Apr 2026 13:44:54 +0100 Subject: [PATCH 06/18] Add cancellation tab mockup --- app/data/appointments.js | 39 ++++++++++++++++++ app/views/appointments/_cancelled.html | 51 ++++++++++++++++++++++++ app/views/appointments/_scheduled.html | 45 +++++++++++++++++++++ app/views/appointments/index.html | 55 ++++---------------------- 4 files changed, 142 insertions(+), 48 deletions(-) create mode 100644 app/views/appointments/_cancelled.html create mode 100644 app/views/appointments/_scheduled.html diff --git a/app/data/appointments.js b/app/data/appointments.js index 657a52fd..5588fff4 100644 --- a/app/data/appointments.js +++ b/app/data/appointments.js @@ -51,6 +51,9 @@ module.exports = [ }, { time: "11:10", + cancelled: { + reason: "patient" + }, patient: { nhsNumber: "98357151513", firstName: "Lorna", @@ -125,6 +128,42 @@ module.exports = [ vaccinations: [ "COVID-19", "RSV" ] + }, + { + time: "12:10", + cancelled: { + reason: "organisation" + }, + patient: { + nhsNumber: "9741851731", + firstName: "Charlie", + lastName: "Green", + dateOfBirth: "1983-06-12", + contactDetails: { + email: "charlie.green@hotmail.com" + } + }, + vaccinations: [ + "COVID-19" + ] + }, + { + time: "12:40", + cancelled: { + reason: "auto" + }, + patient: { + nhsNumber: "9951736814", + firstName: "Jason", + lastName: "White", + dateOfBirth: "1998-03-19", + contactDetails: { + email: "jw225235@gmail.com" + } + }, + vaccinations: [ + "Flu" + ] } ] diff --git a/app/views/appointments/_cancelled.html b/app/views/appointments/_cancelled.html new file mode 100644 index 00000000..8bb15e2f --- /dev/null +++ b/app/views/appointments/_cancelled.html @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + {% for appointment in data.appointments %} + {% if appointment.cancelled %} + + + + + + + + + {% endif %} + {% endfor %} + +
TimeNameDate of birthContact detailsVaccinesCancelled by
{{ appointment.time }} am + {{ appointment.patient.firstName }} + {{ appointment.patient.lastName }} + + {{ appointment.patient.dateOfBirth | govukDate }} + + {% if appointment.patient.contactDetails.mobile %} + {{ appointment.patient.contactDetails.mobile }}
+ {% endif %} + {% if appointment.patient.contactDetails.email %} + {{ appointment.patient.contactDetails.email }}
+ {% endif %} +
+ {{ appointment.vaccinations | join(", ") }} + + {% if appointment.cancelled.reason == "patient" %} + Patient + {% elif appointment.cancelled.reason == "organisation" %} + Us + {% elif appointment.cancelled.reason == "auto" %} + Automatic + {% endif %} +
diff --git a/app/views/appointments/_scheduled.html b/app/views/appointments/_scheduled.html new file mode 100644 index 00000000..92d909bd --- /dev/null +++ b/app/views/appointments/_scheduled.html @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + {% for appointment in data.appointments %} + {% if not appointment.cancelled %} + + + + + + + + + {% endif %} + {% endfor %} + +
TimeNameDate of birthContact detailsVaccinesAction
{{ appointment.time }} am + {{ appointment.patient.firstName }} + {{ appointment.patient.lastName }} + + {{ appointment.patient.dateOfBirth | govukDate }} + + {% if appointment.patient.contactDetails.mobile %} + {{ appointment.patient.contactDetails.mobile }}
+ {% endif %} + {% if appointment.patient.contactDetails.email %} + {{ appointment.patient.contactDetails.email }}
+ {% endif %} +
+ {{ appointment.vaccinations | join(", ") }} + + Record +
diff --git a/app/views/appointments/index.html b/app/views/appointments/index.html index 058942e0..aca59fcd 100644 --- a/app/views/appointments/index.html +++ b/app/views/appointments/index.html @@ -12,53 +12,12 @@

{{ pageName }}

Imported from Manage your appointments.

- {% set todayContent %} - - - - - - - - - - - - - - - - - {% for appointment in data.appointments %} - - - - - - - - - + {% set todayHtml %} + {% include "appointments/_scheduled.html" %} + {% endset %} - {% endfor %} - -
TimeNameDate of birthContact detailsVaccinesAction
{{ appointment.time }} am - {{ appointment.patient.firstName }} - {{ appointment.patient.lastName }} - - {{ appointment.patient.dateOfBirth | govukDate }} - - {% if appointment.patient.contactDetails.mobile %} - {{ appointment.patient.contactDetails.mobile }}
- {% endif %} - {% if appointment.patient.contactDetails.email %} - {{ appointment.patient.contactDetails.email }}
- {% endif %} -
- {{ appointment.vaccinations | join(", ") }} - - Record -
+ {% set cancelledHtml %} + {% include "appointments/_cancelled.html" %} {% endset %} {{ tabs({ @@ -67,14 +26,14 @@

{{ pageName }}

label: "Scheduled", id: "scheduled", panel: { - html: todayContent + html: todayHtml } }, { label: "Cancelled", id: "cancelled", panel: { - html: "TODO" + html: cancelledHtml } }, { From db6f3160077f3a41a7503289126bfbb7853d7ba1 Mon Sep 17 00:00:00 2001 From: Frankie Roberto Date: Fri, 17 Apr 2026 16:08:02 +0100 Subject: [PATCH 07/18] More design exploration --- app/data/appointments.js | 11 ++++- app/routes/record-vaccinations.js | 23 +++++++++++ app/views/appointments/_cancelled.html | 16 ++++---- app/views/appointments/_scheduled.html | 11 ++--- .../appointments/_vaccinations_given.html | 41 +++++++++++++++++++ app/views/appointments/index.html | 25 +++++++++-- app/views/record-vaccinations/done.html | 36 +++++++++++----- app/views/record-vaccinations/index.html | 3 ++ 8 files changed, 138 insertions(+), 28 deletions(-) create mode 100644 app/views/appointments/_vaccinations_given.html diff --git a/app/data/appointments.js b/app/data/appointments.js index 5588fff4..6fcef77a 100644 --- a/app/data/appointments.js +++ b/app/data/appointments.js @@ -2,6 +2,7 @@ module.exports = [ { + id: "163473464363", time: "10:00", patient: { nhsNumber: "9123123123", @@ -19,6 +20,7 @@ module.exports = [ ] }, { + id: "923532535", time: "10:30", patient: { nhsNumber: "9841414141", @@ -35,6 +37,7 @@ module.exports = [ ] }, { + id: "2364364369", time: "10:40", patient: { nhsNumber: "9841515715", @@ -50,6 +53,7 @@ module.exports = [ ] }, { + id: "3026352592", time: "11:10", cancelled: { reason: "patient" @@ -68,6 +72,7 @@ module.exports = [ ] }, { + id: "410059235", time: "11:20", patient: { nhsNumber: "9847471413", @@ -83,6 +88,7 @@ module.exports = [ ] }, { + id: "5019581446", time: "11:30", patient: { nhsNumber: "9841411411", @@ -98,6 +104,7 @@ module.exports = [ ] }, { + id: "69263464", time: "11:40", patient: { nhsNumber: "9841411411", @@ -114,6 +121,7 @@ module.exports = [ ] }, { + id: "7692855825", time: "11:50", patient: { nhsNumber: "9917425141", @@ -130,6 +138,7 @@ module.exports = [ ] }, { + id: "8928558275", time: "12:10", cancelled: { reason: "organisation" @@ -148,6 +157,7 @@ module.exports = [ ] }, { + id: "9255253581", time: "12:40", cancelled: { reason: "auto" @@ -165,5 +175,4 @@ module.exports = [ "Flu" ] } - ] diff --git a/app/routes/record-vaccinations.js b/app/routes/record-vaccinations.js index 9cbd7219..9c415923 100644 --- a/app/routes/record-vaccinations.js +++ b/app/routes/record-vaccinations.js @@ -646,6 +646,16 @@ module.exports = router => { data.lastAddedVaccinationId = generatedId + // Add the vaccination ID to the appointment so that + // we can filter the appointments list by which ones have + // been given + if (data.appointmentId) { + const appointment = data.appointments.find((appointment) => appointment.id == data.appointmentId) + + appointment.vaccinationIds ||= [] + appointment.vaccinationIds.push(generatedId) + } + res.redirect('/record-vaccinations/done') }) @@ -770,6 +780,19 @@ module.exports = router => { req.session.data.vaccineDose = "" res.redirect('/record-vaccinations/?repeatPatient=no&repeatVaccination=no') + + } else if (answer === 'appointments') { + + req.session.data.vaccine = "" + req.session.data.vaccineProduct = "" + req.session.data.vaccineBatch = "" + req.session.data.eligibility = "" + req.session.data.nhsNumber = "" + req.session.data.healthcareWorker = "" + req.session.data.vaccineDose = "" + + res.redirect('/appointments') + } else { res.redirect('/record-vaccinations/done?showErrors=yes') } diff --git a/app/views/appointments/_cancelled.html b/app/views/appointments/_cancelled.html index 8bb15e2f..acfc7d1a 100644 --- a/app/views/appointments/_cancelled.html +++ b/app/views/appointments/_cancelled.html @@ -4,10 +4,11 @@ Time Name Date of birth - Contact details Vaccines - Cancelled by + Contact details + + @@ -24,6 +25,10 @@ {{ appointment.patient.dateOfBirth | govukDate }} + + {{ appointment.vaccinations | join(", ") }} + + {% if appointment.patient.contactDetails.mobile %} {{ appointment.patient.contactDetails.mobile }}
@@ -32,10 +37,7 @@ {{ appointment.patient.contactDetails.email }}
{% endif %} - - {{ appointment.vaccinations | join(", ") }} - - + {% endif %} {% endfor %} diff --git a/app/views/appointments/_scheduled.html b/app/views/appointments/_scheduled.html index 92d909bd..fd2d3730 100644 --- a/app/views/appointments/_scheduled.html +++ b/app/views/appointments/_scheduled.html @@ -4,8 +4,8 @@ Time Name Date of birth - Contact details Vaccines + Contact details Action @@ -24,6 +24,9 @@ {{ appointment.patient.dateOfBirth | govukDate }} + + {{ appointment.vaccinations | join(", ") }} + {% if appointment.patient.contactDetails.mobile %} {{ appointment.patient.contactDetails.mobile }}
@@ -33,10 +36,8 @@ {% endif %} - {{ appointment.vaccinations | join(", ") }} - - - Record + Record + {% endif %} diff --git a/app/views/appointments/_vaccinations_given.html b/app/views/appointments/_vaccinations_given.html new file mode 100644 index 00000000..2920ccb1 --- /dev/null +++ b/app/views/appointments/_vaccinations_given.html @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + {% for appointment in data.appointments %} + {% if not appointment.cancelled %} + + + + + + + + + {% endif %} + {% endfor %} + +
TimeNameDate of birthVaccines givenContact details
{{ appointment.time }} am + {{ appointment.patient.firstName }} + {{ appointment.patient.lastName }} + + {{ appointment.patient.dateOfBirth | govukDate }} + + COVID-19, Flu + + {% if appointment.patient.contactDetails.mobile %} + {{ appointment.patient.contactDetails.mobile }}
+ {% endif %} + {% if appointment.patient.contactDetails.email %} + {{ appointment.patient.contactDetails.email }}
+ {% endif %} +
diff --git a/app/views/appointments/index.html b/app/views/appointments/index.html index aca59fcd..365facb5 100644 --- a/app/views/appointments/index.html +++ b/app/views/appointments/index.html @@ -9,9 +9,21 @@

{{ pageName }}

+

17 April 2026

Imported from Manage your appointments.

+ {{ pagination({ + previous: { + labelText: "Yesterday", + href: "#" + }, + next: { + labelText: "Tomorrow", + href: "#" + } + }) }} + {% set todayHtml %} {% include "appointments/_scheduled.html" %} {% endset %} @@ -20,27 +32,32 @@

{{ pageName }}

{% include "appointments/_cancelled.html" %} {% endset %} + {% set vaccinationsGivenHtml %} + {% include "appointments/_vaccinations_given.html" %} + {% endset %} + + {{ tabs({ items: [ { - label: "Scheduled", + label: "Scheduled (26)", id: "scheduled", panel: { html: todayHtml } }, { - label: "Cancelled", + label: "Cancelled (2)", id: "cancelled", panel: { html: cancelledHtml } }, { - label: "Vaccinations given", + label: "Completed (5)", id: "done", panel: { - html: "TODO" + html: vaccinationsGivenHtml } } ] diff --git a/app/views/record-vaccinations/done.html b/app/views/record-vaccinations/done.html index d29d09e4..e5d0d5f9 100644 --- a/app/views/record-vaccinations/done.html +++ b/app/views/record-vaccinations/done.html @@ -46,19 +46,28 @@ text: (lastAddedVaccination.patient.name + "’s next vaccination") }), items) %} - {% set items = (items.push({ - value: "same-vaccination-another-patient", - text: lowercaseVaccineName + " vaccination for another patient" - }), items) %} + {% if not data.appointmentId %} + {% set items = (items.push({ + value: "same-vaccination-another-patient", + text: lowercaseVaccineName + " vaccination for another patient" + }), items) %} + {% endif %} {% set items = (items.push({ divider: "or" }), items) %} - {% set items = (items.push({ - value: "different-vaccination-another-patient", - text: "A different vaccination for another patient" - }), items) %} + {% if data.appointmentId %} + {% set items = (items.push({ + value: "appointments", + text: "Back to appointments list" + }), items) %} + {% else %} + {% set items = (items.push({ + value: "different-vaccination-another-patient", + text: "A different vaccination for another patient" + }), items) %} + {% endif %} {{ radios({ idPrefix: "next-step", @@ -75,9 +84,14 @@ items: items }) }} - {{ button({ - text: "Continue" - })}} +
+ {{ button({ + text: "Continue" + })}} + +

or

+ Home +
diff --git a/app/views/record-vaccinations/index.html b/app/views/record-vaccinations/index.html index cc3c523e..7c31616f 100644 --- a/app/views/record-vaccinations/index.html +++ b/app/views/record-vaccinations/index.html @@ -67,6 +67,9 @@ ] }) }} + {# This is to make sure the right options are shown on the 'Done' page. #} + + {{ button({ text: "Continue" })}} From da959f58c4a7860aef80e44df977b5b768552af1 Mon Sep 17 00:00:00 2001 From: Frankie Roberto Date: Tue, 21 Apr 2026 16:11:14 +0100 Subject: [PATCH 08/18] Make email address usual size --- app/views/appointments/_scheduled.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/appointments/_scheduled.html b/app/views/appointments/_scheduled.html index fd2d3730..2e61aa96 100644 --- a/app/views/appointments/_scheduled.html +++ b/app/views/appointments/_scheduled.html @@ -32,7 +32,7 @@ {{ appointment.patient.contactDetails.mobile }}
{% endif %} {% if appointment.patient.contactDetails.email %} - {{ appointment.patient.contactDetails.email }}
+ {{ appointment.patient.contactDetails.email }}
{% endif %} From 672f424cc16a0358600d84081acf4f7fb77ada06 Mon Sep 17 00:00:00 2001 From: Frankie Roberto Date: Tue, 21 Apr 2026 16:37:09 +0100 Subject: [PATCH 09/18] Start refactoring --- app/routes.js | 1 + app/routes/appointments.js | 12 ++++++++++++ app/views/appointments/_cancelled.html | 2 +- app/views/appointments/_scheduled.html | 2 +- app/views/appointments/_vaccinations_given.html | 2 +- 5 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 app/routes/appointments.js diff --git a/app/routes.js b/app/routes.js index db5607e4..dd32140b 100644 --- a/app/routes.js +++ b/app/routes.js @@ -43,6 +43,7 @@ router.use('/regions{*splat}', authorise({userType: 'regional'})) router.use('/support{*splat}', authorise({userType: 'admin'})) require('./routes/apply')(router) +require('./routes/appointments')(router) require('./routes/record-vaccinations')(router) require('./routes/regions')(router) require('./routes/user-admin')(router) diff --git a/app/routes/appointments.js b/app/routes/appointments.js new file mode 100644 index 00000000..37de1b5a --- /dev/null +++ b/app/routes/appointments.js @@ -0,0 +1,12 @@ +module.exports = (router) => { + + router.get('/appointments', (req, res) => { + const data = req.session.data + + const appointments = data.appointments + + res.render('appointments/index', { + appointments + }) + }) +} diff --git a/app/views/appointments/_cancelled.html b/app/views/appointments/_cancelled.html index acfc7d1a..f23f2ac6 100644 --- a/app/views/appointments/_cancelled.html +++ b/app/views/appointments/_cancelled.html @@ -14,7 +14,7 @@ - {% for appointment in data.appointments %} + {% for appointment in appointments %} {% if appointment.cancelled %} {{ appointment.time }} am diff --git a/app/views/appointments/_scheduled.html b/app/views/appointments/_scheduled.html index 2e61aa96..90a4037c 100644 --- a/app/views/appointments/_scheduled.html +++ b/app/views/appointments/_scheduled.html @@ -13,7 +13,7 @@ - {% for appointment in data.appointments %} + {% for appointment in appointments %} {% if not appointment.cancelled %} {{ appointment.time }} am diff --git a/app/views/appointments/_vaccinations_given.html b/app/views/appointments/_vaccinations_given.html index 2920ccb1..d542ad65 100644 --- a/app/views/appointments/_vaccinations_given.html +++ b/app/views/appointments/_vaccinations_given.html @@ -11,7 +11,7 @@ - {% for appointment in data.appointments %} + {% for appointment in appointments %} {% if not appointment.cancelled %} {{ appointment.time }} am From eaa778310146c2e06233391dd4e7481b12d12a38 Mon Sep 17 00:00:00 2001 From: Frankie Roberto Date: Tue, 21 Apr 2026 21:59:14 +0100 Subject: [PATCH 10/18] Make the lists dynamic --- app/routes/appointments.js | 10 ++- app/views/appointments/_cancelled.html | 64 +++++++++---------- app/views/appointments/_scheduled.html | 54 ++++++++-------- .../appointments/_vaccinations_given.html | 51 ++++++++------- app/views/appointments/index.html | 6 +- 5 files changed, 96 insertions(+), 89 deletions(-) diff --git a/app/routes/appointments.js b/app/routes/appointments.js index 37de1b5a..d78fd772 100644 --- a/app/routes/appointments.js +++ b/app/routes/appointments.js @@ -5,8 +5,16 @@ module.exports = (router) => { const appointments = data.appointments + const scheduledAppointments = appointments.filter((appointment) => !appointment.cancelled && (appointment.vaccinationIds || []).length === 0) + + const cancelledAppointments = appointments.filter((appointment) => appointment.cancelled) + + const completedAppointments = appointments.filter((appointment) => (appointment.vaccinationIds || []).length > 0) + res.render('appointments/index', { - appointments + scheduledAppointments, + cancelledAppointments, + completedAppointments }) }) } diff --git a/app/views/appointments/_cancelled.html b/app/views/appointments/_cancelled.html index f23f2ac6..ad025cc0 100644 --- a/app/views/appointments/_cancelled.html +++ b/app/views/appointments/_cancelled.html @@ -14,40 +14,38 @@ - {% for appointment in appointments %} - {% if appointment.cancelled %} - - {{ appointment.time }} am - - {{ appointment.patient.firstName }} - {{ appointment.patient.lastName }} - - - {{ appointment.patient.dateOfBirth | govukDate }} - - - {{ appointment.vaccinations | join(", ") }} - + {% for appointment in cancelledAppointments %} + + {{ appointment.time }} am + + {{ appointment.patient.firstName }} + {{ appointment.patient.lastName }} + + + {{ appointment.patient.dateOfBirth | govukDate }} + + + {{ appointment.vaccinations | join(", ") }} + - - {% if appointment.patient.contactDetails.mobile %} - {{ appointment.patient.contactDetails.mobile }}
- {% endif %} - {% if appointment.patient.contactDetails.email %} - {{ appointment.patient.contactDetails.email }}
- {% endif %} - - - - {% endif %} + + {% if appointment.patient.contactDetails.mobile %} + {{ appointment.patient.contactDetails.mobile }}
+ {% endif %} + {% if appointment.patient.contactDetails.email %} + {{ appointment.patient.contactDetails.email }}
+ {% endif %} + + + {% endfor %} diff --git a/app/views/appointments/_scheduled.html b/app/views/appointments/_scheduled.html index 90a4037c..89d9a031 100644 --- a/app/views/appointments/_scheduled.html +++ b/app/views/appointments/_scheduled.html @@ -13,34 +13,32 @@ - {% for appointment in appointments %} - {% if not appointment.cancelled %} - - {{ appointment.time }} am - - {{ appointment.patient.firstName }} - {{ appointment.patient.lastName }} - - - {{ appointment.patient.dateOfBirth | govukDate }} - - - {{ appointment.vaccinations | join(", ") }} - - - {% if appointment.patient.contactDetails.mobile %} - {{ appointment.patient.contactDetails.mobile }}
- {% endif %} - {% if appointment.patient.contactDetails.email %} - {{ appointment.patient.contactDetails.email }}
- {% endif %} - - - Record - - - - {% endif %} + {% for appointment in scheduledAppointments %} + + {{ appointment.time }} am + + {{ appointment.patient.firstName }} + {{ appointment.patient.lastName }} + + + {{ appointment.patient.dateOfBirth | govukDate }} + + + {{ appointment.vaccinations | join(", ") }} + + + {% if appointment.patient.contactDetails.mobile %} + {{ appointment.patient.contactDetails.mobile }}
+ {% endif %} + {% if appointment.patient.contactDetails.email %} + {{ appointment.patient.contactDetails.email }}
+ {% endif %} + + + Record + + + {% endfor %} diff --git a/app/views/appointments/_vaccinations_given.html b/app/views/appointments/_vaccinations_given.html index d542ad65..cb031c45 100644 --- a/app/views/appointments/_vaccinations_given.html +++ b/app/views/appointments/_vaccinations_given.html @@ -11,31 +11,34 @@ - {% for appointment in appointments %} - {% if not appointment.cancelled %} - - {{ appointment.time }} am - - {{ appointment.patient.firstName }} - {{ appointment.patient.lastName }} - - - {{ appointment.patient.dateOfBirth | govukDate }} - - - COVID-19, Flu - - - {% if appointment.patient.contactDetails.mobile %} - {{ appointment.patient.contactDetails.mobile }}
- {% endif %} - {% if appointment.patient.contactDetails.email %} - {{ appointment.patient.contactDetails.email }}
- {% endif %} - - + {% for appointment in completedAppointments %} + + {{ appointment.time }} am + + {{ appointment.patient.firstName }} + {{ appointment.patient.lastName }} + + + {{ appointment.patient.dateOfBirth | govukDate }} + + + {% set vaccinesGiven = [] %} + {% for vaccinationId in appointment.vaccinationIds %} + {% set vaccination = data.vaccinationsRecorded | findById(vaccinationId) %} - {% endif %} + {% set vaccinesGiven = (vaccinesGiven.push(vaccination.vaccine), vaccinesGiven) %} + {% endfor %} + {{ vaccinesGiven | join(", ") | capitaliseFirstLetter }} + + + {% if appointment.patient.contactDetails.mobile %} + {{ appointment.patient.contactDetails.mobile }}
+ {% endif %} + {% if appointment.patient.contactDetails.email %} + {{ appointment.patient.contactDetails.email }}
+ {% endif %} + + {% endfor %} diff --git a/app/views/appointments/index.html b/app/views/appointments/index.html index 365facb5..a482c3de 100644 --- a/app/views/appointments/index.html +++ b/app/views/appointments/index.html @@ -40,21 +40,21 @@

17 April 2026

{{ tabs({ items: [ { - label: "Scheduled (26)", + label: "Scheduled (" + (scheduledAppointments | length) + ")", id: "scheduled", panel: { html: todayHtml } }, { - label: "Cancelled (2)", + label: "Cancelled (" + (cancelledAppointments | length) + ")", id: "cancelled", panel: { html: cancelledHtml } }, { - label: "Completed (5)", + label: "Completed (" + (completedAppointments | length) + ")", id: "done", panel: { html: vaccinationsGivenHtml From 2058ad4d41b6545f70a9953e018b35ec9c1c8b15 Mon Sep 17 00:00:00 2001 From: Frankie Roberto Date: Tue, 21 Apr 2026 22:15:58 +0100 Subject: [PATCH 11/18] Make date navigation work --- app/routes/appointments.js | 14 +++++++++++++- app/views/appointments/index.html | 20 ++++++++++++++------ 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/app/routes/appointments.js b/app/routes/appointments.js index d78fd772..d27cef6e 100644 --- a/app/routes/appointments.js +++ b/app/routes/appointments.js @@ -11,10 +11,22 @@ module.exports = (router) => { const completedAppointments = appointments.filter((appointment) => (appointment.vaccinationIds || []).length > 0) + const date = (req.query.date ? (new Date(req.query.date)) : (new Date())) + const day = 86400000 // number of milliseconds in a day + const previousDay = (new Date(date.getTime() - day)).toISOString().substring(0,10) + const nextDay = (new Date(date.getTime() + day)).toISOString().substring(0,10) + const currentDay = date.toISOString().substring(0,10) + const today = (new Date()).toISOString().substring(0,10) + + res.render('appointments/index', { scheduledAppointments, cancelledAppointments, - completedAppointments + completedAppointments, + today, + currentDay, + previousDay, + nextDay }) }) } diff --git a/app/views/appointments/index.html b/app/views/appointments/index.html index a482c3de..30c74741 100644 --- a/app/views/appointments/index.html +++ b/app/views/appointments/index.html @@ -1,6 +1,14 @@ {% extends 'layout.html' %} -{% set pageName = "Today’s appointments" %} +{% if currentDay == today %} + {% set pageName = "Today’s appointments" %} +{% elif nextDay == today %} + {% set pageName = "Yesterday’s appointments" %} +{% elif previousDay == today %} + {% set pageName = "Tomorrow’s appointments" %} +{% else %} + {% set pageName = "Appointments" %} +{% endif %} {% set currentSection = "appointments" %} @@ -9,18 +17,18 @@

{{ pageName }}

-

17 April 2026

+

{{ currentDay | formatDate }}

Imported from Manage your appointments.

{{ pagination({ previous: { - labelText: "Yesterday", - href: "#" + labelText: ("Yesterday" if currentDay == today else (previousDay | formatDate)), + href: "/appointments?date=" + previousDay }, next: { - labelText: "Tomorrow", - href: "#" + labelText: ("Tomorrow" if currentDay == today else (nextDay | formatDate)), + href: "/appointments?date=" + nextDay } }) }} From 5238446e064999574923b036fbae0d12c673432e Mon Sep 17 00:00:00 2001 From: Frankie Roberto Date: Tue, 21 Apr 2026 22:29:16 +0100 Subject: [PATCH 12/18] Show appointments yesterday and tomorrow --- app/data/appointments.js | 44 ++++++++++++++++++++++++++ app/routes/appointments.js | 26 ++++++++++----- app/views/appointments/_scheduled.html | 4 ++- 3 files changed, 65 insertions(+), 9 deletions(-) diff --git a/app/data/appointments.js b/app/data/appointments.js index 6fcef77a..58c791d1 100644 --- a/app/data/appointments.js +++ b/app/data/appointments.js @@ -3,6 +3,7 @@ module.exports = [ { id: "163473464363", + date: "today", time: "10:00", patient: { nhsNumber: "9123123123", @@ -21,6 +22,7 @@ module.exports = [ }, { id: "923532535", + date: "today", time: "10:30", patient: { nhsNumber: "9841414141", @@ -38,6 +40,7 @@ module.exports = [ }, { id: "2364364369", + date: "today", time: "10:40", patient: { nhsNumber: "9841515715", @@ -54,6 +57,7 @@ module.exports = [ }, { id: "3026352592", + date: "today", time: "11:10", cancelled: { reason: "patient" @@ -73,6 +77,7 @@ module.exports = [ }, { id: "410059235", + date: "today", time: "11:20", patient: { nhsNumber: "9847471413", @@ -89,6 +94,7 @@ module.exports = [ }, { id: "5019581446", + date: "today", time: "11:30", patient: { nhsNumber: "9841411411", @@ -105,6 +111,7 @@ module.exports = [ }, { id: "69263464", + date: "today", time: "11:40", patient: { nhsNumber: "9841411411", @@ -122,6 +129,7 @@ module.exports = [ }, { id: "7692855825", + date: "today", time: "11:50", patient: { nhsNumber: "9917425141", @@ -139,6 +147,7 @@ module.exports = [ }, { id: "8928558275", + date: "today", time: "12:10", cancelled: { reason: "organisation" @@ -158,6 +167,7 @@ module.exports = [ }, { id: "9255253581", + date: "today", time: "12:40", cancelled: { reason: "auto" @@ -174,5 +184,39 @@ module.exports = [ vaccinations: [ "Flu" ] + }, + { + id: "634633242", + date: "yesterday", + time: "11:20", + patient: { + nhsNumber: "9918571751", + firstName: "Danny", + lastName: "Green", + dateOfBirth: "1998-03-19", + contactDetails: { + email: "dgreen@gmail.com" + } + }, + vaccinations: [ + "Flu" + ] + }, + { + id: "64639185885", + date: "tomorrow", + time: "11:20", + patient: { + nhsNumber: "9017474141", + firstName: "Mohammed", + lastName: "Khan", + dateOfBirth: "1993-01-23", + contactDetails: { + email: "mk25325@gmail.com" + } + }, + vaccinations: [ + "Flu" + ] } ] diff --git a/app/routes/appointments.js b/app/routes/appointments.js index d27cef6e..b5cda826 100644 --- a/app/routes/appointments.js +++ b/app/routes/appointments.js @@ -3,14 +3,6 @@ module.exports = (router) => { router.get('/appointments', (req, res) => { const data = req.session.data - const appointments = data.appointments - - const scheduledAppointments = appointments.filter((appointment) => !appointment.cancelled && (appointment.vaccinationIds || []).length === 0) - - const cancelledAppointments = appointments.filter((appointment) => appointment.cancelled) - - const completedAppointments = appointments.filter((appointment) => (appointment.vaccinationIds || []).length > 0) - const date = (req.query.date ? (new Date(req.query.date)) : (new Date())) const day = 86400000 // number of milliseconds in a day const previousDay = (new Date(date.getTime() - day)).toISOString().substring(0,10) @@ -18,6 +10,24 @@ module.exports = (router) => { const currentDay = date.toISOString().substring(0,10) const today = (new Date()).toISOString().substring(0,10) + let appointments = data.appointments + + if (currentDay === today) { + appointments = appointments.filter((appointment) => appointment.date === "today" || appointment.date === today) + } else if (nextDay === today) { + appointments = appointments.filter((appointment) => appointment.date === "yesterday" || appointment.date === today) + } else if (previousDay === today) { + appointments = appointments.filter((appointment) => appointment.date === "tomorrow" || appointment.date === today) + } else { + appointments = appointments.filter((appointment) => appointment.date === today) + } + + const scheduledAppointments = appointments.filter((appointment) => !appointment.cancelled && (appointment.vaccinationIds || []).length === 0) + + const cancelledAppointments = appointments.filter((appointment) => appointment.cancelled) + + const completedAppointments = appointments.filter((appointment) => (appointment.vaccinationIds || []).length > 0) + res.render('appointments/index', { scheduledAppointments, diff --git a/app/views/appointments/_scheduled.html b/app/views/appointments/_scheduled.html index 89d9a031..54c7a351 100644 --- a/app/views/appointments/_scheduled.html +++ b/app/views/appointments/_scheduled.html @@ -36,7 +36,9 @@ Record - + {% if currentDay >= today %} + + {% endif %} {% endfor %} From 5f7ef5a95661f4a8733f6871a1cc69976ceb20fe Mon Sep 17 00:00:00 2001 From: Frankie Roberto Date: Wed, 22 Apr 2026 09:25:54 +0100 Subject: [PATCH 13/18] Add a completed vaccination for yesterday --- app/data/appointments.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/data/appointments.js b/app/data/appointments.js index 58c791d1..c0181f22 100644 --- a/app/data/appointments.js +++ b/app/data/appointments.js @@ -202,6 +202,24 @@ module.exports = [ "Flu" ] }, + { + id: "10363212525", + date: "yesterday", + time: "13:20", + patient: { + nhsNumber: "99472754141", + firstName: "Jason", + lastName: "Black", + dateOfBirth: "1967-09-21", + contactDetails: { + email: "jblack@hotmail.com" + } + }, + vaccinations: [ + "Flu" + ], + vaccinationIds: ["464743636"] + }, { id: "64639185885", date: "tomorrow", From 2c25da19d733e1e9cf9074b2d5c81ebb44adc83e Mon Sep 17 00:00:00 2001 From: Frankie Roberto Date: Wed, 22 Apr 2026 09:53:28 +0100 Subject: [PATCH 14/18] Removed Completed appointments for future dates --- app/views/appointments/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/appointments/index.html b/app/views/appointments/index.html index 30c74741..8d80971f 100644 --- a/app/views/appointments/index.html +++ b/app/views/appointments/index.html @@ -67,7 +67,7 @@

{{ currentDay | formatDate }}

panel: { html: vaccinationsGivenHtml } - } + } if currentDay <= today ] }) }} From 9fc33f9953c162b9ac6ca87c0572ddc3d3ed041d Mon Sep 17 00:00:00 2001 From: Frankie Roberto Date: Wed, 22 Apr 2026 21:57:34 +0100 Subject: [PATCH 15/18] A bunch of fixes --- app/data/session-data-defaults.js | 4 +-- app/data/users.js | 4 +-- app/data/vaccine-stock.js | 28 +++++++++++++++++++++ app/routes/record-vaccinations.js | 31 ++++++++++++++++++++++++ app/views/appointments/_scheduled.html | 2 +- app/views/appointments/index.html | 16 ++++++------ app/views/auth/okta-sign-in.html | 1 + app/views/record-vaccinations/check.html | 3 ++- 8 files changed, 75 insertions(+), 14 deletions(-) diff --git a/app/data/session-data-defaults.js b/app/data/session-data-defaults.js index cb2120a0..f1595a28 100644 --- a/app/data/session-data-defaults.js +++ b/app/data/session-data-defaults.js @@ -17,8 +17,8 @@ module.exports = { appointments: appointments, lists: [], nhsNumberKnown: "yes", - currentUserId: "2387441662601", - currentOrganisationId: "RW3", + currentUserId: "46436346", // Jeremy Blue + currentOrganisationId: "FA424", // Pickfords Pharmacy vaccinationsRecorded: vaccinationsRecorded, // These are the options for extracting CSV reports diff --git a/app/data/users.js b/app/data/users.js index f3b4d98c..fd68212d 100644 --- a/app/data/users.js +++ b/app/data/users.js @@ -116,14 +116,14 @@ module.exports = [ "firstName": "Paulina", "lastName": "Sloan" }, - // Each pharmacy in Paulina Sloan’s chain has its own vaccinator + // Each pharmacy in Paulina Sloan’s chain has its own vaccinator, some of who are also admins { "id": "46436346", "email": "jeremy.blue@nhs.net", "organisations": [ { "id": "FA424", - "permissionLevel": "Recorder", + "permissionLevel": "Lead administrator", "status": "Active", "vaccinator": true } diff --git a/app/data/vaccine-stock.js b/app/data/vaccine-stock.js index 32927538..f703deed 100644 --- a/app/data/vaccine-stock.js +++ b/app/data/vaccine-stock.js @@ -409,6 +409,34 @@ module.exports = [ } ] }, + { + id: "7436323", + vaccine: "Flu", + vaccineProduct: "Adjuvanted Trivalent Influenza Vaccine (aTIV)", + organisationId: "FA424", // Pickfords Pharmacy + siteId: "FA424X", // Pickfords Pharmacy + batches: [ + { + id: "464735235325", + batchNumber: "714-14", + expiryDate: "2026-12-14" + } + ] + }, + { + id: "9235235325", + vaccine: "COVID-19", + vaccineProduct: "Comirnaty 3 LP.8.1", + organisationId: "FA424", // Pickfords Pharmacy + siteId: "FA424X", // Pickfords Pharmacy + batches: [ + { + id: "82725252", + batchNumber: "AB-255", + expiryDate: "2027-01-22" + } + ] + }, { id: "2514771", vaccine: "flu (London service)", diff --git a/app/routes/record-vaccinations.js b/app/routes/record-vaccinations.js index ccd8c337..83187211 100644 --- a/app/routes/record-vaccinations.js +++ b/app/routes/record-vaccinations.js @@ -53,12 +53,33 @@ module.exports = router => { }) }) + router.get('/record-vaccinations/vaccination-date', (req, res) => { + + const data = req.session.data + const appointmentId = data.appointmentId + + if (appointmentId) { + const appointment = data.appointments.find((appointment) => appointment.id === appointmentId) + + if (appointment.date === "today") { + // Set vaccination date to today and skip question + req.session.data.vaccinationToday = "yes" + return res.redirect('/record-vaccinations/delivery-team') + + } + } + + res.render('record-vaccinations/vaccination-date') + }) + router.post('/record-vaccinations/answer-date', (req, res) => { const data = req.session.data if (!data.vaccinationToday) { return res.redirect('/record-vaccinations/?showErrors=yes') } + + res.redirect('/record-vaccinations/delivery-team') }) @@ -72,6 +93,12 @@ module.exports = router => { const sitesInUse = currentOrganisation.sites.filter((site) => siteIdsWithVaccines.includes(site.id)) + // If there’s only 1 site set up (eg a pharmacy), then + // set that and skip this question. + if (sitesInUse.length === 1) { + data.siteId = sitesInUse[0].id + return res.redirect('/record-vaccinations/vaccinator') + } if (req.query.showErrors === "yes") { if (!req.session.data.siteId) { @@ -617,6 +644,7 @@ module.exports = router => { const yearToday = (dateToday.getFullYear()) if (data.vaccinationToday === 'yes') { + data.vaccinationDate = {} data.vaccinationDate.day = String(dayToday) data.vaccinationDate.month = String(monthToday) data.vaccinationDate.year = String(yearToday) @@ -742,6 +770,7 @@ module.exports = router => { data.consentAdvocateName = "" data.consentDeputyName = "" data.doseAmount = "" + data.appointmentId = "" } if (answer === 'same-vaccination-another-patient') { @@ -790,6 +819,8 @@ module.exports = router => { req.session.data.nhsNumber = "" req.session.data.healthcareWorker = "" req.session.data.vaccineDose = "" + req.session.data.vaccinationToday = "" + req.session.data.vaccinatorId = "" res.redirect('/appointments') diff --git a/app/views/appointments/_scheduled.html b/app/views/appointments/_scheduled.html index 54c7a351..f7400858 100644 --- a/app/views/appointments/_scheduled.html +++ b/app/views/appointments/_scheduled.html @@ -24,7 +24,7 @@ {{ appointment.patient.dateOfBirth | govukDate }} - {{ appointment.vaccinations | join(", ") }} + {{ appointment.vaccinations | join("
") | safe }} {% if appointment.patient.contactDetails.mobile %} diff --git a/app/views/appointments/index.html b/app/views/appointments/index.html index 8d80971f..09fedb8c 100644 --- a/app/views/appointments/index.html +++ b/app/views/appointments/index.html @@ -54,20 +54,20 @@

{{ currentDay | formatDate }}

html: todayHtml } }, - { - label: "Cancelled (" + (cancelledAppointments | length) + ")", - id: "cancelled", - panel: { - html: cancelledHtml - } - }, { label: "Completed (" + (completedAppointments | length) + ")", id: "done", panel: { html: vaccinationsGivenHtml } - } if currentDay <= today + } if currentDay <= today, + { + label: "Cancelled (" + (cancelledAppointments | length) + ")", + id: "cancelled", + panel: { + html: cancelledHtml + } + } ] }) }} diff --git a/app/views/auth/okta-sign-in.html b/app/views/auth/okta-sign-in.html index 0b913e3a..482f9eda 100644 --- a/app/views/auth/okta-sign-in.html +++ b/app/views/auth/okta-sign-in.html @@ -35,6 +35,7 @@

Testing area

  • Lead admin for an NHS trust (multiple sites set up)
  • Lead admin for an NHS trust (no vaccines set up)
  • +
  • Lead admin for a single pharmacy
  • Recorder for an NHS trust
  • Recorder for multiple NHS trusts
  • Admin at 2 NHS trusts
  • diff --git a/app/views/record-vaccinations/check.html b/app/views/record-vaccinations/check.html index ed543663..6806f10e 100644 --- a/app/views/record-vaccinations/check.html +++ b/app/views/record-vaccinations/check.html @@ -61,6 +61,7 @@

    Check and confirm

    Patient

    + {{ summaryList({ rows: [ { @@ -85,7 +86,7 @@

    Patient

    text: "Date of birth" }, value: { - html: (data.dateOfBirth | isoDateFromDateInput | govukDate) + "
    (76 years old)" + html: (data.dateOfBirth | formatDate) + "
    (76 years old)" }, actions: { items: [ From 08e5153361500f6293770d2cfa311e71c0ad43de Mon Sep 17 00:00:00 2001 From: Frankie Roberto Date: Wed, 22 Apr 2026 22:33:19 +0100 Subject: [PATCH 16/18] =?UTF-8?q?Allow=20you=20to=20set=20today=E2=80=99s?= =?UTF-8?q?=20vaccinators?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/routes/appointments.js | 38 ++++++++++++++- app/routes/record-vaccinations.js | 8 ++++ app/views/appointments/index.html | 46 +++++++++++++++++- app/views/appointments/vaccinators.html | 62 +++++++++++++++++++++++++ 4 files changed, 152 insertions(+), 2 deletions(-) create mode 100644 app/views/appointments/vaccinators.html diff --git a/app/routes/appointments.js b/app/routes/appointments.js index b5cda826..9d045770 100644 --- a/app/routes/appointments.js +++ b/app/routes/appointments.js @@ -28,6 +28,12 @@ module.exports = (router) => { const completedAppointments = appointments.filter((appointment) => (appointment.vaccinationIds || []).length > 0) + let vaccinators = [] + + if (data.vaccinatorIds) { + vaccinators = data.users.filter((user) => data.vaccinatorIds.includes(user.id)) + } + res.render('appointments/index', { scheduledAppointments, @@ -36,7 +42,37 @@ module.exports = (router) => { today, currentDay, previousDay, - nextDay + nextDay, + vaccinators }) }) + + + router.get('/appointments/vaccinators', (req, res) => { + const data = req.session.data + + let otherVaccinators = data.users + .filter((user) => { + const userOrgnisationSetting = (user.organisations || []).find((organisation) => organisation.id === data.currentOrganisationId) + + return (user.id != data.currentUserId) && userOrgnisationSetting && userOrgnisationSetting.vaccinator && (userOrgnisationSetting.status === "Active") + }) + .sort((a, b) => { + const nameA = a.firstName.toUpperCase(); // ignore upper and lowercase + const nameB = b.firstName.toUpperCase(); // ignore upper and lowercase + if (nameA < nameB) { + return -1; + } + if (nameA > nameB) { + return 1; + } + return 0; + }) + + res.render('appointments/vaccinators', { + otherVaccinators + }) + + }) } + diff --git a/app/routes/record-vaccinations.js b/app/routes/record-vaccinations.js index 9721b8cf..a63938e4 100644 --- a/app/routes/record-vaccinations.js +++ b/app/routes/record-vaccinations.js @@ -154,6 +154,14 @@ module.exports = router => { } } + // If we’re recording a vaccination from today’s appointments, and there’s + // only 1 vaccinator set as present, then set them as the vaccinator + // and skip the question. + if (data.appointmentId && Array.isArray(data.vaccinatorIds) && data.vaccinatorIds.length == 1) { + req.session.data.vaccinatorId = data.vaccinatorIds[0] + return res.redirect('/record-vaccinations/vaccine') + } + res.render('record-vaccinations/vaccinator', { vaccinatorError, otherVaccinators diff --git a/app/views/appointments/index.html b/app/views/appointments/index.html index 09fedb8c..c85de387 100644 --- a/app/views/appointments/index.html +++ b/app/views/appointments/index.html @@ -14,13 +14,57 @@ {% block content %}
    -
    +

    {{ pageName }}

    {{ currentDay | formatDate }}

    Imported from Manage your appointments.

    + {% if currentDay == today %} + + {% set vaccinatorHtml %} + {% if (vaccinators | length) > 1 %} +
      + {% for vaccinator in vaccinators %} +
    • {{ vaccinator.firstName }} {{ vaccinator.lastName }}
    • + {% endfor %} +
    + {% elif (vaccinators | length) == 1 %} + {{ (vaccinators | first).firstName }} {{ (vaccinators | first).lastName }} + {% else %} + Set today’s vaccinator + {% endif %} + {% endset %} + + {{ summaryList({ + rows: [ + { + key: { + text: ("Vaccinators" if (vaccinators | length) > 1 else "Vaccinator") + }, + value: { + html: vaccinatorHtml + }, + actions: { + items: [ + { + href: "/appointments/vaccinators", + text: "Change", + visuallyHiddenText: "vaccinator" + } + ] + } if data.vaccinatorIds + } + ] + }) }} + {% endif %} + +
    +
    +
    +
    + {{ pagination({ previous: { labelText: ("Yesterday" if currentDay == today else (previousDay | formatDate)), diff --git a/app/views/appointments/vaccinators.html b/app/views/appointments/vaccinators.html new file mode 100644 index 00000000..04a50559 --- /dev/null +++ b/app/views/appointments/vaccinators.html @@ -0,0 +1,62 @@ +{% extends 'layout.html' %} + +{% set currentSection = "appointments" %} +{% set pageName = "Who is vaccinating today?" %} +{% set organisationSetting = currentUser.organisations | findById(data.currentOrganisationId) %} + +{% block beforeContent %} + {{ backLink({ + href: "/appointments", + text: "Back" + }) }} +{% endblock%} + +{% block content %} +
    +
    + +
    + + {% set items = [] %} + + {% if organisationSetting.vaccinator %} + {% set items = (items.push({ + value: data.currentUserId, + text: "Me (" + currentUser.firstName + " " + currentUser.lastName + ")" + }), items) %} + {% endif %} + + {% for user in otherVaccinators %} + {% set items = (items.push({ + value: user.id, + text: user.firstName + " " + user.lastName + " (" + user.email + ")" + }), items) %} + {% endfor %} + + {{ checkboxes({ + idPrefix: "vaccinator", + name: "vaccinatorIds", + fieldset: { + legend: { + text: pageName, + size: "l", + isPageHeading: "true" + } + }, + hint: { + text: "Setting this lets you save time when recording today’s vaccinations." + }, + items: items, + values: data.vaccinatorIds + }) }} + + {{ button({ + text: "Continue" + })}} +
    + +
    +
    + + +{% endblock %} From 57b7cda62b1fb1de8230405e21ee80cd19e88057 Mon Sep 17 00:00:00 2001 From: Frankie Roberto Date: Thu, 30 Apr 2026 14:00:05 +0100 Subject: [PATCH 17/18] Add date of birth? --- app/views/appointments/_scheduled.html | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/appointments/_scheduled.html b/app/views/appointments/_scheduled.html index f7400858..93e41663 100644 --- a/app/views/appointments/_scheduled.html +++ b/app/views/appointments/_scheduled.html @@ -22,6 +22,7 @@ {{ appointment.patient.dateOfBirth | govukDate }} +
    {{ appointment.patient.dateOfBirth | age }} old
    {{ appointment.vaccinations | join("
    ") | safe }} From 8e763a7048a1b6f2196806de707e68b8b0f5cb36 Mon Sep 17 00:00:00 2001 From: Caitlin Roach Date: Thu, 7 May 2026 16:58:24 +0100 Subject: [PATCH 18/18] Changes from 07 May conversation for MVP research Changes include: - Remove batch and vaccinator selection - Add nhs number in tables - add day of week alongside date - remove cancel option - Add cancellation reason - Add same vaccs, diff patient option when coming from appt - Only show yesterday, today and tomorrow and no actions on yest./tom. - change complete table to match columns from scheduled (except actions) -Time format fix --- app/filters.js | 5 +- app/routes/appointments.js | 46 +++++++----------- app/routes/record-vaccinations.js | 4 +- app/views/appointments/_cancelled.html | 10 ++-- app/views/appointments/_scheduled.html | 22 +++++---- .../appointments/_vaccinations_given.html | 15 ++---- app/views/appointments/index.html | 48 +++---------------- app/views/record-vaccinations/done.html | 10 ++-- 8 files changed, 57 insertions(+), 103 deletions(-) diff --git a/app/filters.js b/app/filters.js index ce8b19fc..dd43b8b3 100644 --- a/app/filters.js +++ b/app/filters.js @@ -18,9 +18,10 @@ module.exports = function () { filters.findById = findById - filters.dayName = function(isoDate) { + filters.dayName = function(isoDate, style = 'short') { const date = new Date(Date.parse(isoDate)) - const dateFormatter = new Intl.DateTimeFormat('en-GB', {weekday: 'short'}); + const weekdayStyle = (style === 'long') ? 'long' : 'short' + const dateFormatter = new Intl.DateTimeFormat('en-GB', {weekday: weekdayStyle}); return dateFormatter.format(date) } diff --git a/app/routes/appointments.js b/app/routes/appointments.js index 9d045770..d7b9d129 100644 --- a/app/routes/appointments.js +++ b/app/routes/appointments.js @@ -3,12 +3,23 @@ module.exports = (router) => { router.get('/appointments', (req, res) => { const data = req.session.data - const date = (req.query.date ? (new Date(req.query.date)) : (new Date())) const day = 86400000 // number of milliseconds in a day - const previousDay = (new Date(date.getTime() - day)).toISOString().substring(0,10) - const nextDay = (new Date(date.getTime() + day)).toISOString().substring(0,10) - const currentDay = date.toISOString().substring(0,10) const today = (new Date()).toISOString().substring(0,10) + const yesterday = (new Date(Date.now() - day)).toISOString().substring(0,10) + const tomorrow = (new Date(Date.now() + day)).toISOString().substring(0,10) + const requestedDay = req.query.date + const allowedDays = [yesterday, today, tomorrow] + + if (requestedDay && !allowedDays.includes(requestedDay)) { + return res.redirect('/appointments') + } + + const currentDay = requestedDay || today + const currentDate = new Date(currentDay) + const previousDay = (new Date(currentDate.getTime() - day)).toISOString().substring(0,10) + const nextDay = (new Date(currentDate.getTime() + day)).toISOString().substring(0,10) + const isYesterday = currentDay === yesterday + const isTomorrow = currentDay === tomorrow let appointments = data.appointments @@ -43,36 +54,15 @@ module.exports = (router) => { currentDay, previousDay, nextDay, + isYesterday, + isTomorrow, vaccinators }) }) router.get('/appointments/vaccinators', (req, res) => { - const data = req.session.data - - let otherVaccinators = data.users - .filter((user) => { - const userOrgnisationSetting = (user.organisations || []).find((organisation) => organisation.id === data.currentOrganisationId) - - return (user.id != data.currentUserId) && userOrgnisationSetting && userOrgnisationSetting.vaccinator && (userOrgnisationSetting.status === "Active") - }) - .sort((a, b) => { - const nameA = a.firstName.toUpperCase(); // ignore upper and lowercase - const nameB = b.firstName.toUpperCase(); // ignore upper and lowercase - if (nameA < nameB) { - return -1; - } - if (nameA > nameB) { - return 1; - } - return 0; - }) - - res.render('appointments/vaccinators', { - otherVaccinators - }) - + res.redirect('/appointments') }) } diff --git a/app/routes/record-vaccinations.js b/app/routes/record-vaccinations.js index a63938e4..b253cb03 100644 --- a/app/routes/record-vaccinations.js +++ b/app/routes/record-vaccinations.js @@ -759,10 +759,10 @@ module.exports = router => { data.consentAdvocateName = "" data.consentDeputyName = "" data.doseAmount = "" - data.appointmentId = "" } if (answer === 'same-vaccination-another-patient') { + data.appointmentId = "" req.session.data.firstName = "" req.session.data.lastName = "" @@ -788,6 +788,7 @@ module.exports = router => { res.redirect('/record-vaccinations/patient-history?repeatPatient=yes&repeatVaccination=no') } else if (answer === 'different-vaccination-another-patient') { + data.appointmentId = "" req.session.data.vaccine = "" req.session.data.vaccineProduct = "" @@ -800,6 +801,7 @@ module.exports = router => { res.redirect('/record-vaccinations/?repeatPatient=no&repeatVaccination=no') } else if (answer === 'appointments') { + data.appointmentId = "" req.session.data.vaccine = "" req.session.data.vaccineProduct = "" diff --git a/app/views/appointments/_cancelled.html b/app/views/appointments/_cancelled.html index ad025cc0..65abf7a7 100644 --- a/app/views/appointments/_cancelled.html +++ b/app/views/appointments/_cancelled.html @@ -2,11 +2,12 @@ Time - Name + Name and NHS number Date of birth Vaccines Contact details + Cancellation reason @@ -16,10 +17,11 @@ {% for appointment in cancelledAppointments %} - {{ appointment.time }} am + {{ appointment.time }}am {{ appointment.patient.firstName }} {{ appointment.patient.lastName }} +
    {{ appointment.patient.nhsNumber }}
    {{ appointment.patient.dateOfBirth | govukDate }} @@ -36,7 +38,7 @@ {{ appointment.patient.contactDetails.email }}
    {% endif %} - + {% endfor %} diff --git a/app/views/appointments/_scheduled.html b/app/views/appointments/_scheduled.html index 93e41663..8b8317d3 100644 --- a/app/views/appointments/_scheduled.html +++ b/app/views/appointments/_scheduled.html @@ -2,12 +2,14 @@ Time - Name + Name and NHS number Date of birth - Vaccines + Vaccines booked Contact details - Action + {% if currentDay == today %} + Action + {% endif %} @@ -15,10 +17,11 @@ {% for appointment in scheduledAppointments %} - {{ appointment.time }} am + {{ appointment.time }}am {{ appointment.patient.firstName }} {{ appointment.patient.lastName }} +
    {{ appointment.patient.nhsNumber }}
    {{ appointment.patient.dateOfBirth | govukDate }} @@ -35,12 +38,11 @@ {{ appointment.patient.contactDetails.email }}
    {% endif %} - - Record - {% if currentDay >= today %} - - {% endif %} - + {% if currentDay == today %} + + Record + + {% endif %} {% endfor %} diff --git a/app/views/appointments/_vaccinations_given.html b/app/views/appointments/_vaccinations_given.html index cb031c45..5df2278a 100644 --- a/app/views/appointments/_vaccinations_given.html +++ b/app/views/appointments/_vaccinations_given.html @@ -2,9 +2,9 @@ Time - Name + Name and NHS number Date of birth - Vaccines given + Vaccines booked Contact details @@ -13,22 +13,17 @@ {% for appointment in completedAppointments %} - {{ appointment.time }} am + {{ appointment.time }}am {{ appointment.patient.firstName }} {{ appointment.patient.lastName }} +
    {{ appointment.patient.nhsNumber }}
    {{ appointment.patient.dateOfBirth | govukDate }} - {% set vaccinesGiven = [] %} - {% for vaccinationId in appointment.vaccinationIds %} - {% set vaccination = data.vaccinationsRecorded | findById(vaccinationId) %} - - {% set vaccinesGiven = (vaccinesGiven.push(vaccination.vaccine), vaccinesGiven) %} - {% endfor %} - {{ vaccinesGiven | join(", ") | capitaliseFirstLetter }} + {{ appointment.vaccinations | join("
    ") | safe }} {% if appointment.patient.contactDetails.mobile %} diff --git a/app/views/appointments/index.html b/app/views/appointments/index.html index c85de387..1d33883d 100644 --- a/app/views/appointments/index.html +++ b/app/views/appointments/index.html @@ -17,48 +17,12 @@

    {{ pageName }}

    + {{ currentDay | dayName('long') }}

    {{ currentDay | formatDate }}

    + + -

    Imported from Manage your appointments.

    - - {% if currentDay == today %} - - {% set vaccinatorHtml %} - {% if (vaccinators | length) > 1 %} -
      - {% for vaccinator in vaccinators %} -
    • {{ vaccinator.firstName }} {{ vaccinator.lastName }}
    • - {% endfor %} -
    - {% elif (vaccinators | length) == 1 %} - {{ (vaccinators | first).firstName }} {{ (vaccinators | first).lastName }} - {% else %} - Set today’s vaccinator - {% endif %} - {% endset %} - - {{ summaryList({ - rows: [ - { - key: { - text: ("Vaccinators" if (vaccinators | length) > 1 else "Vaccinator") - }, - value: { - html: vaccinatorHtml - }, - actions: { - items: [ - { - href: "/appointments/vaccinators", - text: "Change", - visuallyHiddenText: "vaccinator" - } - ] - } if data.vaccinatorIds - } - ] - }) }} - {% endif %} +

    Imported from Manage your appointments

    @@ -69,11 +33,11 @@

    {{ currentDay | formatDate }}

    previous: { labelText: ("Yesterday" if currentDay == today else (previousDay | formatDate)), href: "/appointments?date=" + previousDay - }, + } if not isYesterday, next: { labelText: ("Tomorrow" if currentDay == today else (nextDay | formatDate)), href: "/appointments?date=" + nextDay - } + } if not isTomorrow }) }} {% set todayHtml %} diff --git a/app/views/record-vaccinations/done.html b/app/views/record-vaccinations/done.html index e5d0d5f9..0c33a600 100644 --- a/app/views/record-vaccinations/done.html +++ b/app/views/record-vaccinations/done.html @@ -46,12 +46,10 @@ text: (lastAddedVaccination.patient.name + "’s next vaccination") }), items) %} - {% if not data.appointmentId %} - {% set items = (items.push({ - value: "same-vaccination-another-patient", - text: lowercaseVaccineName + " vaccination for another patient" - }), items) %} - {% endif %} + {% set items = (items.push({ + value: "same-vaccination-another-patient", + text: lowercaseVaccineName + " vaccination for another patient" + }), items) %} {% set items = (items.push({ divider: "or"