Skip to content

Commit bbdbf7e

Browse files
Add a closed site example (#587)
Closed sites should be view-only, with users able to see the previous batches, but not able to edit them or add new batches, or record vaccinations against them. They should be shown at the bottom of the Vaccines index page. (Next year we’ll have a wider look at this section) Resolves https://nhsd-jira.digital.nhs.uk/browse/RAVS-3171 ## Screenshots ### Vaccines index page <img width="1093" height="645" alt="Screenshot 2025-12-19 at 09 39 39" src="https://github.com/user-attachments/assets/90809a47-8d7f-4d42-ad79-92292639aaf9" /> ### Vaccine product at site page (No 'Add batch' or Edit options) <img width="1062" height="543" alt="Screenshot 2025-12-19 at 09 40 01" src="https://github.com/user-attachments/assets/2fc5a17f-0cdd-4335-900e-e54afd12fb1c" />
1 parent 62fcc44 commit bbdbf7e

File tree

6 files changed

+59
-24
lines changed

6 files changed

+59
-24
lines changed

app/data/organisations.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,11 @@ module.exports = [
10281028
{
10291029
id: "RW3RC",
10301030
name: "Royal Manchester Children’s Hospital"
1031+
},
1032+
{
1033+
id: "RW07E",
1034+
name: "Central Manchester Medical Centre",
1035+
status: "closed"
10311036
}
10321037
]
10331038
},

app/data/vaccine-stock.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,19 @@ module.exports = [
8686
expiryDate: "2027-11-23"
8787
}
8888
]
89+
},
90+
{
91+
id: "36346181471414",
92+
vaccine: "COVID-19",
93+
vaccineProduct: "Comirnaty 3 LP.8.1",
94+
organisationId: "RW3", // Central Manchester Trust
95+
siteId: "RW07E", // "Central Manchester Medical Centre
96+
batches: [
97+
{
98+
id: "325252145",
99+
batchNumber: "PN8471",
100+
expiryDate: "2024-02-06"
101+
}
102+
]
89103
}
90104
]

app/views/record-vaccinations/delivery-team.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@
2424

2525
{% set items = [] %}
2626
{% for site in (sitesInUse | sort(false, false, "name")) %}
27-
{% set items = (items.push({
28-
text: site.name,
29-
value: site.id
30-
}), items) %}
27+
{% if site.status != "closed" %}
28+
{% set items = (items.push({
29+
text: site.name,
30+
value: site.id
31+
}), items) %}
32+
{% endif %}
3133
{% endfor %}
3234

3335
{{ radios({

app/views/vaccines/choose-site.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ <h1 class="nhsuk-label-wrapper">
4141
<option selected value=""></option>
4242

4343
{% for site in currentOrganisation.sites %}
44-
<option value="{{ site.id }}">{{ site.name }} ({{site.id }})</option>
44+
{% if site.status != "closed" %}
45+
<option value="{{ site.id }}">{{ site.name }} ({{site.id }})</option>
46+
{% endif %}
4547
{% endfor %}
4648
</select>
4749
</div>

app/views/vaccines/index.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ <h1 class="nhsuk-heading-xl">Vaccines</h1>
6161
{% set site = currentOrganisation.sites | findById(siteId) %}
6262

6363
<table class="nhsuk-table">
64-
<caption class="nhsuk-table__caption nhsuk-table__caption--m nhsuk-u-margin-bottom-2">{{ site.name }}</caption>
64+
<caption class="nhsuk-table__caption nhsuk-table__caption--m nhsuk-u-margin-bottom-2">{{ site.name }}
65+
{% if site.status == "closed" %}
66+
(closed)
67+
{% endif %}
68+
</caption>
6569
<thead role="rowgroup" class="nhsuk-table__head">
6670
<tr role="row">
6771
<th role="columnheader" class="" scope="col">
@@ -121,7 +125,9 @@ <h1 class="nhsuk-heading-xl">Vaccines</h1>
121125
<div class="nhsuk-u-margin-bottom-1"><a href="/vaccines/{{ thisVaccine.id }}" class="nhsuk-link">View</a></div>
122126
</td>
123127
<td class="nhsuk-table__cell ">
124-
<div><a href="/vaccines/{{ thisVaccine.id }}/add" class="nhsuk-link">Add batch</a></div>
128+
{% if site.status != "closed" %}
129+
<div><a href="/vaccines/{{ thisVaccine.id }}/add" class="nhsuk-link">Add batch</a></div>
130+
{% endif %}
125131
</td>
126132
</tr>
127133
{% endfor %}

app/views/vaccines/product-page.html

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,18 @@ <h1 class="nhsuk-heading-xl">{{ vaccine.vaccineProduct }}</h1>
4242
text: "Site"
4343
},
4444
value: {
45-
html: site.name
45+
html: site.name + (" (closed)" if site.status == "closed")
4646
}
4747
}
4848
]
4949
}) }}
5050

