Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0638170
Create outreach-patient-not-in-pcn-warning.html
benjystanton Jul 31, 2026
47938e3
Changed name of file
benjystanton Jul 31, 2026
64781bf
Simplify content
benjystanton Jul 31, 2026
bfcadf7
Testing out some content on patient history page
benjystanton Jul 31, 2026
7bdde00
Update title tag
benjystanton Aug 3, 2026
2a78136
Change in to with
benjystanton Aug 4, 2026
4296851
Create another variant for outside of PCN scenario
benjystanton Aug 4, 2026
f7f58a1
Adding warning callout
benjystanton Aug 4, 2026
2d3a65b
Add 'not in surgery..."
benjystanton Aug 4, 2026
baaf2c9
Tweak content
benjystanton Aug 6, 2026
fb07ac1
Update name of interruption
benjystanton Aug 6, 2026
57f1b7e
Removed address to match QA
benjystanton Aug 6, 2026
eaa9b1e
Create patient-history-no-gp.html
benjystanton Aug 6, 2026
8bbfd92
Add note about scenario
benjystanton Aug 6, 2026
6c6e2ef
Remove note
benjystanton Aug 6, 2026
4041c53
Add new callout and combine content into 1 location
benjystanton Aug 6, 2026
41daaaf
Create no-gp-surgery.html
benjystanton Aug 6, 2026
1a96b56
Add if statements to show/hide scenario content
benjystanton Aug 6, 2026
93510f4
Update content following review
benjystanton Aug 10, 2026
a89770e
Updating heading levels on warning callout
benjystanton Aug 11, 2026
3381387
Add a fake GP surgery
benjystanton Aug 12, 2026
09b1804
Add an example GP user linked to GP org
benjystanton Aug 12, 2026
bc8eab8
Add better comment
benjystanton Aug 12, 2026
3fc6e76
Create a quick access route for new GP user and org
benjystanton Aug 12, 2026
783c56f
Add quick access links to index for GP scenarios
benjystanton Aug 12, 2026
af0cdad
Add `-warning` to filename for consistency
benjystanton Aug 12, 2026
9a88e6b
Remove content that isn't being used
benjystanton Aug 12, 2026
f53b581
Update next page and make some content dynamic
benjystanton Aug 12, 2026
64b4693
Add routes for GP scenarios
benjystanton Aug 12, 2026
a3b0105
Merge branch 'main' into patient-detail-changes-for-new-scenarios
benjystanton Aug 12, 2026
d2c15a8
Add GP surgery user preset
benjystanton Aug 13, 2026
ef3a64d
Add direct links some pages
benjystanton Aug 13, 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
25 changes: 25 additions & 0 deletions app/data/organisations.js
Original file line number Diff line number Diff line change
Expand Up @@ -8283,6 +8283,31 @@ module.exports = [
status: 'Active',
region: "Y62"
},
{
id: 'FA425',
name: 'Simpsons Surgery',
companyId: "P0191N",
sites: [
{
id: "FA425X",
name: "Simpsons Surgery"
}
],
address: {
line1: '8 Spencer Court',
town: 'Corby',
postcode: 'NN17 1NU'
},
type: 'GP Surgery',
vaccines: [
{name: "RSV", status: "enabled"},
{name: "COVID-19", status: "enabled"},
{name: "pertussis", status: "disabled"},
{name: "flu", status: "enabled"}
],
status: 'Active',
region: "Y62"
},
{
id: 'FA02S',
name: 'Addlestone Pharmacy',
Expand Down
17 changes: 16 additions & 1 deletion app/data/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -13954,5 +13954,20 @@ module.exports = [
"vaccinator": true
}
]
}
},
// Add an example GP user linked to GP org
{
"id": "12345678",
"email": "lydia.harris@nhs.net",
"organisations": [
{
"id": "FA425",
"permissionLevel": "Lead administrator",
"status": "Active",
"vaccinator": true
}
],
"firstName": "Lydia",
"lastName": "Harris"
},
]
25 changes: 25 additions & 0 deletions app/routes/prototype-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,11 @@ module.exports = (router) => {
} else if (scenario === 'support') {
data.currentUserId = '66435353634'
data.currentOrganisationId = null
} else if (scenario === 'gp') {
data.currentUserId = '12345678'
data.currentOrganisationId = 'FA425'
setupBatchesForOrg(data, 'FA425')
addRandomVaccinations(data, 'FA425', 30)
} else {
res.redirect('/')
return
Expand Down Expand Up @@ -699,6 +704,26 @@ module.exports = (router) => {
res.redirect(getDefaultLandingPath(data, data.currentOrganisationId))
})

