Skip to content

Commit d910005

Browse files
johnrimmer2Anna-Suttonfrankieroberto
authored
regional updates (#272)
Co-authored-by: Anna-Sutton <[email protected]> Co-authored-by: Frankie Roberto <[email protected]>
1 parent 2f0700f commit d910005

19 files changed

+799
-112
lines changed

app/data/organisations.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4056,7 +4056,7 @@ module.exports = [
40564056
},
40574057
{
40584058
"id": "RGM",
4059-
"name": "Royal papworth hospital NHS Foundation Trust",
4059+
"name": "Royal Papworth Hospital NHS Foundation Trust",
40604060
"address": {
40614061
"line1": "Papworth road",
40624062
"town": "Cambridge",
@@ -4068,7 +4068,7 @@ module.exports = [
40684068
},
40694069
{
40704070
"id": "RLZ",
4071-
"name": "Royal shrewsbury hospitals NHS trust",
4071+
"name": "Royal Shrewsbury Hospitals NHS trust",
40724072
"address": {
40734073
"line1": "Royal shrewsbury hospital north",
40744074
"town": "Shrewsbury",
@@ -5934,14 +5934,16 @@ module.exports = [
59345934
},
59355935
{
59365936
"id": "RRF",
5937-
"name": "Wrightington, wigan and leigh NHS Foundation Trust",
5937+
"name": "Wrightington, Wigan and Keigh NHS Foundation Trust",
59385938
"address": {
59395939
"line1": "Royal albert edward infirmary",
59405940
"town": "Wigan",
59415941
"postcode": "WN1 2NN"
59425942
},
5943-
"status": "Active",
5944-
"type": "NHS Trust"
5943+
"status": "Closed",
5944+
dateClosed: "2024-12-04",
5945+
"type": "NHS Trust",
5946+
"region": "Y61"
59455947
},
59465948
{
59475949
"id": "RLQ",
@@ -5967,14 +5969,16 @@ module.exports = [
59675969
},
59685970
{
59695971
"id": "RCB",
5970-
"name": "York and scarborough teaching hospitals NHS Foundation Trust",
5972+
"name": "York and Scarborough Teaching Hospitals NHS Foundation Trust",
59715973
"address": {
59725974
"line1": "York hospital",
59735975
"town": "York",
59745976
"postcode": "YO31 8HE"
59755977
},
5976-
"status": "Active",
5977-
"type": "NHS Trust"
5978+
"status": "Closed",
5979+
dateClosed: "2025-02-12",
5980+
"type": "NHS Trust",
5981+
"region": "Y61"
59785982
},
59795983
{
59805984
"id": "RX8",

app/routes/regions.js

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,21 @@ module.exports = router => {
22

33
router.get('/regions/v1', (req, res) => {
44
const data = req.session.data
5-
const organisations = data.organisations.filter((organisation) => organisation.region === "Y61")
5+
const organisations = data.organisations.filter((organisation) => (organisation.region === "Y61") && (organisation.status != "Closed"))
6+
7+
const closedOrganisationsCount = data.organisations.filter((organisation) => (organisation.region === "Y61" && organisation.status == "Closed")).length
68

79
res.render('regions/v1/index', {
10+
organisations,
11+
closedOrganisationsCount
12+
})
13+
})
14+
15+
router.get('/regions/v1/organisations/closed', (req, res) => {
16+
const data = req.session.data
17+
const organisations = data.organisations.filter((organisation) => (organisation.region === "Y61" && organisation.status == "Closed"))
18+
19+
res.render('regions/v1/closed-organisations', {
820
organisations
921
})
1022
})
@@ -257,6 +269,49 @@ module.exports = router => {
257269
})
258270
})
259271

272+
// Deactivate an organisation
273+
router.get('/regions/v1/organisations/:id/deactivate', (req, res) => {
274+
const data = req.session.data
275+
const organisation = data.organisations.find((org) => org.id === req.params.id)
276+
if (!organisation) { res.redirect('/regions/v1/'); return }
277+
278+
res.render('regions/v1/deactivate', {
279+
organisation
280+
})
281+
})
282+
283+
// Deactivating an organisation
284+
router.post('/regions/v1/organisations/:id/deactivated', (req, res) => {
285+
const organisation = req.session.data.organisations.find((org) => org.id === req.params.id)
286+
if (!organisation) { res.redirect('/regions/v1/'); return }
287+
288+
organisation.status = "Deactivated"
289+
290+
res.redirect('/regions/v1/organisations/' + organisation.id)
291+
})
292+
293+
// Reactivate an organisation
294+
router.get('/regions/v1/organisations/:id/reactivate', (req, res) => {
295+
const data = req.session.data
296+
const organisation = data.organisations.find((org) => org.id === req.params.id)
297+
if (!organisation) { res.redirect('/regions/v1/'); return }
298+
299+
res.render('regions/v1/reactivate', {
300+
organisation
301+
})
302+
})
303+
304+
// Reactivating an organisation
305+
router.post('/regions/v1/organisations/:id/reactivated', (req, res) => {
306+
const organisation = req.session.data.organisations.find((org) => org.id === req.params.id)
307+
if (!organisation) { res.redirect('/regions/v1/'); return }
308+
309+
organisation.status = "Active"
310+
311+
res.redirect('/regions/v1/organisations/' + organisation.id)
312+
})
313+
314+
260315
// Check a second lead user for an organisation
261316
router.get('/regions/v1/organisations/:id/add-email-check', (req, res) => {
262317
const data = req.session.data

app/views/_deactivated.html

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
2+
{% block head %}
3+
<script src="/js/feedback-panel.js"></script>
4+
{% endblock %}
5+
6+
{% from 'checkboxes/macro.njk' import checkboxes %}
7+
<div class="app-feedback-panel" data-module="feedback-panel">
8+
<div data-module="feedback-panel__initial-question">
9+
<h2 class="app-feedback-panel__title">Organisation name has been deactivated</h2>
10+
11+
12+
<fieldset class="nhsuk-fieldset">
13+
<legend class="nhsuk-fieldset__legend nhsuk-u-margin-bottom-4">Until [date] you will still be able to access other sections of the Record a vaccination service (RAVS). After [date] you will lose all access to RAVS. </legend>
14+
15+
<div class="app-button-group nhsuk-u-margin-bottom-0">
16+
17+
<a href="#" class="nhsuk-link nhsuk-link--no-visited-state" data-module="feedback-panel__close">Close</a>
18+
19+
20+
</div>
21+
</fieldset>
22+
</div>
23+
24+
<div class="app-feedback-panel__comments" data-module="feedback-panel__comments" hidden>
25+
26+
<h2 class="app-feedback-panel__title">Thank you.</h2>
27+
{{ textarea({
28+
name: "example",
29+
id: "example",
30+
rows: 3,
31+
label: {
32+
text: "Feedback (optional)"
33+
}
34+
}) }}
35+
36+
{{ checkboxes({
37+
items: [
38+
{
39+
value: "contactable",
40+
text: "I’m happy to be contacted about my feedback"
41+
}
42+
]
43+
})}}
44+
45+
46+
<div class="app-button-group nhsuk-u-margin-bottom-0">
47+
{{ button({
48+
text: "Send feedback",
49+
classes: "app-button--outlined app-button--small"
50+
}) }}
51+
52+
53+
<a href="#" class="nhsuk-link nhsuk-link--no-visited-state" data-module="feedback-panel__close">Close</a>
54+
</div>
55+
56+
</div>
57+
</div>

app/views/alerts/deactivated.html

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{% extends 'layout.html' %}
2+
3+
{% block pageTitle %}
4+
Record a vaccination
5+
{% endblock %}
6+
7+
{% block header %}
8+
{% include "includes/header-logged-out.html" %}
9+
{% endblock %}
10+
11+
{% block content %}
12+
<div class="nhsuk-grid-row">
13+
<div class="nhsuk-grid-column-full nhsuk-u-margin-bottom-5">
14+
15+
16+
<div class="nhsuk-panel" style="background-color:#FFFFFF; border: 4px solid #005eb8; padding-top: 48px;
17+
padding-right: 48px;
18+
padding-bottom: 48px;
19+
padding-left: 48px;">
20+
<h1 class="nhsuk-panel__title" style="color:#212b32;">
21+
Organisation name has been deactivated
22+
</h1>
23+
24+
<div class="nhsuk-panel__body" style="color:#212b32;">
25+
<p>This means you can no longer record vaccinations for this organisation.</p>
26+
<p>Until [date] you will still be able to access other parts of the Record a vaccination service.</p>
27+
<p>After [date] you will no longer have access to the service for ((Organisation name)).</p>
28+
</div>
29+
30+
31+
<br><br>
32+
33+
34+
{% from 'button/macro.njk' import button %}
35+
36+
{{ button({
37+
text: "I've read this",
38+
classes: "nhsuk-button",
39+
href: "/home"
40+
}) }}
41+
42+
</div>
43+
44+
45+
46+
47+
48+
{% endblock %}
49+

app/views/alerts/notification.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<div class="nhsuk-grid-row">
1818
<div class="nhsuk-grid-column-two-thirds">
1919

20-
{% include "_alert.html" %}
20+
{% include "_test.html" %}
2121

2222
<h1 class="nhsuk-heading-xl">Vaccines</h1>
2323

app/views/records/check.html

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,35 @@ <h1 class="nhsuk-heading-l">{{ vaccination.patient.name }}’s {{vaccination.vac
150150
]
151151
}
152152
},
153+
154+
155+
156+
{
157+
key: {
158+
text: "Location"
159+
},
160+
value: {
161+
html: vaccination.locationType
162+
},
163+
actions: {
164+
items: [
165+
{
166+
href: "/records/records/" + vaccination.id + "/location",
167+
text: "Change",
168+
visuallyHiddenText: "contact information"
169+
}
170+
]
171+
}
172+
},
173+
174+
175+
176+
177+
178+
179+
180+
181+
153182
{
154183
key: {
155184
text: "Eligibility"

app/views/records/deactivated.html

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{% extends 'layout.html' %}
2+
3+
{% set pageName = "Records" %}
4+
5+
{% set currentSection = "records" %}
6+
7+
{% block content %}
8+
<div class="nhsuk-grid-row">
9+
<div class="nhsuk-grid-column-two-thirds">
10+
11+
{% include "_deactivated.html" %}
12+
13+
<h1 class="nhsuk-heading-l">Records</h1>
14+
<p class="nhsuk-body-l">Search for a vaccination record you want to view, edit or delete.</p>
15+
16+
<form action="/records/answer-search" method="post" novalidate>
17+
18+
{% set nhsNumberHtml %}
19+
20+
{{ input({
21+
id: "nhsNumber",
22+
name: "nhsNumber",
23+
classes: "nhsuk-input--width-10",
24+
inputmode: "numeric",
25+
26+
value: data.nhsNumber,
27+
hint: {
28+
text: "For example, 485 777 3456"
29+
}
30+
}) }}
31+
{% endset %}
32+
33+
34+
{{ radios({
35+
idPrefix: "nhsNumberKnown",
36+
name: "nhsNumberKnown",
37+
fieldset: {
38+
legend: {
39+
html: "How do you want to search for a record?",
40+
classes: "nhsuk-fieldset__legend--m",
41+
isPageHeading: false
42+
}
43+
},
44+
items: [
45+
{
46+
value: "yes",
47+
text: "NHS number",
48+
checked: (data.nhsNumberKnown == 'yes'),
49+
conditional: {
50+
html: nhsNumberHtml
51+
}
52+
},
53+
{
54+
value: "no",
55+
text: "Patient details",
56+
checked: (data.nhsNumberKnown == 'no')
57+
}
58+
]
59+
}) }}
60+
61+
{{ button({
62+
text: "Continue"
63+
})}}
64+
</form>
65+
66+
67+
68+
</div>
69+
</div>
70+
71+
72+
73+
74+
75+
{% endblock %}

0 commit comments

Comments
 (0)