Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
e4be84b
Added users pages and logic back
caitlinroach-nhs Jun 9, 2026
29faf5b
Add ODS codes to pharmacy table on ind user page
caitlinroach-nhs Jun 9, 2026
e4b2fae
added full stops to success messages
caitlinroach-nhs Jun 9, 2026
2ea6ac7
added email variants folder
caitlinroach-nhs Jun 9, 2026
b66f71e
flattened email structure
caitlinroach-nhs Jun 9, 2026
21399a3
pharmacy table updates
caitlinroach-nhs Jun 9, 2026
a41f4c1
added example of closed pharmacy
caitlinroach-nhs Jun 9, 2026
24a275d
Update line that introduced the email on check.html
Anna-Sutton Jun 9, 2026
4f0adb3
Aligned H1 on this screen with other similar screens
Anna-Sutton Jun 10, 2026
50e812f
Fixed h1 text on user add to pharmacy
caitlinroach-nhs Jun 10, 2026
84f9d3b
added email file for multiple pharmacies
caitlinroach-nhs Jun 10, 2026
f525666
change role to permissions
caitlinroach-nhs Jun 10, 2026
7b68739
Updated email for user added to multiple pharmacies
Anna-Sutton Jun 10, 2026
f8d7003
Updated description of Pharmacies page
Anna-Sutton Jun 10, 2026
3f220e1
Tweaked deactivation message for user
Anna-Sutton Jun 10, 2026
df9f258
Fixed remove action on new pharmas to a user
caitlinroach-nhs Jun 10, 2026
037245a
Merge branch 'cp-admin-expanded-scope' of https://github.com/NHSDigit…
caitlinroach-nhs Jun 10, 2026
766136a
fix line on check pharmacies for multi pharma to a user
caitlinroach-nhs Jun 10, 2026
55bcc43
Changes to make adding to additional pharmacies for multi at once
caitlinroach-nhs Jun 10, 2026
2a4fb1c
Success message updates
caitlinroach-nhs Jun 10, 2026
3737ce3
added ability to deactivate from all pharmacies at once
caitlinroach-nhs Jun 10, 2026
892e1c1
fix to h1 for adding brand new user to a pharmacy
caitlinroach-nhs Jun 10, 2026
4e79a93
permission expander
caitlinroach-nhs Jun 10, 2026
0023c1d
Updates to check pages
caitlinroach-nhs Jun 10, 2026
571c8cd
Update welcome email for user invited to use RAVS for a single pharmacy
Anna-Sutton Jun 11, 2026
bf83895
remove unneeded email tempalte
caitlinroach-nhs Jun 11, 2026
74d0891
Updated welcome email content for pharmacy company
Anna-Sutton Jun 11, 2026
3ff074d
pharmacy selection text update
caitlinroach-nhs Jun 11, 2026
c47b3b1
Merge branch 'cp-admin-expanded-scope' of https://github.com/NHSDigit…
caitlinroach-nhs Jun 11, 2026
b121c21
Minor tweak to H1
Anna-Sutton Jun 11, 2026
2865ed6
fix to capitalisation and to how we write vaccine co admins in appts
caitlinroach-nhs Jun 11, 2026
9235193
Merge branch 'cp-admin-expanded-scope' of https://github.com/NHSDigit…
caitlinroach-nhs Jun 11, 2026
be11125
Apply suggestion from @Anna-Sutton
Anna-Sutton Jun 12, 2026
9a10669
Updated default welcome email content
Anna-Sutton Jun 12, 2026
c59f5b9
Updated content of welcome email multiple pharmacies
Anna-Sutton Jun 12, 2026
eb99297
Update greeting in welcome email template
Anna-Sutton Jun 12, 2026
a7bb2ed
Change pharmacy list to a bullet list
Anna-Sutton Jun 12, 2026
55490ee
Update deactivate page messaging and button text
Anna-Sutton Jun 12, 2026
aa425d7
Added a new email template for the pharmacies section
Anna-Sutton Jun 12, 2026
d1199d8
Update name of this file
Anna-Sutton Jun 12, 2026
df2c7e5
Added link to email for lead admins
Anna-Sutton Jun 15, 2026
e4267e4
Renamed this file
Anna-Sutton Jun 15, 2026
13b9d21
Fixed extra box around deactivate pharma email
caitlinroach-nhs Jun 15, 2026
1b84868
Linked up group admin email
caitlinroach-nhs Jun 15, 2026
61b7e07
Fix permission level change link
caitlinroach-nhs Jun 15, 2026
15d8fad
added some deactivated users bydefault
caitlinroach-nhs Jun 15, 2026
4d79c24
Revert "added some deactivated users bydefault"
caitlinroach-nhs Jun 15, 2026
b1e6c2b
column header updates
caitlinroach-nhs Jun 15, 2026
dcad26d
Update deactivation message for group admins
Anna-Sutton Jun 15, 2026
b32c0ea
Changed 'Closed pharmacies' references to 'Pharmacies no longer using…
Anna-Sutton Jun 15, 2026
9ea2f96
Columns update for invited users in a pharmacy
caitlinroach-nhs Jun 16, 2026
6b370d3
Added default users to invited and deactivated
caitlinroach-nhs Jun 16, 2026
012c1db
code style check fix
caitlinroach-nhs Jun 16, 2026
fc8652c
Added delete pharmacy route
caitlinroach-nhs Jun 16, 2026
5ead5ed
Clarified message about re-adding users to RAVS
Anna-Sutton Jun 16, 2026
f809070
Rephrase deletion message for clarity
Anna-Sutton Jun 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/data/appointments.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ module.exports = [
}
},
vaccinations: [
"flu", "RSV"
"COVID-19", "RSV"
]
},
{
Expand Down
83 changes: 83 additions & 0 deletions app/data/organisations.js
Original file line number Diff line number Diff line change
Expand Up @@ -9157,5 +9157,88 @@ module.exports = [
type: 'Pharmacy HQ',
status: 'Active',
region: "Y56"
},
{
id: "FCX831",
name: "Riverside Community Pharmacy",
address: {
line1: "42 River Street",
town: "Bristol",
postcode: "BS2 8NT"
},
type: "Community Pharmacy",
status: "Closed",
region: "Y56",
companyId: "P0191N",
vaccines: [
{name: "COVID-19", status: "enabled"},
{name: "flu", status: "enabled"}
],
sites: [
{
id: "FCX831-01",
name: "Riverside Community Pharmacy",
address: {
line1: "42 River Street",
town: "Bristol",
postcode: "BS2 8NT"
}
}
]
},
{
id: "FDX942",
name: "Central Health Pharmacy",
address: {
line1: "78 Main Street",
town: "Oxford",
postcode: "OX1 3HR"
},
type: "Community Pharmacy",
status: "Closed",
region: "Y56",
companyId: "P0191N",
vaccines: [
{name: "COVID-19", status: "enabled"}
],
sites: [
{
id: "FDX942-01",
name: "Central Health Pharmacy",
address: {
line1: "78 Main Street",
town: "Oxford",
postcode: "OX1 3HR"
}
}
]
},
{
id: "FEY153",
name: "Wellcare Pharmacy",
address: {
line1: "156 High Street",
town: "Edinburgh",
postcode: "EH8 8DH"
},
type: "Community Pharmacy",
status: "Closed",
region: "Y56",
companyId: "P15951",
vaccines: [
{name: "COVID-19", status: "enabled"},
{name: "MMR", status: "enabled"}
],
sites: [
{
id: "FEY153-01",
name: "Wellcare Pharmacy",
address: {
line1: "156 High Street",
town: "Edinburgh",
postcode: "EH8 8DH"
}
}
]
}
]
82 changes: 82 additions & 0 deletions app/data/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,19 @@ module.exports = [
"firstName": "Paulina",
"lastName": "Sloan"
},
{
"id": "7301948572610",
"email": "michael.reid@nhs.net",
"organisations": [
{
"id": "P0191N",
"permissionLevel": "Group administrator",
"status": "Active"
}
],
"firstName": "Michael",
"lastName": "Reid"
},
// Each pharmacy in Paulina Sloan’s chain has its own vaccinator, some of whom are also admins
{
"id": "46436346",
Expand Down Expand Up @@ -155,6 +168,34 @@ module.exports = [
"firstName": "Samantha",
"lastName": "Black"
},
{
"id": "2195407736418",
"email": "nina.hunt@nhs.net",
"organisations": [
{
"id": "FA424",
"permissionLevel": "Administrator",
"status": "Active",
"vaccinator": true
}
],
"firstName": "Nina",
"lastName": "Hunt"
},
{
"id": "8701294465302",
"email": "liam.byrne@nhs.net",
"organisations": [
{
"id": "FA02S",
"permissionLevel": "Recorder",
"status": "Active",
"vaccinator": false
}
],
"firstName": "Liam",
"lastName": "Byrne"
},
// Amanda White is a group administrator for the
// MediCare Health Ltd chain of pharmacies
{
Expand All @@ -170,6 +211,47 @@ module.exports = [
}
]
},
{
"firstName": "Farah",
"lastName": "Iqbal",
"id": "6015872204914",
"email": "farah.iqbal@nhs.net",
"organisations": [
{
"id": "P15951",
"permissionLevel": "Group administrator",
"status": "Active"
}
]
},
{
"id": "3041597862150",
"email": "kyle.mason@nhs.net",
"organisations": [
{
"id": "FX9141",
"permissionLevel": "Administrator",
"status": "Active",
"vaccinator": true
}
],
"firstName": "Kyle",
"lastName": "Mason"
},
{
"id": "4586231970421",
"email": "elise.turner@nhs.net",
"organisations": [
{
"id": "FX4825",
"permissionLevel": "Recorder",
"status": "Active",
"vaccinator": true
}
],
"firstName": "Elise",
"lastName": "Turner"
},
{
"id": "34634617277",
"email": "peter.orange@nhs.net",
Expand Down
54 changes: 54 additions & 0 deletions app/filters.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const prototypeFilters = require('@x-govuk/govuk-prototype-filters');

const dateFromYearMonthDay = require('./lib/utils/date-from-year-month-day');


module.exports = function () {
const filters = prototypeFilters;
Expand Down Expand Up @@ -30,6 +32,27 @@ module.exports = function () {
return array.map((item) => item[attribute])
}

filters.vaccinationsForPatient = function(records, nhsNumber) {
if (!Array.isArray(records)) return []

return records
.map((record, index) => ({ record, index }))
.filter(({ record }) => {
return record && record.patient && record.patient.nhsNumber === nhsNumber
})
.sort((a, b) => {
const dateA = dateFromYearMonthDay(a.record.date.year, a.record.date.month, a.record.date.day)
const dateB = dateFromYearMonthDay(b.record.date.year, b.record.date.month, b.record.date.day)

if (dateA && dateB && dateA.getTime() !== dateB.getTime()) {
return dateB.getTime() - dateA.getTime()
}

return b.index - a.index
})
.map(({ record }) => record)
}

filters.capitaliseFirstLetter = function(string) {
if (string) {
return string.charAt(0) .toUpperCase() + string.slice(1)
Expand Down Expand Up @@ -68,6 +91,37 @@ module.exports = function () {
}
}

/**
* Ensure a value is always returned as an array
* Useful for form fields with [] notation that may return a string if only one value
*
* @param {string|Array|null|undefined} value - Value to convert to array
* @returns {Array} Value as an array
*/
filters.asArray = function(value) {
if (value === undefined || value === null) {
return []
}
if (Array.isArray(value)) {
return value
}
return [value]
}

filters.daysSince = function(dateValue) {
if (!dateValue) return null

const inviteDate = new Date(dateValue)
if (Number.isNaN(inviteDate.getTime())) return null

const now = new Date()
const inviteDay = new Date(inviteDate.getFullYear(), inviteDate.getMonth(), inviteDate.getDate())
const today = new Date(now.getFullYear(), now.getMonth(), now.getDate())

const millisecondsPerDay = 24 * 60 * 60 * 1000
return Math.floor((today - inviteDay) / millisecondsPerDay)
}

/* keep the following line to return your filters to the app */
return filters
}
Expand Down
Loading