// ----------------------------------------------------------------
// Preset: Basic GP user
// ----------------------------------------------------------------

router.get('/prototype-setup/preset/gp-surgery', (req, res) => {
resetSession(req)
const data = req.session.data

const scenarioUser = SIGN_IN_USERS.find(user => user.id === '12345678')
ensureUserExistsForScenario(data, scenarioUser)

data.currentUserId = '12345678'
data.currentOrganisationId = 'FA425'
setAppointmentsInterfaceForUserOrganisations(data, data.currentUserId, false)

setupBatchesForOrg(data, 'FA425')
addRandomVaccinations(data, 'FA425', 10)
res.redirect(getDefaultLandingPath(data, data.currentOrganisationId))
})

// ----------------------------------------------------------------
// Custom configuration — Step 1: Choose user
// ----------------------------------------------------------------
Expand Down
17 changes: 15 additions & 2 deletions app/routes/record-vaccinations.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,17 @@ module.exports = router => {
const nhsNumberKnown = req.session.data.nhsNumberKnown;
req.session.data.nhsNumber = req.session.data.nhsNumber.trim()
const nhsNumber = req.session.data.nhsNumber.replaceAll(' ', '')
const data = req.session.data

if (nhsNumberKnown === "yes" && nhsNumber.match(/^\d{10}$/) && nhsNumber.startsWith('9') && data.gpit === "noGP") {

req.session.data.firstName = "Jodie"
req.session.data.lastName = "Brown"
req.session.data.dateOfBirth = {day: "15", month: "8", year: "1949"}
req.session.data.postcode = "GD3 I83"

if (nhsNumberKnown === "yes" && nhsNumber.match(/^\d{10}$/) && nhsNumber.startsWith('9')) {
res.redirect('/record-vaccinations/patient-history-no-gp')
} else if (nhsNumberKnown === "yes" && nhsNumber.match(/^\d{10}$/) && nhsNumber.startsWith('9')) {

req.session.data.firstName = "Jodie"
req.session.data.lastName = "Brown"
Expand Down Expand Up @@ -439,7 +448,7 @@ module.exports = router => {

if (firstName != '' && lastName != '' && dateOfBirth.day != '' && dateOfBirth.month != '' && dateOfBirth.year != '' && postcode != '' && gender != '') {

res.redirect('/record-vaccinations/consent')
res.redirect('/record-vaccinations/patient-history-none')
} else {
res.redirect('/record-vaccinations/create-a-record?showErrors=yes')
}
Expand Down Expand Up @@ -891,6 +900,10 @@ module.exports = router => {

if (!data.locationType) {
redirectPath = "/record-vaccinations/location?showErrors=yes"
} else if (data.gpit === "notInPCN" && data.locationType !== "Outreach event"){
redirectPath = "/record-vaccinations/covid-19/not-in-pcn-warning"
} else if (data.gpit === "noGP" && data.locationType !== "Outreach event"){
redirectPath = "/record-vaccinations/covid-19/no-gp-surgery-warning"
} else {
redirectPath = "/record-vaccinations/consent"
}
Expand Down
8 changes: 8 additions & 0 deletions app/views/includes/_preset-scenarios-table.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@
userEmail: "jeremy13.blue@nhs.net",
role: "Lead administrator",
scenarioDetails: "Pharmacy configured for MMR and flu (London service) only."
},
{
presetLabel: "GP surgery",
presetPath: "/prototype-setup/preset/gp-surgery",
userName: "Lydia Harris",
userEmail: "lydia.harris@nhs.net",
role: "Lead administrator",
scenarioDetails: "Basic GP surgery"
}
] %}

Expand Down
13 changes: 13 additions & 0 deletions app/views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,17 @@ <h2>Main interface</h2>
<li><a href="/prototype-setup/quick-access/pharmacy?next=/user-profile">Profile page</a></li>
</ul>

<h2>GP scenarios</h2>
<ul>
<li><a href="/prototype-setup/quick-access/gp?next=/record-vaccinations?gpit=inPCN">Record vaccinations (in PCN)</a></li>
<li><a href="/prototype-setup/quick-access/gp?next=/record-vaccinations?gpit=notInPCN">Record vaccinations (not in PCN)</a></li>
<li><a href="/prototype-setup/quick-access/gp?next=/record-vaccinations?gpit=noGP">Record vaccinations (no GP surgery)</a>
<ul>
<li><a href="/record-vaccinations/patient-history-none?gpit=noGP">Patient details - no NHS number and no GP surgery</a></li>
</ul>
</li>
</ul>

<h2>Regions interface</h2>

<ul>
Expand Down Expand Up @@ -150,6 +161,8 @@ <h3>COVID-19</h3>
<ul>
<li><a href="/record-vaccinations/covid-19/interval-warning">Had a COVID-19 vaccine less than 3 months ago</a></li>
<li><a href="/record-vaccinations/covid-19/too-young-warning">Too young for product</a></li>
<li><a href="/record-vaccinations/covid-19/no-gp-surgery-warning">No GP surgery and not outreach</a></li>
<li><a href="/record-vaccinations/covid-19/not-in-PCN-warning">Not in PCN and not outreach</a></li>
</ul>

<h3>flu</h3>
Expand Down
48 changes: 48 additions & 0 deletions app/views/record-vaccinations/covid-19/no-gp-surgery-warning.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

{% extends 'layout.html' %}

{% set pageName = "Patient has no GP surgery" %}

{% set currentSection = "vaccinate" %}

{% block beforeContent %}
{{ backLink({ href: "/record-vaccinations/patient-history" }) }}
{% endblock %}

{% block content %}
<div class="nhsuk-grid-row">
<div class="nhsuk-grid-column-two-thirds">

{% if data.firstName and data.lastName %}
{% set displayName = data.firstName ~ ' ' ~ data.lastName %}
{% else %}
{% set displayName = 'Patient Name' %}
{% endif %}

{% if data.locationType %}
{% set locationType = data.locationType %}
{% else %}
{% set locationType = '[Location Type]' %}
{% endif %}

{% set panelHtml %}
{# <p>This patient does not have a registered GP surgery.</p> #}
<p>Your organisation may not be paid for this vaccination.</p>

{{ button({
"text": "Continue anyway",
"href": "/record-vaccinations/consent",
"classes": "nhsuk-button--reverse"
}) }}
{% endset %}

{{ panel({
titleText: displayName + " is not registered with a GP surgery",
html: panelHtml,
classes: "nhsuk-panel--interruption"
}) }}

</div>
</div>
{% endblock %}

42 changes: 42 additions & 0 deletions app/views/record-vaccinations/covid-19/not-in-pcn-warning.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

{% extends 'layout.html' %}

{% set pageName = "Patient not in PCN" %}

{% set currentSection = "vaccinate" %}

{% block beforeContent %}
{{ backLink({ href: "/record-vaccinations/patient-history" }) }}
{% endblock %}

{% block content %}
<div class="nhsuk-grid-row">
<div class="nhsuk-grid-column-two-thirds">


{% if data.firstName and data.lastName %}
{% set displayName = data.firstName ~ ' ' ~ data.lastName %}
{% else %}
{% set displayName = 'Patient Name' %}
{% endif %}

{% set panelHtml %}
<p>Your organisation may not be paid for this vaccination.</p>

{{ button({
"text": "Continue anyway",
"href": "/record-vaccinations/consent",
"classes": "nhsuk-button--reverse"
}) }}
{% endset %}

{{ panel({
titleText: displayName + "'s GP surgery is not in your PCN",
html: panelHtml,
classes: "nhsuk-panel--interruption"
}) }}

</div>
</div>
{% endblock %}

Loading