Skip to content
Merged
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
20 changes: 2 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,6 @@ This prototype tests a digital alternative to phone-based lung health check ques

Currently, lung health check assessments are conducted over the phone, often taking over 30 minutes and involving personal questions. This prototype explores whether users would prefer to complete these assessments digitally, in their own time and privacy.

## Current status

**Version:** 1.0
**Status:** Research prototype for user testing

### Key features at a glance
- Complete end-to-end user journey
- Age validation (55-74 years eligible)
- NHS design system patterns and components
- Responsive design following NHS accessibility standards

### Known limitations
- **Scoring system not implemented** - The prototype doesn't calculate weighted scores from answers in the background
- **Fixed outcome** - Currently shows high-risk result by default (with option to view low-risk alternative)
- **Research prototype only** - Not intended for clinical use

## User journey

The prototype guides users through:
Expand Down Expand Up @@ -80,7 +64,7 @@ Built with the latest NHS prototype kit. No additional setup required beyond sta

```bash
npm install
npm run watch
npm start
```

The prototype will be available at `http://localhost:3000`
Expand All @@ -99,4 +83,4 @@ This is a research prototype. For questions or contributions, please contact the

## Licence

This prototype is built using the NHS prototype kit and follows the same licensing terms.
This prototype is built using the NHS prototype kit and follows the same licensing terms.
9 changes: 9 additions & 0 deletions app/assets/sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,12 @@
@import "nhsuk-frontend/dist/nhsuk";

// Add your custom CSS/Sass styles below.
.nhsuk-summary-list__row {
border-bottom: 1px solid #d8dde0;
}

.nhsuk-summary-list__key,
.nhsuk-summary-list__value,
.nhsuk-summary-list__actions {
border-bottom: none;
}
89 changes: 47 additions & 42 deletions app/filters.js
Original file line number Diff line number Diff line change
@@ -1,55 +1,60 @@
module.exports = function (env) { /* eslint-disable-line func-names,no-unused-vars */
const filters = {};
const filters = {}

filters.nhsDate = function(dateInput) {
// Handle empty input
if (!dateInput) {
return ''
}
filters.nhsDate = function(dateInput) {
// Handle empty input
if (!dateInput) {
return ''
}

let day, month, year
let day, month, year

// Handle both array and object formats
if (Array.isArray(dateInput)) {
// Array format: [day, month, year]
if (dateInput.length !== 3) {
return ''
}
[day, month, year] = dateInput
} else if (typeof dateInput === 'object') {
// Object format: {day: x, month: y, year: z}
day = dateInput.day
month = dateInput.month
year = dateInput.year
} else {
return ''
}

// Handle both array and object formats
if (Array.isArray(dateInput)) {
// Array format: [day, month, year]
if (dateInput.length !== 3) {
// Handle empty values
if (!day || !month || !year) {
return ''
}
[day, month, year] = dateInput
} else if (typeof dateInput === 'object') {
// Object format: {day: x, month: y, year: z}
day = dateInput.day
month = dateInput.month
year = dateInput.year
} else {
return ''
}

// Handle empty values
if (!day || !month || !year) {
return ''
}
// Month names array (index 0 = January)
const monthNames = [
'January', 'February', 'March', 'April', 'May', 'June',
'July', 'August', 'September', 'October', 'November', 'December'
]

// Month names array (index 0 = January)
const monthNames = [
'January', 'February', 'March', 'April', 'May', 'June',
'July', 'August', 'September', 'October', 'November', 'December'
]
// Convert strings to numbers and validate
const dayNum = parseInt(day, 10)
const monthNum = parseInt(month, 10)
const yearNum = parseInt(year, 10)

// Convert strings to numbers and validate
const dayNum = parseInt(day, 10)
const monthNum = parseInt(month, 10)
const yearNum = parseInt(year, 10)
// Validate ranges
if (dayNum < 1 || dayNum > 31 || monthNum < 1 || monthNum > 12 || yearNum < 1000) {
return ''
}

// Validate ranges
if (dayNum < 1 || dayNum > 31 || monthNum < 1 || monthNum > 12 || yearNum < 1000) {
return ''
}
const date = new Date(yearNum, monthNum - 1, dayNum)

// Format: "1 January 2020"
return `${dayNum} ${monthNames[monthNum - 1]} ${yearNum}`
}
if (date.getFullYear() !== yearNum || date.getMonth() !== monthNum - 1 || date.getDate() !== dayNum) {
return ''
}

// Format: "1 January 2020"
return `${dayNum} ${monthNames[monthNum - 1]} ${yearNum}`
}

return filters;
};
return filters
}
14 changes: 1 addition & 13 deletions app/views/prototype_v3/check-your-answers.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,6 @@

{% block content %}

<style>
.nhsuk-summary-list__row {
border-bottom: 1px solid #d8dde0;
}

.nhsuk-summary-list__key,
.nhsuk-summary-list__value,
.nhsuk-summary-list__actions {
border-bottom: none;
}
</style>

<div class="nhsuk-grid-row">
<div class="nhsuk-grid-column-two-thirds">
<h1 class="nhsuk-heading-l">{{pageHeading}}</h1>
Expand Down Expand Up @@ -1067,4 +1055,4 @@ <h2 class="nhsuk-heading-m">Smoking habits</h2>
</div>
</div>

{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"main": "app.js",
"scripts": {
"start": "node .",
"watch": "echo 'run this instead: npm start'"
"watch": "npm start"
},
"author": "https://github.com/nhsuk/",
"license": "MIT",
Expand Down