Skip to content

Commit 42cce61

Browse files
Add initial MVP appointments section (#279)
This is the version as tested with users in May-June 2025. The core concept is to allow users to add booked appointments semi-manually by adding a list of patient NHS numbers for a given day at a given location. (We also considered a CSV/Excel upload but decided to strip it back initially). In future the import of appointments would hopefully be more automatic. ## Screenshots ### Appointments section ![record-a-vac-appointmen-xqyx8a herokuapp com_appointments_index2](https://github.com/user-attachments/assets/c56fab21-3bf2-496d-8839-67e51709a665) ### Select date ![record-a-vac-appointmen-xqyx8a herokuapp com_appointments_add](https://github.com/user-attachments/assets/b637c8b0-6915-4c64-a7d8-d9e593ac3dab) ### Select site or team ![record-a-vac-appointmen-xqyx8a herokuapp com_appointments_team](https://github.com/user-attachments/assets/e02a3876-ba7a-4a39-b283-566e64d955f7) ### Add patient NHS numbers ![record-a-vac-appointmen-xqyx8a herokuapp com_appointments_add-nhs-numbers](https://github.com/user-attachments/assets/34c421f7-c548-4b4a-8864-3dfdb5818561) ### Check your appointments ![record-a-vac-appointmen-xqyx8a herokuapp com_appointments_check1](https://github.com/user-attachments/assets/0b7b3bed-c18a-4e2a-93dc-abd53a6e48af) ### Calendar view for a site ![record-a-vac-appointmen-xqyx8a herokuapp com_appointments_index3](https://github.com/user-attachments/assets/0d84ba7a-8c09-4089-a79f-ea8c60cc57ab) ### Appointments list ![record-a-vac-appointmen-xqyx8a herokuapp com_appointments_mvp1](https://github.com/user-attachments/assets/c14b56c6-12fd-477d-a3a5-1698465274cc) ### Recording a vaccination from appointments - done page ![record-a-vac-appointmen-xqyx8a herokuapp com_appointments_appointments-recording_done](https://github.com/user-attachments/assets/81dae5d1-ab6d-4a95-9787-06620565a836) --------- Co-authored-by: johnrimmer2 <[email protected]>
1 parent b4857f4 commit 42cce61

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+6484
-4
lines changed

app/data/appointments.js

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
module.exports = [
2+
{
3+
id: "1234567",
4+
time: "8:30",
5+
patient: {
6+
firstName: "John",
7+
lastName: "Smith",
8+
nhsNumber: "9123456789",
9+
dateOfBirth: "1954-11-04",
10+
phoneNumber: "07712345678",
11+
12+
},
13+
vaccines: ["RSV"]
14+
},
15+
{
16+
id: "1234568",
17+
time: "8:35",
18+
patient: {
19+
firstName: "Martin",
20+
lastName: "Lincoln",
21+
nhsNumber: "91231231231",
22+
dateOfBirth: "1958-06-07",
23+
phoneNumber: null,
24+
25+
},
26+
vaccines: ["RSV"]
27+
},
28+
{
29+
id: "1234569",
30+
time: "8:45",
31+
patient: {
32+
firstName: "Mike",
33+
lastName: "Jones",
34+
nhsNumber: "98767655431",
35+
dateOfBirth: "1958-06-07",
36+
phoneNumber: null,
37+
38+
},
39+
vaccines: ["RSV"]
40+
},
41+
{
42+
id: "1234570",
43+
time: "8:50",
44+
patient: {
45+
firstName: "Clive",
46+
lastName: "Lochan",
47+
nhsNumber: "98767655431",
48+
dateOfBirth: "1971-09-12",
49+
phoneNumber: null,
50+
51+
},
52+
vaccines: ["RSV"]
53+
},
54+
{
55+
id: "1234568",
56+
time: "8:35",
57+
patient: {
58+
firstName: "Thomas",
59+
lastName: "Smith",
60+
nhsNumber: "91231789548",
61+
dateOfBirth: "2000-06-09",
62+
phoneNumber: null,
63+
64+
},
65+
vaccines: ["RSV"]
66+
},
67+
{
68+
id: "1234568",
69+
time: "8:35",
70+
patient: {
71+
firstName: "Anakin",
72+
lastName: "William",
73+
nhsNumber: "91231234445",
74+
dateOfBirth: "1983-07-13",
75+
phoneNumber: null,
76+
77+
},
78+
vaccines: ["RSV"]
79+
},
80+
{
81+
id: "1234571",
82+
time: "9:05",
83+
patient: {
84+
firstName: "Norma",
85+
lastName: "Davies",
86+
nhsNumber: "9875362842",
87+
dateOfBirth: "1976-05-23",
88+
phoneNumber: "07712345678",
89+
90+
},
91+
vaccines: ["RSV"]
92+
}
93+
94+
]

app/data/session-data-defaults.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ const organisations = require('./organisations')
22
const regions = require('./regions')
33
const featureFlags = require('./feature-flags')
44
const users = require('./users')
5+
const appointments = require('./appointments')
56
const vaccines = require('./vaccines')
67

78
module.exports = {
89
organisations: organisations,
910
regions: regions,
1011
featureFlags: featureFlags,
12+
appointments: appointments,
1113
users: users,
1214
vaccines: vaccines,
1315
vaccineStock: [],

app/routes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ require('./routes/vaccines')(router)
1313
require('./routes/reports')(router)
1414
require('./routes/find-record')(router)
1515
require('./routes/prototype-admin')(router)
16+
require('./routes/appointments')(router)
1617
require('./routes/support')(router)
1718
require('./routes/auth')(router)
1819
require('./routes/home')(router)

app/routes/appointments.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = router => {
2+
3+
router.post('/appointments/answer-setup', (req, res) => {
4+
const data = req.session.data
5+
const answer = data.appointmentSystem
6+
7+
if (answer === 'spreadsheet') {
8+
res.redirect('/appointments/upload-spreadsheet')
9+
} else {
10+
res.redirect('/appointments/setup')
11+
}
12+
13+
})
14+
15+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{% extends 'layout.html' %}
2+
3+
{% set pageName = "Add NHS numbers" %}
4+
5+
{% set currentSection = "appointments" %}
6+
7+
{% block beforeContent %}
8+
{{ backLink({ href: "/appointments/team" }) }}
9+
{% endblock %}
10+
11+
{% block content %}
12+
<div class="nhsuk-grid-row">
13+
<div class="nhsuk-grid-column-two-thirds">
14+
15+
{% if (errors | length) > 0 %}
16+
{{ errorSummary({
17+
titleText: "There is a problem",
18+
errorList: errors
19+
}) }}
20+
{% endif %}
21+
22+
<form action="/appointments/check1" method="post" novalidate>
23+
24+
<h1 class="nhsuk-heading-l">Add patient NHS numbers</h1>
25+
26+
<p>Copy patient NHS numbers from your booked appointments for Wednesday 4 June 2025 at Anne Ward Maternity Unit.</p>
27+
28+
<div class="nhsuk-form-group">
29+
<label class="nhsuk-label" for="example-longer">
30+
NHS numbers
31+
</label>
32+
<div class="nhsuk-hint" id="contact-hint">
33+
Ony 1 NHS number allowed per line.
34+
</div>
35+
<div class="nhsuk-hint" id="example-longer-hint">
36+
</div>
37+
38+
<textarea class="nhsuk-textarea" id="example-longer" name="example-longer" rows=" 10 " style="width:200px" aria-describedby="example-longer-hint"></textarea>
39+
</div>
40+
41+
42+
</div>
43+
</div>
44+
45+
46+
<button class="nhsuk-button" data-module="nhsuk-button" type="submit">
47+
Continue
48+
</button>
49+
50+
{% endblock %}
51+

app/views/appointments/add.html

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
{% extends 'layout.html' %}
2+
3+
{% set pageName = "Appointments" %}
4+
5+
{% set currentSection = "appointments" %}
6+
7+
{% block beforeContent %}
8+
{{ backLink({
9+
href: "/appointments/index2",
10+
text: "Back"
11+
}) }}
12+
{% endblock %}
13+
14+
{% block content %}
15+
<div class="nhsuk-grid-row">
16+
<div class="nhsuk-grid-column-two-thirds">
17+
18+
19+
<div class="nhsuk-form-group">
20+
21+
22+
</div>
23+
24+
25+
<div class="nhsuk-form-group">
26+
27+
<fieldset class="nhsuk-fieldset" aria-describedby="contact-hint">
28+
<legend class="nhsuk-fieldset__legend nhsuk-fieldset__legend--l">
29+
<h1 class="nhsuk-fieldset__heading">
30+
Select the date for your booked appointments
31+
</h1>
32+
</legend>
33+
34+
35+
<div class="nhsuk-radios nhsuk-radios--conditional">
36+
<div class="nhsuk-radios__item">
37+
<input class="nhsuk-radios__input" id="contact-1" name="contact" type="radio" value="email" aria-controls="conditional-contact-1" aria-expanded="false">
38+
<label class="nhsuk-label nhsuk-radios__label" for="contact-1">
39+
Today (Monday 2 June 2025)
40+
</label>
41+
</div>
42+
43+
<div class="nhsuk-radios__item">
44+
<input class="nhsuk-radios__input" id="contact-2" name="contact" type="radio" value="phone" aria-controls="conditional-contact-2" aria-expanded="false">
45+
<label class="nhsuk-label nhsuk-radios__label" for="contact-2">
46+
Tuesday 3 June 2025
47+
</label>
48+
</div>
49+
50+
<div class="nhsuk-radios__item">
51+
<input class="nhsuk-radios__input" id="contact-2" name="contact" type="radio" value="phone" aria-controls="conditional-contact-2" aria-expanded="false">
52+
<label class="nhsuk-label nhsuk-radios__label" for="contact-2">
53+
Wednesday 4 June 2025
54+
</label>
55+
</div>
56+
57+
<div class="nhsuk-radios__item">
58+
<input class="nhsuk-radios__input" id="contact-2" name="contact" type="radio" value="phone" aria-controls="conditional-contact-2" aria-expanded="false">
59+
<label class="nhsuk-label nhsuk-radios__label" for="contact-2">
60+
Thursday 5 June 2025
61+
</label>
62+
</div>
63+
64+
<div class="nhsuk-radios__item">
65+
<input class="nhsuk-radios__input" id="contact-2" name="contact" type="radio" value="phone" aria-controls="conditional-contact-2" aria-expanded="false">
66+
<label class="nhsuk-label nhsuk-radios__label" for="contact-2">
67+
Friday 6 June 2025
68+
</label>
69+
</div>
70+
71+
<div class="nhsuk-radios__item">
72+
<input class="nhsuk-radios__input" id="contact-2" name="contact" type="radio" value="phone" aria-controls="conditional-contact-2" aria-expanded="false">
73+
<label class="nhsuk-label nhsuk-radios__label" for="contact-2">
74+
Saturday 7 June 2025
75+
</label>
76+
</div>
77+
78+
<div class="nhsuk-radios__item">
79+
<input class="nhsuk-radios__input" id="contact-2" name="contact" type="radio" value="phone" aria-controls="conditional-contact-2" aria-expanded="false">
80+
<label class="nhsuk-label nhsuk-radios__label" for="contact-2">
81+
Sunday 8 June 2025
82+
</label>
83+
</div>
84+
85+
<div class="nhsuk-radios__divider">or</div>
86+
87+
<div class="nhsuk-radios__item">
88+
<input class="nhsuk-radios__input" id="contact-3" name="contact" type="radio" value="" aria-controls="conditional-contact-3" aria-expanded="false">
89+
<label class="nhsuk-label nhsuk-radios__label" for="contact-3">
90+
Other
91+
</label>
92+
</div>
93+
<div class="nhsuk-radios__conditional nhsuk-radios__conditional--hidden" id="conditional-contact-3">
94+
95+
96+
97+
<fieldset class="nhsuk-fieldset" aria-describedby="example-hint" role="group">
98+
<legend class="nhsuk-fieldset__legend nhsuk-label--s">
99+
Date
100+
</legend>
101+
<div class="nhsuk-hint" id="example-hint">
102+
For example, 15 3 2025
103+
</div>
104+
<div class="nhsuk-date-input" id="example">
105+
<div class="nhsuk-date-input__item">
106+
<div class="nhsuk-form-group">
107+
<label class="nhsuk-label nhsuk-date-input__label" for="example-day">
108+
Day
109+
</label> <input class="nhsuk-input nhsuk-date-input__input nhsuk-input--width-2" id="example-day" name="example[day]" type="text" inputmode="numeric">
110+
</div>
111+
</div>
112+
<div class="nhsuk-date-input__item">
113+
<div class="nhsuk-form-group">
114+
<label class="nhsuk-label nhsuk-date-input__label" for="example-month">
115+
Month
116+
</label> <input class="nhsuk-input nhsuk-date-input__input nhsuk-input--width-2" id="example-month" name="example[month]" type="text" inputmode="numeric">
117+
</div>
118+
</div>
119+
<div class="nhsuk-date-input__item">
120+
<div class="nhsuk-form-group">
121+
<label class="nhsuk-label nhsuk-date-input__label" for="example-year">
122+
Year
123+
</label> <input class="nhsuk-input nhsuk-date-input__input nhsuk-input--width-4" id="example-year" name="example[year]" type="text" inputmode="numeric">
124+
</div>
125+
</div>
126+
</div>
127+
</fieldset>
128+
129+
</div>
130+
</div>
131+
</fieldset>
132+
</div>
133+
134+
{{ button({
135+
text: "Continue",
136+
href: "/appointments/team"
137+
}) }}
138+
139+
</div>
140+
</div>
141+
142+
{% endblock %}

app/views/appointments/add1.html

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{% extends 'layout.html' %}
2+
3+
{% set pageName = "Appointments" %}
4+
5+
{% set currentSection = "appointments" %}
6+
7+
{% block beforeContent %}
8+
{{ backLink({
9+
href: "/appointments/index2",
10+
text: "Back"
11+
}) }}
12+
{% endblock %}
13+
14+
{% block content %}
15+
<div class="nhsuk-grid-row">
16+
<div class="nhsuk-grid-column-two-thirds">
17+
18+
19+
<div class="nhsuk-form-group">
20+
21+
22+
</div>
23+
24+
25+
<div class="nhsuk-form-group">
26+
27+
<fieldset class="nhsuk-fieldset" aria-describedby="contact-hint">
28+
<legend class="nhsuk-fieldset__legend nhsuk-fieldset__legend--l">
29+
<h1 class="nhsuk-fieldset__heading">
30+
Do you have a date for your appointments?
31+
</h1>
32+
</legend>
33+
34+
35+
<div class="nhsuk-radios nhsuk-radios--conditional">
36+
<div class="nhsuk-radios__item">
37+
<input class="nhsuk-radios__input" id="contact-1" name="contact" type="radio" value="email" aria-controls="conditional-contact-1" aria-expanded="false">
38+
<label class="nhsuk-label nhsuk-radios__label" for="contact-1">
39+
Yes
40+
</label>
41+
</div>
42+
43+
<div class="nhsuk-radios__item">
44+
<input class="nhsuk-radios__input" id="contact-2" name="contact" type="radio" value="phone" aria-controls="conditional-contact-2" aria-expanded="false">
45+
<label class="nhsuk-label nhsuk-radios__label" for="contact-2">
46+
No
47+
</label>
48+
</div>
49+
50+
51+
</fieldset>
52+
</div>
53+
54+
{{ button({
55+
text: "Continue",
56+
href: "/appointments/team"
57+
}) }}
58+
59+
</div>
60+
</div>
61+
62+
{% endblock %}

0 commit comments

Comments
 (0)