Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
130 changes: 130 additions & 0 deletions app/data/appointments.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
// These are organisations set up as using RAVS
module.exports = [

{
time: "10:00",
patient: {
nhsNumber: "9123123123",
firstName: "Alan",
lastName: "Teapot",
dateOfBirth: "1969-04-16",
contactDetails: {
mobile: "07588547704",
phone: "0111432626",
email: "alan.teapot@btinternet.com"
}
},
vaccinations: [
"COVID-19"
]
},
{
time: "10:30",
patient: {
nhsNumber: "9841414141",
firstName: "Keith",
lastName: "Napkin",
dateOfBirth: "1976-02-12",
contactDetails: {
mobile: "077345813941"
}
},
vaccinations: [
"COVID-19",
"Flu"
]
},
{
time: "10:40",
patient: {
nhsNumber: "9841515715",
firstName: "Lynn",
lastName: "Feather",
dateOfBirth: "1963-05-23",
contactDetails: {
email: "lynn.feather@gmail.com"
}
},
vaccinations: [
"Flu", "RSV"
]
},
{
time: "11:10",
patient: {
nhsNumber: "98357151513",
firstName: "Lorna",
lastName: "Biscuitbarrel",
dateOfBirth: "1962-08-19",
contactDetails: {
mobile: "07364824944"
}
},
vaccinations: [
"Flu"
]
},
{
time: "11:20",
patient: {
nhsNumber: "9847471413",
firstName: "Moira",
lastName: "Packet",
dateOfBirth: "1950-04-14",
contactDetails: {
mobile: "07623842424"
}
},
vaccinations: [
"COVID-19"
]
},
{
time: "11:30",
patient: {
nhsNumber: "9841411411",
firstName: "Cliff",
lastName: "Sugarbowl",
dateOfBirth: "1957-01-23",
contactDetails: {
mobile: "07623913141"
}
},
vaccinations: [
"COVID-19"
]
},
{
time: "11:40",
patient: {
nhsNumber: "9841411411",
firstName: "James",
lastName: "Brown",
dateOfBirth: "1952-04-19",
contactDetails: {
mobile: "0723456123",
email: "james.brown@hotmail.com"
}
},
vaccinations: [
"COVID-19"
]
},
{
time: "11:50",
patient: {
nhsNumber: "9917425141",
firstName: "Emma",
lastName: "Blue",
dateOfBirth: "1973-01-23",
contactDetails: {
mobile: "07524222525",
email: "emma.blue123@nhs.net"
}
},
vaccinations: [
"COVID-19", "RSV"
]
}

]
2 changes: 2 additions & 0 deletions app/data/session-data-defaults.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const allOrganisations = require('./all-organisations')
const appointments = require('./appointments')
const featureFlags = require('./feature-flags')
const organisations = require('./organisations')
const users = require('./users')
Expand All @@ -13,6 +14,7 @@ module.exports = {
users: users,
vaccines: vaccines,
vaccineStock: vaccineStock,
appointments: appointments,
lists: [],
nhsNumberKnown: "yes",
currentUserId: "2387441662601",
Expand Down
95 changes: 95 additions & 0 deletions app/views/appointments.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{% extends 'layout.html' %}

{% set pageName = "Today’s appointments" %}
{% set currentSection = "appointments" %}


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

<h1 class="nhsuk-heading-l">{{ pageName }}</h1>

<p>Imported from <b>Manage your appointments</b>.</p>

{% set todayContent %}

<table class="nhsuk-table-responsive" role="table" data-module="nhsuk-table">
<thead class="nhsuk-table__head" role="rowgroup">
<tr>
<th scope="col" class="nhsuk-table__header" aria-sort="ascending">Time</th>
<th scope="col" class="nhsuk-table__header" aria-sort="none">Name</th>
<th scope="col" class="nhsuk-table__header">Date of birth</th>
<th scope="col" class="nhsuk-table__header">Contact details</th>
<th scope="col" class="nhsuk-table__header">Vaccines</th>

<th scope="col" class="nhsuk-table__header">Action</th>

</tr>
</thead>
<tbody class="nhsuk-table__body">

{% for appointment in data.appointments %}
<tr class="nhsuk-table__row" role="row">
<td class="nhsuk-table__cell" data-value="{{ appointment.time }}">{{ appointment.time }}&nbsp;am</td>
<td class="nhsuk-table__cell">
{{ appointment.patient.firstName }}
{{ appointment.patient.lastName }}
</td>
<td class="nhsuk-table__cell">
{{ appointment.patient.dateOfBirth | govukDate }}
</td>
<td class="nhsuk-table__cell nhsuk-u-text-break-word">
{% if appointment.patient.contactDetails.mobile %}
{{ appointment.patient.contactDetails.mobile }}<br>
{% endif %}
{% if appointment.patient.contactDetails.email %}
<span class="nhsuk-u-font-size-16">{{ appointment.patient.contactDetails.email }}</span><br>
{% endif %}
</td>
<td class="nhsuk-table__cell">
{{ appointment.vaccinations | join(", ") }}
</td>
<td class="nhsuk-table__cell">
<a href="/record-vaccinations/patient-history?nhsNumber={{ appointment.patient.nhsNumber }}&dateOfBirth={{ appointment.patient.dateOfBirth }}&firstName={{ appointment.patient.firstName }}&lastName={{ appointment.patient.lastName }}&from=appointments">Record</a>
</td>

</tr>

{% endfor %}
</tbody>
</table>
{% endset %}

{{ tabs({
items: [
{
label: "Scheduled",
id: "scheduled",
panel: {
html: todayContent
}
},
{
label: "Cancelled",
id: "cancelled",
panel: {
html: "TODO"
}
},
{
label: "Vaccinations given",
id: "done",
panel: {
html: "TODO"
}
}
]
}) }}


</div>
</div>


{% endblock %}
6 changes: 6 additions & 0 deletions app/views/includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
}), navigationItems) %}

{% if currentOrganisation %}
{% set navigationItems = (navigationItems.push({
href: "/appointments",
html: "Appointments <span class=\"nhsuk-tag app-tag--header nhsuk-u-margin-left-2\">New</span>",
active: (currentSection == "appointments")
}), navigationItems) %}

{% set navigationItems = (navigationItems.push({
href: "/record-vaccinations",
text: "Record vaccinations",
Expand Down
4 changes: 3 additions & 1 deletion app/views/record-vaccinations/patient-history.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
{% set nextPage = "/record-vaccinations/vaccination-date" %}
{% endif %}

{% if data.repeatVaccination === "yes" %}
{% if data.from == "appointments" %}
{% set previousPage = "/appointments" %}
{% elseif data.repeatVaccination === "yes" %}
{% set previousPage = "/record-vaccinations/patient" %}
{% elseif data.repeatPatient === "yes" %}
{% set previousPage = "/record-vaccinations/done" %}
Expand Down