51-
{{ button({
52-
text: "Add batch",
53-
href: "/vaccines/" + vaccine.id + "/add"
54-
}) }}
51+
{% if site.status != "closed" %}
52+
{{ button({
53+
text: "Add batch",
54+
href: "/vaccines/" + vaccine.id + "/add"
55+
}) }}
56+
{% endif %}
5557

5658
</div>
5759
</div>
@@ -82,9 +84,11 @@ <h1 class="nhsuk-heading-xl">{{ vaccine.vaccineProduct }}</h1>
8284
</th>
8385
<th role="columnheader" scope="col">
8486
</th>
85-
</th>
86-
<th role="columnheader" scope="col">
8787
</th>
88+
{% if site.status != "closed" %}
89+
<th role="columnheader" scope="col">
90+
</th>
91+
{% endif %}
8892

8993
</tr>
9094
</thead>
@@ -116,16 +120,18 @@ <h1 class="nhsuk-heading-xl">{{ vaccine.vaccineProduct }}</h1>
116120
{{ batch.depletedDate | govukDate }}
117121
{% endif %}
118122
</td>
119-
<td class="nhsuk-table__cell">{% if (batch.expiryDate | daysAgo) > 0 %} {% else %}
120-
<a href="/vaccines/{{ vaccine.id }}/{{ batch.batchNumber }}">Edit<span class="nhsuk-u-visually-hidden">{{ batch.batchNumber }}</span></a>
121-
&nbsp;
122-
{% if batch.depletedDate %}
123-
<a href="/vaccines/{{ vaccine.id }}/{{ batch.batchNumber }}/reactivate">Reactivate<span class="nhsuk-u-visually-hidden">{{ batch.batchNumber }}</span></a>
124-
{% else %}
125-
<a href="/vaccines/{{ vaccine.id }}/{{ batch.batchNumber }}/deplete">Deplete<span class="nhsuk-u-visually-hidden">{{ batch.batchNumber }}</span></a>
126-
{% endif %}
127-
{% endif %}
128-
</td>
123+
{% if site.status != "closed" %}
124+
<td class="nhsuk-table__cell">{% if (batch.expiryDate | daysAgo) > 0 %} {% else %}
125+
<a href="/vaccines/{{ vaccine.id }}/{{ batch.batchNumber }}">Edit<span class="nhsuk-u-visually-hidden">{{ batch.batchNumber }}</span></a>
126+
&nbsp;
127+
{% if batch.depletedDate %}
128+
<a href="/vaccines/{{ vaccine.id }}/{{ batch.batchNumber }}/reactivate">Reactivate<span class="nhsuk-u-visually-hidden">{{ batch.batchNumber }}</span></a>
129+
{% else %}
130+
<a href="/vaccines/{{ vaccine.id }}/{{ batch.batchNumber }}/deplete">Deplete<span class="nhsuk-u-visually-hidden">{{ batch.batchNumber }}</span></a>
131+
{% endif %}
132+
{% endif %}
133+
</td>
134+
{% endif %}
129135

130136
</tr>
131137
{% endfor %}

0 commit comments

Comments
 (0)