diff --git a/app/data/organisations.js b/app/data/organisations.js index 5e5d7389..59e4d8dc 100644 --- a/app/data/organisations.js +++ b/app/data/organisations.js @@ -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', diff --git a/app/data/users.js b/app/data/users.js index 27d8578c..c81f14fb 100644 --- a/app/data/users.js +++ b/app/data/users.js @@ -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" + }, ] diff --git a/app/routes/prototype-admin.js b/app/routes/prototype-admin.js index 2189a9f1..e074e81f 100644 --- a/app/routes/prototype-admin.js +++ b/app/routes/prototype-admin.js @@ -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 @@ -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 // ---------------------------------------------------------------- diff --git a/app/routes/record-vaccinations.js b/app/routes/record-vaccinations.js index e6f3bb4f..928f00bc 100644 --- a/app/routes/record-vaccinations.js +++ b/app/routes/record-vaccinations.js @@ -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" @@ -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') } @@ -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" } diff --git a/app/views/includes/_preset-scenarios-table.html b/app/views/includes/_preset-scenarios-table.html index 8652de2a..50290130 100644 --- a/app/views/includes/_preset-scenarios-table.html +++ b/app/views/includes/_preset-scenarios-table.html @@ -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" } ] %} diff --git a/app/views/index.html b/app/views/index.html index fa25b97b..8dfdc8bc 100755 --- a/app/views/index.html +++ b/app/views/index.html @@ -105,6 +105,17 @@

Main interface

  • Profile page
  • +

    GP scenarios

    + +

    Regions interface