diff --git a/app/locals.js b/app/locals.js index 84adb7b..67711c5 100644 --- a/app/locals.js +++ b/app/locals.js @@ -10,5 +10,8 @@ module.exports = (req, res, next) => { res.locals.serviceEmail = 'england.digitallungcancerscreening@nhs.net' res.locals.serviceTelephone = '020 3835 1600' + res.locals.referrer = req.query.referrer + res.locals.query = req.query + next() } diff --git a/app/prototype_v4/content/contact.md b/app/prototype_v4/content/contact.md index 182e367..80ceb89 100644 --- a/app/prototype_v4/content/contact.md +++ b/app/prototype_v4/content/contact.md @@ -6,8 +6,8 @@ title: Contact us Call us on: {{ serviceTelephone | telephoneLink }} -**Phone lines are open:** -Monday to Friday 8am to 8pm +**Phone lines are open:** +Monday to Friday 8am to 8pm Saturdays 8am to 1pm ## If you have questions about the online service diff --git a/app/prototype_v4/controllers/authentication.js b/app/prototype_v4/controllers/authentication.js new file mode 100644 index 0000000..8305e2e --- /dev/null +++ b/app/prototype_v4/controllers/authentication.js @@ -0,0 +1,93 @@ +const version = 'v4' +const view = (template) => { + return `prototype_${version}/views/${template}` +} + +exports.signIn_get = (req, res) => { + + res.render(view('authentication/sign-in'), { + actions: { + back: '/prototype_v4', + next: '/prototype_v4/sign-in' + } + }) +} + +exports.signIn_post = (req, res) => { + const errors = [] + + if (errors.length) { + res.render(view('authentication/sign-in'), { + errors, + actions: { + back: '/prototype_v4', + next: '/prototype_v4/sign-in' + } + }) + } else { + res.redirect('/prototype_v4/security-code') + } +} + +exports.securityCode_get = (req, res) => { + + res.render(view('authentication/security-code'), { + actions: { + back: '/prototype_v4/sign-in', + next: '/prototype_v4/security-code' + } + }) +} + +exports.securityCode_post = (req, res) => { + const errors = [] + + if (errors.length) { + res.render(view('authentication/security-code'), { + errors, + actions: { + back: '/prototype_v4/sign-in', + next: '/prototype_v4/security-code' + } + }) + } else { + res.redirect('/prototype_v4/sign-in-agreement') + } +} + +exports.signInAgreement_get = (req, res) => { + + res.render(view('authentication/sign-in-agreement'), { + actions: { + back: '/prototype_v4/security-code', + accept: '/prototype_v4/sign-in-agreement', + decline: '/prototype_v4/sign-in-agreement-declined' + } + }) +} + +exports.signInAgreement_post = (req, res) => { + const errors = [] + + if (errors.length) { + res.render(view('authentication/sign-in-agreement'), { + errors, + actions: { + back: '/prototype_v4/security-code', + accept: '/prototype_v4/sign-in-agreement', + decline: '/prototype_v4/sign-in-agreement-declined' + } + }) + } else { + res.redirect('/prototype_v4/accept-terms') + } +} + +exports.signInAgreementDeclined_get = (req, res) => { + + res.render(view('authentication/sign-in-agreement-declined'), { + actions: { + back: '/prototype_v4' + } + }) +} diff --git a/app/prototype_v4/controllers/question.js b/app/prototype_v4/controllers/question.js index e69de29..df4ff61 100644 --- a/app/prototype_v4/controllers/question.js +++ b/app/prototype_v4/controllers/question.js @@ -0,0 +1,1110 @@ +const version = 'v4' + +const view = (template) => { + return `prototype_${version}/views/${template}` +} + +const getHeightBack = (req) => { + const { answers } = req.session.data + + return answers?.height?.imperial ? '/prototype_v4/height-imperial' : '/prototype_v4/height-metric' +} + +const getWeightBack = (req) => { + const { answers } = req.session.data + + return answers?.weight?.imperial ? '/prototype_v4/weight-imperial' : '/prototype_v4/weight-metric' +} + +const getWeightNext = (req, defaultUnit) => { + const { answers } = req.session.data + + if (answers?.weight?.imperial) { + return '/prototype_v4/weight-imperial' + } + + if (answers?.weight?.metric) { + return '/prototype_v4/weight-metric' + } + + return `/prototype_${version}/weight-${defaultUnit}` +} + +const getDateOfBirth = (answers) => { + const day = Number(answers?.dateOfBirth?.day) + const month = Number(answers?.dateOfBirth?.month) + const year = Number(answers?.dateOfBirth?.year) + + if (!Number.isInteger(day) || !Number.isInteger(month) || !Number.isInteger(year)) { + return false + } + + const date = new Date(year, month - 1, day) + + if ( + date.getFullYear() !== year || + date.getMonth() !== month - 1 || + date.getDate() !== day + ) { + return false + } + + return date +} + +const getAge = (dateOfBirth) => { + const today = new Date() + let age = today.getFullYear() - dateOfBirth.getFullYear() + const monthDiff = today.getMonth() - dateOfBirth.getMonth() + + if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < dateOfBirth.getDate())) { + age-- + } + + return age +} + +const isEligibleForScanAge = (dateOfBirth) => { + const age = getAge(dateOfBirth) + + return age >= 55 && age <= 74 +} + +const smokingTypes = { + cigarettes: { + caption: 'Cigarette smoking', + frequencyHeading: 'How often do you smoke cigarettes?', + quantityHeading: 'How many cigarettes do you currently smoke in a normal day?', + changeHeading: 'Has the number of cigarettes you normally smoke changed over time?', + quantityUnit: 'cigarettes', + suffix: 'cigarettes' + }, + rolling_tobacco: { + caption: 'Rolling tobacco smoking', + frequencyHeading: 'How often do you smoke rolling tobacco or roll-ups?', + quantityHeading: 'How much rolling tobacco do you currently smoke in a normal week?', + changeHeading: 'Has the amount of rolling tobacco you normally smoke changed over time?', + quantityUnit: 'rolling tobacco' + }, + pipes: { + caption: 'Pipe smoking', + frequencyHeading: 'How often do you smoke a pipe?', + quantityHeading: 'How many full pipe loads do you currently smoke in a normal day?', + changeHeading: 'Has the number of full pipe loads you normally smoke changed over time?', + quantityUnit: 'full pipe loads', + suffix: 'full pipe loads' + }, + small_cigars: { + caption: 'Small cigar smoking', + frequencyHeading: 'How often do you smoke small cigars?', + quantityHeading: 'How many small cigars do you currently smoke in a normal day?', + changeHeading: 'Has the number of small cigars you normally smoke changed over time?', + quantityUnit: 'small cigars', + suffix: 'small cigars' + }, + medium_cigars: { + caption: 'Medium cigar smoking', + frequencyHeading: 'How often do you smoke medium cigars?', + quantityHeading: 'How many medium cigars do you currently smoke in a normal day?', + changeHeading: 'Has the number of medium cigars you normally smoke changed over time?', + quantityUnit: 'medium cigars', + suffix: 'medium cigars' + }, + large_cigars: { + caption: 'Large cigar smoking', + frequencyHeading: 'How often do you smoke large cigars?', + quantityHeading: 'How many large cigars do you currently smoke in a normal day?', + changeHeading: 'Has the number of large cigars you normally smoke changed over time?', + quantityUnit: 'large cigars', + suffix: 'large cigars' + }, + cigarillos: { + caption: 'Cigarillo smoking', + frequencyHeading: 'How often do you smoke cigarillos?', + quantityHeading: 'How many cigarillos do you currently smoke in a normal day?', + changeHeading: 'Has the number of cigarillos you normally smoke changed over time?', + quantityUnit: 'cigarillos', + suffix: 'cigarillos' + }, + shisha: { + caption: 'Shisha smoking', + settingHeading: 'Do you usually smoke shisha in a group or on your own?', + frequencyHeading: 'How often do you smoke shisha?', + quantityHeading: 'How many hours do you currently smoke shisha in a normal day?', + quantityUnit: 'hours', + suffix: 'hours' + } +} + +const nextStepAfterSmokingTypes = `/prototype_${version}/check-your-answers` + +const getSelectedSmokingTypes = (answers = {}) => { + const selectedTypes = Array.isArray(answers.typeOfSmoking) + ? answers.typeOfSmoking + : [answers.typeOfSmoking].filter(Boolean) + + return Object.keys(smokingTypes).filter((type) => selectedTypes.includes(type)) +} + +const getSmokingTypeSteps = (answers = {}) => { + return getSelectedSmokingTypes(answers).flatMap((type) => { + const steps = [] + + if (type === 'shisha') { + steps.push({ page: 'smoking-setting', type }) + } + + steps.push({ page: 'smoking-frequency', type }) + steps.push({ page: 'smoking-quantity', type }) + + if (type !== 'shisha') { + steps.push({ page: 'smoking-change', type }) + } + + return steps + }) +} + +const getSmokingTypeStepUrl = (step) => { + return `/prototype_${version}/${step.page}?type=${encodeURIComponent(step.type)}` +} + +const getSmokingTypeStep = (req, page) => { + const { answers } = req.session.data + const steps = getSmokingTypeSteps(answers) + const queryType = req.query?.type + const step = steps.find((step) => step.page === page && step.type === queryType) || + steps.find((step) => step.page === page) + + return { step, steps } +} + +const getSmokingTypeActions = (step, steps) => { + const index = steps.findIndex((item) => item.page === step.page && item.type === step.type) + const previousStep = steps[index - 1] + const nextStep = steps[index + 1] + + return { + next: getSmokingTypeStepUrl(step), + back: previousStep ? getSmokingTypeStepUrl(previousStep) : `/prototype_${version}/type-of-smoking`, + onward: nextStep ? getSmokingTypeStepUrl(nextStep) : nextStepAfterSmokingTypes, + cancel: `/prototype_${version}/` + } +} + +const renderSmokingTypeQuestion = (req, res, page, errors = []) => { + const { step, steps } = getSmokingTypeStep(req, page) + + if (!step) { + res.redirect(`/prototype_${version}/type-of-smoking`) + return + } + + res.render(view(`questions/${page}`), { + type: step.type, + smokingType: smokingTypes[step.type], + errors, + actions: getSmokingTypeActions(step, steps) + }) +} + +/// ------------------------------------------------------------------------ /// +/// +/// ------------------------------------------------------------------------ /// + +exports.acceptTerms_get = (req, res) => { + + res.render(view('questions/accept-terms'), { + actions: { + next: '/prototype_v4/accept-terms', + cancel: '/prototype_v4' + } + }) +} + +exports.acceptTerms_post = (req, res) => { + const errors = [] + + if (errors.length) { + res.render(view('questions/accept-terms'), { + errors, + actions: { + next: '/prototype_v4/accept-terms', + cancel: '/prototype_v4' + } + }) + } else { + res.redirect('/prototype_v4/phone-questionnaire') + } +} + +exports.phoneQuestionnaire_get = (req, res) => { + + res.render(view('questions/phone-questionnaire'), { + actions: { + next: '/prototype_v4/phone-questionnaire', + cancel: '/prototype_v4/' + } + }) +} + +exports.phoneQuestionnaire_post = (req, res) => { + const { answers } = req.session.data + const errors = [] + + if (errors.length) { + res.render(view('questions/phone-questionnaire'), { + errors, + actions: { + next: '/prototype_v4/phone-questionnaire', + cancel: '/prototype_v4/' + } + }) + } else { + if (answers.phoneQuestionnaire === 'yes') { + res.redirect('/prototype_v4/phone-questionnaire-exit') + } else { + res.redirect('/prototype_v4/smoker') + } + } +} + +exports.phoneQuestionnaireExit_get = (req, res) => { + + res.render(view('questions/phone-questionnaire-exit'), { + actions: { + back: '/prototype_v4/phone-questionnaire' + } + }) +} + +/// ------------------------------------------------------------------------ /// +/// Eligibility +/// ------------------------------------------------------------------------ /// + +exports.smoker_get = (req, res) => { + + res.render(view('questions/smoker'), { + actions: { + next: '/prototype_v4/smoker', + back: '/prototype_v4/phone-questionnaire', + cancel: '/prototype_v4/' + } + }) +} + +exports.smoker_post = (req, res) => { + const { answers } = req.session.data + const errors = [] + + if (errors.length) { + res.render(view('questions/smoker'), { + errors, + actions: { + next: '/prototype_v4/smoker', + back: '/prototype_v4/phone-questionnaire', + cancel: '/prototype_v4/' + } + }) + } else { + if (answers.smoker === 'no') { + res.redirect('/prototype_v4/not-eligible-for-screening') + } else { + res.redirect('/prototype_v4/date-of-birth') + } + } +} + +exports.dateOfBirth_get = (req, res) => { + + res.render(view('questions/date-of-birth'), { + actions: { + next: '/prototype_v4/date-of-birth', + back: '/prototype_v4/smoker', + cancel: '/prototype_v4/' + } + }) +} + +exports.dateOfBirth_post = (req, res) => { + const { answers } = req.session.data + const errors = [] + const dateOfBirth = getDateOfBirth(answers) + + if (!dateOfBirth) { + errors.push({ + text: 'Enter a real date of birth', + href: '#dateOfBirth-day' + }) + } + + if (errors.length) { + res.render(view('questions/date-of-birth'), { + errors, + actions: { + next: '/prototype_v4/date-of-birth', + back: '/prototype_v4/smoker', + cancel: '/prototype_v4/' + } + }) + } else { + if (!isEligibleForScanAge(dateOfBirth)) { + res.redirect('/prototype_v4/not-eligible-for-scan') + } else { + res.redirect('/prototype_v4/face-to-face-appointment') + } + } +} + +exports.faceToFaceAppointment_get = (req, res) => { + + res.render(view('questions/face-to-face-appointment'), { + actions: { + next: '/prototype_v4/face-to-face-appointment', + back: '/prototype_v4/date-of-birth', + cancel: '/prototype_v4/' + } + }) +} + +exports.faceToFaceAppointment_post = (req, res) => { + const { answers } = req.session.data + const errors = [] + + if (errors.length) { + res.render(view('questions/face-to-face-appointment'), { + errors, + actions: { + next: '/prototype_v4/face-to-face-appointment', + back: '/prototype_v4/date-of-birth', + cancel: '/prototype_v4/' + } + }) + } else { + if (answers.faceToFaceAppointment === 'yes') { + res.redirect('/prototype_v4/book-appointment') + } else { + res.redirect('/prototype_v4/height-metric') + } + } +} + +exports.notEligibleForScreening_get = (req, res) => { + res.render(view('questions/not-eligible-for-screening'), { + actions: { + back: '/prototype_v4/smoker', + cancel: '/prototype_v4/' + } + }) +} + +exports.notEligibleForScan_get = (req, res) => { + res.render(view('questions/not-eligible-for-scan'), { + actions: { + back: '/prototype_v4/date-of-birth', + cancel: '/prototype_v4/' + } + }) +} + +exports.bookAppointment_get = (req, res) => { + res.render(view('questions/book-appointment'), { + actions: { + back: '/prototype_v4/face-to-face-appointment', + cancel: '/prototype_v4/' + } + }) +} + +/// ------------------------------------------------------------------------ /// +/// About you +/// ------------------------------------------------------------------------ /// + +exports.heightMetric_get = (req, res) => { + res.render(view('questions/height-metric'), { + actions: { + next: '/prototype_v4/height-metric', + switchUnits: '/prototype_v4/height-imperial', + back: '/prototype_v4/face-to-face-appointment', + cancel: '/prototype_v4/' + } + }) +} + +exports.heightMetric_post = (req, res) => { + const { answers } = req.session.data + const errors = [] + + if (errors.length) { + res.render(view('questions/height-metric'), { + errors, + actions: { + next: '/prototype_v4/height-metric', + switchUnits: '/prototype_v4/height-imperial', + back: '/prototype_v4/face-to-face-appointment', + cancel: '/prototype_v4/' + } + }) + } else { + delete answers.height?.imperial + res.redirect(getWeightNext(req, 'metric')) + } +} + +exports.heightImperial_get = (req, res) => { + res.render(view('questions/height-imperial'), { + actions: { + next: '/prototype_v4/height-imperial', + switchUnits: '/prototype_v4/height-metric', + back: '/prototype_v4/face-to-face-appointment', + cancel: '/prototype_v4/' + } + }) +} + +exports.heightImperial_post = (req, res) => { + const { answers } = req.session.data + const errors = [] + + if (errors.length) { + res.render(view('questions/height-imperial'), { + errors, + actions: { + next: '/prototype_v4/height-imperial', + switchUnits: '/prototype_v4/height-metric', + back: '/prototype_v4/face-to-face-appointment', + cancel: '/prototype_v4/' + } + }) + } else { + delete answers.height?.metric + res.redirect(getWeightNext(req, 'imperial')) + } +} + +exports.weightMetric_get = (req, res) => { + const back = getHeightBack(req) + + res.render(view('questions/weight-metric'), { + actions: { + next: '/prototype_v4/weight-metric', + switchUnits: '/prototype_v4/weight-imperial', + back, + cancel: '/prototype_v4/' + } + }) +} + +exports.weightMetric_post = (req, res) => { + const { answers } = req.session.data + const back = getHeightBack(req) + const errors = [] + + if (errors.length) { + res.render(view('questions/weight-metric'), { + errors, + actions: { + next: '/prototype_v4/weight-metric', + switchUnits: '/prototype_v4/weight-imperial', + back, + cancel: '/prototype_v4/' + } + }) + } else { + delete answers.weight?.imperial + res.redirect('/prototype_v4/gender') + } +} + +exports.weightImperial_get = (req, res) => { + const back = getHeightBack(req) + + res.render(view('questions/weight-imperial'), { + actions: { + next: '/prototype_v4/weight-imperial', + switchUnits: '/prototype_v4/weight-metric', + back, + cancel: '/prototype_v4/' + } + }) +} + +exports.weightImperial_post = (req, res) => { + const { answers } = req.session.data + const back = getHeightBack(req) + const errors = [] + + if (errors.length) { + res.render(view('questions/weight-imperial'), { + errors, + actions: { + next: '/prototype_v4/weight-imperial', + switchUnits: '/prototype_v4/weight-metric', + back, + cancel: '/prototype_v4/' + } + }) + } else { + delete answers.weight?.metric + res.redirect('/prototype_v4/gender') + } +} + +exports.gender_get = (req, res) => { + const back = getWeightBack(req) + + res.render(view('questions/gender'), { + actions: { + next: '/prototype_v4/gender', + back, + cancel: '/prototype_v4/' + } + }) +} + +exports.gender_post = (req, res) => { + const back = getWeightBack(req) + const errors = [] + + if (errors.length) { + res.render(view('questions/gender'), { + errors, + actions: { + next: '/prototype_v4/gender', + back, + cancel: '/prototype_v4/' + } + }) + } else { + res.redirect('/prototype_v4/sex') + } +} + +exports.sex_get = (req, res) => { + res.render(view('questions/sex'), { + actions: { + next: '/prototype_v4/sex', + back: '/prototype_v4/gender', + cancel: '/prototype_v4/' + } + }) +} + +exports.sex_post = (req, res) => { + const errors = [] + + if (errors.length) { + res.render(view('questions/sex'), { + errors, + actions: { + next: '/prototype_v4/sex', + back: '/prototype_v4/gender', + cancel: '/prototype_v4/' + } + }) + } else { + res.redirect('/prototype_v4/ethnicity') + } +} + +exports.ethnicity_get = (req, res) => { + + res.render(view('questions/ethnicity'), { + actions: { + next: '/prototype_v4/ethnicity', + back: '/prototype_v4/gender', + cancel: '/prototype_v4/' + } + }) +} + +exports.ethnicity_post = (req, res) => { + const errors = [] + + if (errors.length) { + res.render(view('questions/ethnicity'), { + errors, + actions: { + next: '/prototype_v4/ehtnicity', + back: '/prototype_v4/gender', + cancel: '/prototype_v4/' + } + }) + } else { + res.redirect('/prototype_v4/education') + } +} + +exports.education_get = (req, res) => { + + res.render(view('questions/education'), { + actions: { + next: '/prototype_v4/education', + back: '/prototype_v4/ethnicity', + cancel: '/prototype_v4/' + } + }) +} + +exports.education_post = (req, res) => { + const errors = [] + + if (errors.length) { + res.render(view('questions/education'), { + errors, + actions: { + next: '/prototype_v4/education', + back: '/prototype_v4/ethnicity', + cancel: '/prototype_v4/' + } + }) + } else { + res.redirect('/prototype_v4/respiratory-conditions') + } +} + +/// ------------------------------------------------------------------------ /// +/// Your health +/// ------------------------------------------------------------------------ /// + +exports.respiratoryConditions_get = (req, res) => { + + res.render(view('questions/respiratory-conditions'), { + actions: { + next: '/prototype_v4/respiratory-conditions', + back: '/prototype_v4/education', + cancel: '/prototype_v4/' + } + }) +} + +exports.respiratoryConditions_post = (req, res) => { + const errors = [] + + if (errors.length) { + res.render(view('questions/respiratory-conditions'), { + errors, + actions: { + next: '/prototype_v4/respiratory-conditions', + back: '/prototype_v4/education', + cancel: '/prototype_v4/' + } + }) + } else { + res.redirect('/prototype_v4/asbestos-at-work') + } +} + +exports.asbestosAtWork_get = (req, res) => { + + res.render(view('questions/asbestos-at-work'), { + actions: { + next: '/prototype_v4/asbestos-at-work', + back: '/prototype_v4/respiratory-conditions', + cancel: '/prototype_v4/' + } + }) +} + +exports.asbestosAtWork_post = (req, res) => { + const errors = [] + + if (errors.length) { + res.render(view('questions/asbestos-at-work'), { + errors, + actions: { + next: '/prototype_v4/asbestos-at-work', + back: '/prototype_v4/respiratory-conditions', + cancel: '/prototype_v4/' + } + }) + } else { + res.redirect('/prototype_v4/asbestos-at-home') + } +} + +exports.asbestosAtHome_get = (req, res) => { + + res.render(view('questions/asbestos-at-home'), { + actions: { + next: '/prototype_v4/asbestos-at-home', + back: '/prototype_v4/asbestos-at-work', + cancel: '/prototype_v4/' + } + }) +} + +exports.asbestosAtHome_post = (req, res) => { + const errors = [] + + if (errors.length) { + res.render(view('questions/asbestos-at-home'), { + errors, + actions: { + next: '/prototype_v4/asbestos-at-home', + back: '/prototype_v4/asbestos-at-work', + cancel: '/prototype_v4/' + } + }) + } else { + res.redirect('/prototype_v4/cancer-diagnosis') + } +} + +exports.cancerDiagnosis_get = (req, res) => { + + res.render(view('questions/cancer-diagnosis'), { + actions: { + next: '/prototype_v4/cancer-diagnosis', + back: '/prototype_v4/asbestos-at-work', + cancel: '/prototype_v4/' + } + }) +} + +exports.cancerDiagnosis_post = (req, res) => { + const errors = [] + + if (errors.length) { + res.render(view('questions/cancer-diagnosis'), { + errors, + actions: { + next: '/prototype_v4/cancer-diagnosis', + back: '/prototype_v4/asbestos-at-work', + cancel: '/prototype_v4/' + } + }) + } else { + res.redirect('/prototype_v4/cancer-diagnosis-relatives') + } +} + +/// ------------------------------------------------------------------------ /// +/// Family history +/// ------------------------------------------------------------------------ /// + +exports.cancerDiagnosisRelatives_get = (req, res) => { + + res.render(view('questions/cancer-diagnosis-relatives'), { + actions: { + next: '/prototype_v4/cancer-diagnosis-relatives', + back: '/prototype_v4/cancer-diagnosis', + cancel: '/prototype_v4/' + } + }) +} + +exports.cancerDiagnosisRelatives_post = (req, res) => { + const { answers } = req.session.data + const errors = [] + + if (errors.length) { + res.render(view('questions/cancer-diagnosis-relatives'), { + errors, + actions: { + next: '/prototype_v4/cancer-diagnosis-relatives', + back: '/prototype_v4/cancer-diagnosis', + cancel: '/prototype_v4/' + } + }) + } else { + if (answers.cancerDiagnosisRelatives === 'yes') { + res.redirect('/prototype_v4/cancer-diagnosis-relatives-age') + } else { + delete answers.cancerDiagnosisRelativesAge + res.redirect('/prototype_v4/age-started-smoking') + } + } +} + +exports.cancerDiagnosisRelativesAge_get = (req, res) => { + + res.render(view('questions/cancer-diagnosis-relatives-age'), { + actions: { + next: '/prototype_v4/cancer-diagnosis-relatives-age', + back: '/prototype_v4/cancer-diagnosis-relatives', + cancel: '/prototype_v4/' + } + }) +} + +exports.cancerDiagnosisRelativesAge_post = (req, res) => { + const errors = [] + + if (errors.length) { + res.render(view('questions/cancer-diagnosis-relatives-age'), { + errors, + actions: { + next: '/prototype_v4/cancer-diagnosis-relatives-age', + back: '/prototype_v4/cancer-diagnosis-relatives', + cancel: '/prototype_v4/' + } + }) + } else { + res.redirect('/prototype_v4/age-started-smoking') + } +} + +/// ------------------------------------------------------------------------ /// +/// Smoking habits +/// ------------------------------------------------------------------------ /// + +exports.ageStartedSmoking_get = (req, res) => { + const { answers } = req.session.data + const back = answers?.cancerDiagnosisRelativesAge ? '/prototype_v4/cancer-diagnosis-relatives-age' : '/prototype_v4/cancer-diagnosis-relatives' + + res.render(view('questions/age-started-smoking'), { + actions: { + next: '/prototype_v4/age-started-smoking', + back, + cancel: '/prototype_v4/' + } + }) +} + +exports.ageStartedSmoking_post = (req, res) => { + const { answers } = req.session.data + const back = answers?.cancerDiagnosisRelativesAge ? '/prototype_v4/cancer-diagnosis-relatives-age' : '/prototype_v4/cancer-diagnosis-relatives' + + const errors = [] + + // TODO: + // If not answered, throw error + // If the age started smoking is older than person's age + // based on date of birth, throw error + + if (errors.length) { + res.render(view('questions/age-started-smoking'), { + errors, + actions: { + next: '/prototype_v4/age-started-smoking', + back, + cancel: '/prototype_v4/' + } + }) + } else { + res.redirect('/prototype_v4/periods-stopped-smoking') + } +} + +exports.periodsStoppedSmoking_get = (req, res) => { + res.render(view('questions/periods-stopped-smoking'), { + actions: { + next: '/prototype_v4/periods-stopped-smoking', + back: '/prototype_v4/age-started-smoking', + cancel: '/prototype_v4/' + } + }) +} + +exports.periodsStoppedSmoking_post = (req, res) => { + const { answers } = req.session.data + const errors = [] + + if (errors.length) { + res.render(view('questions/periods-stopped-smoking'), { + errors, + actions: { + next: '/prototype_v4/periods-stopped-smoking', + back: '/prototype_v4/age-started-smoking', + cancel: '/prototype_v4/' + } + }) + } else { + if (answers.periodsStoppedSmoking === 'no') { + delete answers.yearsStoppedSmoking + } + res.redirect('/prototype_v4/type-of-smoking') + } +} + +/// ------------------------------------------------------------------------ /// +/// Tobacco +/// ------------------------------------------------------------------------ /// + +exports.typeOfSmoking_get = (req, res) => { + res.render(view('questions/type-of-smoking'), { + actions: { + next: '/prototype_v4/type-of-smoking', + back: '/prototype_v4/periods-stopped-smoking', + cancel: '/prototype_v4/' + } + }) +} + +exports.typeOfSmoking_post = (req, res) => { + const { answers } = req.session.data + const errors = [] + + if (errors.length) { + res.render(view('questions/type-of-smoking'), { + errors, + actions: { + next: '/prototype_v4/type-of-smoking', + back: '/prototype_v4/periods-stopped-smoking', + cancel: '/prototype_v4/' + } + }) + } else { + const selectedTypes = Array.isArray(answers.typeOfSmoking) + ? answers.typeOfSmoking + : [answers.typeOfSmoking].filter(Boolean) + const steps = getSmokingTypeSteps(answers) + + if (selectedTypes.includes('none')) { + res.redirect('/prototype_v4/type-of-smoking-exit') + } else if (steps.length) { + res.redirect(getSmokingTypeStepUrl(steps[0])) + } else { + res.redirect('/prototype_v4/type-of-smoking') + } + } +} + +exports.typeOfSmokingExit_get = (req, res) => { + res.render(view('questions/type-of-smoking-exit'), { + actions: { + back: '/prototype_v4/type-of-smoking' + } + }) +} + +exports.smokingFrequency_get = (req, res) => { + renderSmokingTypeQuestion(req, res, 'smoking-frequency') +} + +exports.smokingFrequency_post = (req, res) => { + const { step, steps } = getSmokingTypeStep(req, 'smoking-frequency') + const errors = [] + + if (!step) { + res.redirect('/prototype_v4/type-of-smoking') + return + } + + if (errors.length) { + renderSmokingTypeQuestion(req, res, 'smoking-frequency', errors) + } else { + res.redirect(getSmokingTypeActions(step, steps).onward) + } +} + +exports.smokingQuantity_get = (req, res) => { + renderSmokingTypeQuestion(req, res, 'smoking-quantity') +} + +exports.smokingQuantity_post = (req, res) => { + const { step, steps } = getSmokingTypeStep(req, 'smoking-quantity') + const errors = [] + + if (!step) { + res.redirect('/prototype_v4/type-of-smoking') + return + } + + if (errors.length) { + renderSmokingTypeQuestion(req, res, 'smoking-quantity', errors) + } else { + res.redirect(getSmokingTypeActions(step, steps).onward) + } +} + +exports.smokingSetting_get = (req, res) => { + renderSmokingTypeQuestion(req, res, 'smoking-setting') +} + +exports.smokingSetting_post = (req, res) => { + const { step, steps } = getSmokingTypeStep(req, 'smoking-setting') + const errors = [] + + if (!step) { + res.redirect('/prototype_v4/type-of-smoking') + return + } + + if (errors.length) { + renderSmokingTypeQuestion(req, res, 'smoking-setting', errors) + } else { + res.redirect(getSmokingTypeActions(step, steps).onward) + } +} + +exports.smokingChange_get = (req, res) => { + renderSmokingTypeQuestion(req, res, 'smoking-change') +} + +exports.smokingChange_post = (req, res) => { + const { step, steps } = getSmokingTypeStep(req, 'smoking-change') + const errors = [] + + if (!step) { + res.redirect('/prototype_v4/type-of-smoking') + return + } + + if (errors.length) { + renderSmokingTypeQuestion(req, res, 'smoking-change', errors) + } else { + res.redirect(getSmokingTypeActions(step, steps).onward) + } +} + +/// ------------------------------------------------------------------------ /// +/// Check your answers +/// ------------------------------------------------------------------------ /// + +exports.checkYourAnswers_get = (req, res) => { + + res.render(view('questions/check-your-answers'), { + actions: { + next: '/prototype_v4/check-your-answers', + back: '/prototype_v4/abc', + cancel: '/prototype_v4/' + } + }) +} + +exports.checkYourAnswers_post = (req, res) => { + res.redirect('/prototype_v4/confirmation') +} + +/// ------------------------------------------------------------------------ /// +/// Confirmation +/// ------------------------------------------------------------------------ /// + +exports.confirmation_get = (req, res) => { + res.render(view('questions/confirmation')) +} + +/// ------------------------------------------------------------------------ /// +/// Template +/// ------------------------------------------------------------------------ /// + +exports.XYZ_get = (req, res) => { + + res.render(view('questions/xyz'), { + actions: { + next: '/prototype_v4/xyz', + back: '/prototype_v4/abc', + cancel: '/prototype_v4/' + } + }) +} + +exports.XYZ_post = (req, res) => { + const { answers } = req.session.data + const errors = [] + + if (errors.length) { + res.render(view('questions/xyz'), { + errors, + actions: { + next: '/prototype_v4/xyz', + back: '/prototype_v4/abc', + cancel: '/prototype_v4/' + } + }) + } else { + res.redirect('/prototype_v4/mno') + } +} diff --git a/app/prototype_v4/routes.js b/app/prototype_v4/routes.js index d73285f..b9f4b6b 100644 --- a/app/prototype_v4/routes.js +++ b/app/prototype_v4/routes.js @@ -23,17 +23,162 @@ const hasView = (template) => { /// Controller modules - used for routing /// ------------------------------------------------------------------------ /// +const authenticationController = require('./controllers/authentication') const contentController = require('./controllers/content') const errorController = require('./controllers/error') +const questionController = require('./controllers/question') /// ------------------------------------------------------------------------ /// -/// +/// Start page /// ------------------------------------------------------------------------ /// -router.get('/prototype_v4', (_req, res) => { - res.render(view('index')) +router.get('/prototype_v4', (req, res) => { + res.redirect('/prototype_v4/start-page') }) +router.get('/prototype_v4/start-page', (req, res) => { + res.render(view('index'), { + actions: { + start: '/prototype_v4/sign-in' + } + }) +}) + +/// ------------------------------------------------------------------------ /// +/// Sign-in pages +/// ------------------------------------------------------------------------ /// + +router.get('/prototype_v4/sign-in', authenticationController.signIn_get) +router.post('/prototype_v4/sign-in', authenticationController.signIn_post) + +router.get('/prototype_v4/security-code', authenticationController.securityCode_get) +router.post('/prototype_v4/security-code', authenticationController.securityCode_post) + +router.get('/prototype_v4/sign-in-agreement', authenticationController.signInAgreement_get) +router.post('/prototype_v4/sign-in-agreement', authenticationController.signInAgreement_post) + +router.get('/prototype_v4/sign-in-agreement-declined', authenticationController.signInAgreementDeclined_get) + +/// ------------------------------------------------------------------------ /// +/// Terms and conditions page +/// ------------------------------------------------------------------------ /// + +router.get('/prototype_v4/accept-terms', questionController.acceptTerms_get) +router.post('/prototype_v4/accept-terms', questionController.acceptTerms_post) + +/// ------------------------------------------------------------------------ /// +/// Question pages +/// ------------------------------------------------------------------------ /// + +router.get('/prototype_v4/phone-questionnaire', questionController.phoneQuestionnaire_get) +router.post('/prototype_v4/phone-questionnaire', questionController.phoneQuestionnaire_post) + +router.get('/prototype_v4/phone-questionnaire-exit', questionController.phoneQuestionnaireExit_get) + +/// Eligibility ------------------------------------------------------------ /// + +router.get('/prototype_v4/smoker', questionController.smoker_get) +router.post('/prototype_v4/smoker', questionController.smoker_post) + +router.get('/prototype_v4/date-of-birth', questionController.dateOfBirth_get) +router.post('/prototype_v4/date-of-birth', questionController.dateOfBirth_post) + +router.get('/prototype_v4/face-to-face-appointment', questionController.faceToFaceAppointment_get) +router.post('/prototype_v4/face-to-face-appointment', questionController.faceToFaceAppointment_post) + +router.get('/prototype_v4/not-eligible-for-screening', questionController.notEligibleForScreening_get) + +router.get('/prototype_v4/not-eligible-for-scan', questionController.notEligibleForScan_get) + +router.get('/prototype_v4/book-appointment', questionController.bookAppointment_get) + + +/// About you -------------------------------------------------------------- /// + +router.get('/prototype_v4/height-metric', questionController.heightMetric_get) +router.post('/prototype_v4/height-metric', questionController.heightMetric_post) + +router.get('/prototype_v4/height-imperial', questionController.heightImperial_get) +router.post('/prototype_v4/height-imperial', questionController.heightImperial_post) + +router.get('/prototype_v4/weight-metric', questionController.weightMetric_get) +router.post('/prototype_v4/weight-metric', questionController.weightMetric_post) + +router.get('/prototype_v4/weight-imperial', questionController.weightImperial_get) +router.post('/prototype_v4/weight-imperial', questionController.weightImperial_post) + +router.get('/prototype_v4/sex', questionController.sex_get) +router.post('/prototype_v4/sex', questionController.sex_post) + +router.get('/prototype_v4/gender', questionController.gender_get) +router.post('/prototype_v4/gender', questionController.gender_post) + +router.get('/prototype_v4/ethnicity', questionController.ethnicity_get) +router.post('/prototype_v4/ethnicity', questionController.ethnicity_post) + +router.get('/prototype_v4/education', questionController.education_get) +router.post('/prototype_v4/education', questionController.education_post) + +/// Your health ------------------------------------------------------------ /// + +router.get('/prototype_v4/respiratory-conditions', questionController.respiratoryConditions_get) +router.post('/prototype_v4/respiratory-conditions', questionController.respiratoryConditions_post) + +router.get('/prototype_v4/asbestos-at-work', questionController.asbestosAtWork_get) +router.post('/prototype_v4/asbestos-at-work', questionController.asbestosAtWork_post) + +router.get('/prototype_v4/asbestos-at-home', questionController.asbestosAtHome_get) +router.post('/prototype_v4/asbestos-at-home', questionController.asbestosAtHome_post) + +router.get('/prototype_v4/cancer-diagnosis', questionController.cancerDiagnosis_get) +router.post('/prototype_v4/cancer-diagnosis', questionController.cancerDiagnosis_post) + +/// Family history --------------------------------------------------------- /// + +router.get('/prototype_v4/cancer-diagnosis-relatives', questionController.cancerDiagnosisRelatives_get) +router.post('/prototype_v4/cancer-diagnosis-relatives', questionController.cancerDiagnosisRelatives_post) + +router.get('/prototype_v4/cancer-diagnosis-relatives-age', questionController.cancerDiagnosisRelativesAge_get) +router.post('/prototype_v4/cancer-diagnosis-relatives-age', questionController.cancerDiagnosisRelativesAge_post) + +/// Smoking habits --------------------------------------------------------- /// + +router.get('/prototype_v4/age-started-smoking', questionController.ageStartedSmoking_get) +router.post('/prototype_v4/age-started-smoking', questionController.ageStartedSmoking_post) + +router.get('/prototype_v4/periods-stopped-smoking', questionController.periodsStoppedSmoking_get) +router.post('/prototype_v4/periods-stopped-smoking', questionController.periodsStoppedSmoking_post) + +/// Tobacco --------------------------------------------------------------- /// + +router.get('/prototype_v4/type-of-smoking', questionController.typeOfSmoking_get) +router.post('/prototype_v4/type-of-smoking', questionController.typeOfSmoking_post) + +router.get('/prototype_v4/type-of-smoking-exit', questionController.typeOfSmokingExit_get) + +router.get('/prototype_v4/smoking-frequency', questionController.smokingFrequency_get) +router.post('/prototype_v4/smoking-frequency', questionController.smokingFrequency_post) + +router.get('/prototype_v4/smoking-quantity', questionController.smokingQuantity_get) +router.post('/prototype_v4/smoking-quantity', questionController.smokingQuantity_post) + +router.get('/prototype_v4/smoking-setting', questionController.smokingSetting_get) +router.post('/prototype_v4/smoking-setting', questionController.smokingSetting_post) + +router.get('/prototype_v4/smoking-change', questionController.smokingChange_get) +router.post('/prototype_v4/smoking-change', questionController.smokingChange_post) + +// TODO: Change of amount questions + +/// Check your answers ----------------------------------------------------- /// + +router.get('/prototype_v4/check-your-answers', questionController.checkYourAnswers_get) +router.post('/prototype_v4/check-your-answers', questionController.checkYourAnswers_post) + +/// Confirmation ----------------------------------------------------------- /// + +router.get('/prototype_v4/confirmation', questionController.confirmation_get) + /// ------------------------------------------------------------------------ /// /// Static pages /// ------------------------------------------------------------------------ /// diff --git a/app/prototype_v4/views/authentication/security-code.html b/app/prototype_v4/views/authentication/security-code.html new file mode 100644 index 0000000..c9e961e --- /dev/null +++ b/app/prototype_v4/views/authentication/security-code.html @@ -0,0 +1,91 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "Enter the security code" %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + +

+ We have sent a 6-digit security code to your phone number ending in 0887. +

+ +

+ It may take a few minutes to arrive. +

+ + {% set securityCodeHtml %} +

Make sure your device:

+ +

Wait 30 seconds before you send the security code again.

+ {% endset %} + + {{ details({ + summaryText: "Not received a security code?", + html: securityCodeHtml + }) }} + +
+ + {{ input({ + id: "security-code", + name: "authentication[securityCode]", + label: { + text: "Security code", + isPageHeading: false, + classes: "nhsuk-label--s" + }, + hint: { + text: "The code is 6 digits" + }, + value: data.authentication.securityCode, + classes: "nhsuk-input--width-10" + }) }} + + {{ checkboxes({ + name: "authentication[rememberDevice]", + values: data.authentication.rememberDevice, + items: [ + { + value: "yes", + text: "Remember this device and stop sending security codes" + } + ] + }) }} + + {{ button({ + text: "Continue" + }) }} + +
+ + {% set rememberDeviceHtml %} +

We can remember the device you are using now, so you will not need to enter a security code when you log in with this device in the future.

+

To keep your NHS login secure, you should only do this on your own personal or trusted devices.

+

We may ask if you still want us to remember this device in the future.

+ {% endset %} + + {{ details({ + summaryText: "What does remember this device mean?", + html: rememberDeviceHtml + }) }} + + {% set mobileDeviceHtml %} +

If you no longer have access to it, you can change the mobile phone number you use to log in.

+ {% endset %} + + {{ details({ + summaryText: "I cannot log in using my mobile phone", + html: mobileDeviceHtml + }) }} + +
+
+{% endblock %} diff --git a/app/prototype_v4/views/authentication/sign-in-agreement-declined.html b/app/prototype_v4/views/authentication/sign-in-agreement-declined.html new file mode 100644 index 0000000..aacf829 --- /dev/null +++ b/app/prototype_v4/views/authentication/sign-in-agreement-declined.html @@ -0,0 +1,32 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "Sorry, you cannot test the online service" %} + +{% set bodyTextMarkdown %} +To test the online service, we need to confirm who you are. To do this, you need to agree to let NHS login share your information with us. + +If you do not agree to share your NHS login information, you should complete your NHS lung cancer screening by phone. + +Call us on {{ serviceTelephone | telephoneLink }} + +**Phone lines are open:** +Monday to Friday 8am to 8pm +Saturdays 8am to 1pm +{% endset %} + +{% block content %} +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + + {{ bodyTextMarkdown | markdownToHtml | safe }} + + {{ button({ + text: "Back to start page", + href: actions.back + }) }} + +
+
+{% endblock %} diff --git a/app/prototype_v4/views/authentication/sign-in-agreement.html b/app/prototype_v4/views/authentication/sign-in-agreement.html new file mode 100644 index 0000000..5612273 --- /dev/null +++ b/app/prototype_v4/views/authentication/sign-in-agreement.html @@ -0,0 +1,42 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "Agree to share your NHS login information" %} + +{% set bodyTextMarkdown %} +To continue, you need to agree to share your NHS login information with **NHS {{ serviceName | lower }}**. + +**NHS {{ serviceName | lower }}** will use your: + +- first names +- last name +- date of birth +- email address +- NHS number + +Read the terms of use and privacy policy for **NHS {{ serviceName | lower }}** to check how your information will be used. + +If you do not agree to share this information you will not be able to use NHS login with **NHS {{ serviceName | lower }}**. +{% endset %} + +{% block content %} +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + +
+ + {{ bodyTextMarkdown | markdownToHtml | safe }} + + {{ button({ + text: "I agree" + }) }} + +

+ I do not agree to share this information +

+
+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/authentication/sign-in.html b/app/prototype_v4/views/authentication/sign-in.html new file mode 100644 index 0000000..e00b7b3 --- /dev/null +++ b/app/prototype_v4/views/authentication/sign-in.html @@ -0,0 +1,96 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "Log in to your NHS account" %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + +
+ + {{ input({ + id: "email", + name: "authentication[email]", + label: { + text: "Email address", + isPageHeading: false, + classes: "nhsuk-label--s" + }, + type: "email", + autocomplete: "email", + spellcheck: false, + value: data.authentication.email, + classes: "nhsuk-input--width-20" + }) }} + + {{ input({ + id: "password", + name: "authentication[password]", + label: { + text: "Password", + isPageHeading: false, + classes: "nhsuk-label--s" + }, + type: "password", + autocomplete: "current-password", + value: data.authentication.password, + classes: "nhsuk-input--width-20" + }) }} + +

+ + Forgotten your password? + +

+ + {{ button({ + text: "Continue" + }) }} + +

+ + Log in with a passkey + +

+ +
+ +

+ or +

+ + {{ button({ + text: "Create NHS account", + href: "#", + classes: "nhsuk-button--secondary" + }) }} + +

+ An NHS account allows you to access a range of online health services with one set of login details. +

+ +

+ Learn more about NHS account. +

+ + {% set cardDescriptionHtml %} + + {% endset %} + + {{ card({ + heading: "Trouble with logging in?", + headingSize: "m", + descriptionHtml: cardDescriptionHtml + }) }} + +
+
+{% endblock %} diff --git a/app/prototype_v4/views/includes/error-summary.html b/app/prototype_v4/views/includes/error-summary.html new file mode 100644 index 0000000..14689aa --- /dev/null +++ b/app/prototype_v4/views/includes/error-summary.html @@ -0,0 +1,10 @@ +{% if errors | length %} +
+
+ {{ errorSummary({ + titleText: "There is a problem", + errorList: errors + }) if errors | length }} +
+
+{% endif %} diff --git a/app/prototype_v4/views/includes/page-heading-legend.html b/app/prototype_v4/views/includes/page-heading-legend.html new file mode 100644 index 0000000..c3bf181 --- /dev/null +++ b/app/prototype_v4/views/includes/page-heading-legend.html @@ -0,0 +1,6 @@ +{% if caption.length %} + + {{- caption -}} + +{% endif %} +{{ title }} diff --git a/app/prototype_v4/views/includes/page-heading.html b/app/prototype_v4/views/includes/page-heading.html new file mode 100644 index 0000000..0a57514 --- /dev/null +++ b/app/prototype_v4/views/includes/page-heading.html @@ -0,0 +1,8 @@ +

+ {% if caption.length %} + + {{ caption }} + + {% endif %} + {{ title }} +

diff --git a/app/prototype_v4/views/index.html b/app/prototype_v4/views/index.html index ae15f68..4a0b20c 100644 --- a/app/prototype_v4/views/index.html +++ b/app/prototype_v4/views/index.html @@ -6,7 +6,7 @@
-

{{ title }}

+ {% include "prototype_v4/views/includes/page-heading.html" %}

We are testing a new online questionnaire for lung cancer screening. This service will ask you some questions about your medical history and lifestyle.

@@ -43,13 +43,13 @@

What to expect in the online service

{{ button({ text: "Continue", - href: "start-journey", + href: actions.start, classes: "nhsuk-button--login" }) }}

If you do not want to test the online service

-

You should call us on 0207 555 444 to complete the questionnaire by phone.

+

You should call us on {{ serviceTelephone }} to complete the questionnaire by phone.

diff --git a/app/prototype_v4/views/questions/accept-terms.html b/app/prototype_v4/views/questions/accept-terms.html new file mode 100644 index 0000000..cecaabd --- /dev/null +++ b/app/prototype_v4/views/questions/accept-terms.html @@ -0,0 +1,44 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "Accept terms of use" %} + +{% set bodyTextMarkdown %} +To continue, confirm that you have read and agree to the [NHS {{ serviceName }} terms of use](/prototype_v4/terms-of-use) +{% endset %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + + {{ bodyTextMarkdown | markdownToHtml | safe }} + +
+ + {{ checkboxes({ + name: "answers[acceptTerms]", + values: data.answers.acceptTerms, + items: [ + { + value: "yes", + text: "I agree" + } + ] + }) }} + + {{ button({ + text: "Continue" + }) }} + +
+ +

+ Cancel +

+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/age-started-smoking.html b/app/prototype_v4/views/questions/age-started-smoking.html new file mode 100644 index 0000000..dc558c3 --- /dev/null +++ b/app/prototype_v4/views/questions/age-started-smoking.html @@ -0,0 +1,52 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "How old were you when you started smoking?" %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% set headingHtml %} + {% include "prototype_v4/views/includes/page-heading-legend.html" %} + {% endset %} + +
+ + {{ input({ + id: "age-started-smoking", + name: "answers[ageStartedSmoking]", + label: { + html: headingHtml, + isPageHeading: true, + classes: "nhsuk-label--l" + }, + hint: { + text: "Give an estimate if you are not sure" + }, + prefix: "Age", + value: data.answers.ageStartedSmoking, + classes: "nhsuk-input--width-2" + }) }} + + {{ button({ + text: "Continue" + }) }} + +
+ +

+ Cancel +

+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/asbestos-at-home.html b/app/prototype_v4/views/questions/asbestos-at-home.html new file mode 100644 index 0000000..e85e40a --- /dev/null +++ b/app/prototype_v4/views/questions/asbestos-at-home.html @@ -0,0 +1,81 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "Tell us if you ever lived with anyone who worked with asbestos" %} + +{% set bodyTextMarkdown %} +If you lived with someone who worked with asbestos you may have been exposed to asbestos. For example, if you washed the clothes they worked in. + +Someone might have worked with asbestos if they worked in an industry such as building or construction, particularly from the 1950s to the 1990s. +{% endset %} + +{% set detailsTextMarkdown %} +Asbestos was used in a number of building materials and products. For example: + +- boilers and pipes +- car brakes +- cement for roofing sheets +- floor tiles +- insulating board to protect buildings and ships against fire + +If you worked in an industry such as building or construction, you are more likely to have come into contact with damaged asbestos. +{% endset %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + + {{ bodyTextMarkdown | markdownToHtml | safe }} + + {{ details({ + summaryText: "What is asbestos?", + html: detailsTextMarkdown | markdownToHtml | safe + }) }} + +
+ + {{ radios({ + name: "answers[asbestosAtHome]", + fieldset: { + legend: { + text: "Have you ever lived with anyone who worked with asbestos?", + isPageHeading: false, + classes: "nhsuk-fieldset__legend--m" + } + }, + value: data.answers.asbestosAtHome, + items: [ + { + value: "yes", + text: "Yes" + }, + { + value: "no", + text: "No" + } + ] + }) }} + + {{ button({ + text: "Continue" + }) }} + +
+ +

+ Cancel +

+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/asbestos-at-work.html b/app/prototype_v4/views/questions/asbestos-at-work.html new file mode 100644 index 0000000..1652de3 --- /dev/null +++ b/app/prototype_v4/views/questions/asbestos-at-work.html @@ -0,0 +1,95 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "Tell us if you might have been exposed to asbestos at work" %} + +{% set bodyTextMarkdown %} +You may have been exposed to asbestos if you worked in an industry such as building or construction, particularly from the 1950s to the 1990s. + +You could be exposed to asbestos today if your job involves working in certain roles in old buildings. + +Examples include: + +- heating and ventilation engineers +- demolition workers +- plumbers +- construction workers +- electricians + +## If you did not work with asbestos but think you might have been exposed + +You might know there was asbestos in buildings you have spent time in, or products you have used. But if the asbestos was not damaged, the risk to your health is very low. + +If you lived with someone who worked with asbestos you may have been exposed to asbestos yourself. For example, if you washed the clothes they worked in. The question on the next page will ask if you lived with someone who might have been exposed to asbestos at work. +{% endset %} + +{% set detailsTextMarkdown %} +Asbestos was used in a number of building materials and products. For example: + +- boilers and pipes +- car brakes +- cement for roofing sheets +- floor tiles +- insulating board to protect buildings and ships against fire + +If you worked in an industry such as building or construction, you are more likely to have come into contact with damaged asbestos. +{% endset %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + + {{ bodyTextMarkdown | markdownToHtml | safe }} + + {{ details({ + summaryText: "What is asbestos?", + html: detailsTextMarkdown | markdownToHtml | safe + }) }} + +
+ + {{ radios({ + name: "answers[asbestosAtWork]", + fieldset: { + legend: { + text: "Have you ever worked in a job where you might have been exposed to asbestos?", + isPageHeading: false, + classes: "nhsuk-fieldset__legend--m" + } + }, + value: data.answers.asbestosAtWork, + items: [ + { + value: "yes", + text: "Yes" + }, + { + value: "no", + text: "No" + } + ] + }) }} + + {{ button({ + text: "Continue" + }) }} + +
+ +

+ Cancel +

+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/book-appointment.html b/app/prototype_v4/views/questions/book-appointment.html new file mode 100644 index 0000000..070f7ce --- /dev/null +++ b/app/prototype_v4/views/questions/book-appointment.html @@ -0,0 +1,55 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "Call us to book an appointment" %} + +{% set bodyTextMarkdown %} +Call us on {{ serviceTelephone | telephoneLink }} to book an appointment. If we do not hear from you in 2 weeks we will call you. + +At your face to face appointment a health professional will measure your height and weight. They will also ask you questions to check if you need a lung scan. + +**Phone lines are open:** +Monday to Friday 8am to 8pm +Saturdays 8am to 1pm +{% endset %} + +{% set cardDescriptionMarkdown %} +You have any of the following symptoms: + +- a cough that does not go away after 3 weeks +- a long-standing cough that gets worse +- [chest infections](https://www.nhs.uk/conditions/chest-infection/) that keep coming back +- [coughing up blood](https://www.nhs.uk/conditions/coughing-up-blood/) +- an ache or pain when breathing or coughing +- persistent [breathlessness](https://www.nhs.uk/conditions/shortness-of-breath/) +- persistent tiredness or lack of energy +- loss of appetite or unexplained weight loss + +They could be [symptoms of lung cancer](https://www.nhs.uk/conditions/lung-cancer/symptoms/). Your GP will ask about your general health and your symptoms. + +You may be asked to have a [blood test](https://www.nhs.uk/conditions/blood-tests/) to rule out some of the possible causes of your symptoms, such as a [chest infection](https://www.nhs.uk/conditions/chest-infection/). +{% endset %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + + {{ bodyTextMarkdown | markdownToHtml | safe }} + + {{ card({ + type: "non-urgent", + heading: "Speak to a GP if:", + descriptionHtml: cardDescriptionMarkdown | markdownToHtml | safe + }) }} + +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/cancer-diagnosis-relatives-age.html b/app/prototype_v4/views/questions/cancer-diagnosis-relatives-age.html new file mode 100644 index 0000000..22aba51 --- /dev/null +++ b/app/prototype_v4/views/questions/cancer-diagnosis-relatives-age.html @@ -0,0 +1,68 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "If your relatives were under 60 when they were diagnosed" %} + +{% set bodyTextMarkdown %} +We ask about their age when they were diagnosed with lung cancer because it may impact your chances of developing lung cancer. + +If you do not know or cannot remember, select 'I do not know'. +{% endset %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + + {{ bodyTextMarkdown | markdownToHtml | safe }} + +
+ + {{ radios({ + name: "answers[cancerDiagnosisRelativesAge]", + fieldset: { + legend: { + text: "Were any of your relatives younger than 60 years old when they were diagnosed with lung cancer?", + isPageHeading: false, + classes: "nhsuk-fieldset__legend--m" + } + }, + value: data.answers.cancerDiagnosisRelativesAge, + items: [ + { + value: "yes", + text: "Yes, they were younger than 60" + }, + { + value: "no", + text: "No, they were 60 or older" + }, + { + value: "do_not_know", + text: "I do not know" + } + ] + }) }} + + {{ button({ + text: "Continue" + }) }} + +
+ +

+ Cancel +

+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/cancer-diagnosis-relatives.html b/app/prototype_v4/views/questions/cancer-diagnosis-relatives.html new file mode 100644 index 0000000..33b0b50 --- /dev/null +++ b/app/prototype_v4/views/questions/cancer-diagnosis-relatives.html @@ -0,0 +1,68 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "Tell us if your parents, siblings or children have ever been diagnosed with lung cancer" %} + +{% set bodyTextMarkdown %} +If any of your parents, siblings or children have ever been diagnosed with lung cancer it may impact your chances of developing lung cancer. + +This question is about lung cancer rather than any other type of cancer. It does not include your grandparents or grandchildren. +{% endset %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + + {{ bodyTextMarkdown | markdownToHtml | safe }} + +
+ + {{ radios({ + name: "answers[cancerDiagnosisRelatives]", + fieldset: { + legend: { + text: "Have any of your parents, siblings or children ever been diagnosed with lung cancer?", + isPageHeading: false, + classes: "nhsuk-fieldset__legend--m" + } + }, + value: data.answers.cancerDiagnosisRelatives, + items: [ + { + value: "yes", + text: "Yes" + }, + { + value: "no", + text: "No" + }, + { + value: "do_not_know", + text: "I do not know" + } + ] + }) }} + + {{ button({ + text: "Continue" + }) }} + +
+ +

+ Cancel +

+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/cancer-diagnosis.html b/app/prototype_v4/views/questions/cancer-diagnosis.html new file mode 100644 index 0000000..d14a173 --- /dev/null +++ b/app/prototype_v4/views/questions/cancer-diagnosis.html @@ -0,0 +1,62 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "Tell us if you have ever been diagnosed with cancer" %} + +{% set bodyTextMarkdown %} +If you have ever been diagnosed with any type of cancer it may impact your chances of developing lung cancer. +{% endset %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + + {{ bodyTextMarkdown | markdownToHtml | safe }} + +
+ + {{ radios({ + name: "answers[cancerDiagnosis]", + fieldset: { + legend: { + text: "Have you ever been diagnosed with cancer?", + isPageHeading: false, + classes: "nhsuk-fieldset__legend--m" + } + }, + value: data.answers.cancerDiagnosis, + items: [ + { + value: "yes", + text: "Yes" + }, + { + value: "no", + text: "No" + } + ] + }) }} + + {{ button({ + text: "Continue" + }) }} + +
+ +

+ Cancel +

+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/check-your-answers.html b/app/prototype_v4/views/questions/check-your-answers.html new file mode 100644 index 0000000..bba930c --- /dev/null +++ b/app/prototype_v4/views/questions/check-your-answers.html @@ -0,0 +1,40 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "Check your answers" %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + +

+ Check the information you have given us. If any of the details are wrong, you can change them. +

+ +
+ + + + {{ button({ + text: "Submit" + }) }} + +
+ +

+ Cancel +

+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/confirmation.html b/app/prototype_v4/views/questions/confirmation.html new file mode 100644 index 0000000..7918f17 --- /dev/null +++ b/app/prototype_v4/views/questions/confirmation.html @@ -0,0 +1,19 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "Thank you for testing the online service" %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {{ panel({ + titleText: title + }) }} + + + +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/date-of-birth.html b/app/prototype_v4/views/questions/date-of-birth.html new file mode 100644 index 0000000..10889a0 --- /dev/null +++ b/app/prototype_v4/views/questions/date-of-birth.html @@ -0,0 +1,76 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "What is your date of birth?" %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% set headingHtml %} + {% include "prototype_v4/views/includes/page-heading-legend.html" %} + {% endset %} + +
+ + {{ dateInput({ + id: "dateOfBirth", + fieldset: { + legend: { + html: headingHtml, + isPageHeading: true, + classes: "nhsuk-fieldset__legend--l" + } + }, + hint: { + text: "For example, 15 3 1964" + }, + errorMessage: { + text: errors[0].text + } if errors | length, + items: [ + { + id: "dateOfBirth-day", + name: "answers[dateOfBirth][day]", + label: "Day", + value: data.answers.dateOfBirth.day, + classes: "nhsuk-input--width-2" + }, + { + id: "dateOfBirth-month", + name: "answers[dateOfBirth][month]", + label: "Month", + value: data.answers.dateOfBirth.month, + classes: "nhsuk-input--width-2" + }, + { + id: "dateOfBirth-year", + name: "answers[dateOfBirth][year]", + label: "Year", + value: data.answers.dateOfBirth.year, + classes: "nhsuk-input--width-4" + } + ] + }) }} + + {{ button({ + text: "Continue" + }) }} + +
+ +

+ Cancel +

+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/education.html b/app/prototype_v4/views/questions/education.html new file mode 100644 index 0000000..4b473e4 --- /dev/null +++ b/app/prototype_v4/views/questions/education.html @@ -0,0 +1,102 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "Your education" %} + +{% set bodyTextMarkdown %} +We ask this question because education is linked to other factors that may impact your chances of developing lung cancer. + +If your qualification is not shown choose the closest level. +{% endset %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + + {{ bodyTextMarkdown | markdownToHtml | safe }} + +
+ + {{ radios({ + name: "answers[education]", + fieldset: { + legend: { + text: "What is the highest level of education have you completed?", + isPageHeading: false, + classes: "nhsuk-fieldset__legend--m" + } + }, + value: data.answers.education, + items: [ + { + value: "before_15", + text: "I finished school before the age of 15" + }, + { + value: "gcse", + text: "GCSEs", + hint: { + text: "Previously O-levels" + } + }, + { + value: "a_level", + text: "A-levels", + hint: { + text: "Previously Higher School Certificate (HSC)" + } + }, + { + value: "further_education", + text: "Further education", + hint: { + text: "For example, apprenticeships or Higher National Certificates (HNC)" + } + }, + { + value: "undergraduate_degree", + text: "Undergraduate degree", + hint: { + text: "A university degree, also known as a bachelor’s degree" + } + }, + { + value: "postgraduate_degree", + text: "Postgraduate degree", + hint: { + text: "For example, a Masters or PhD" + } + }, + { + divider: "or" + }, + { + value: "prefer_not_to_say", + text: "I prefer not to say" + } + ] + }) }} + + {{ button({ + text: "Continue" + }) }} + +
+ +

+ Cancel +

+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/ethnicity.html b/app/prototype_v4/views/questions/ethnicity.html new file mode 100644 index 0000000..2f0343a --- /dev/null +++ b/app/prototype_v4/views/questions/ethnicity.html @@ -0,0 +1,81 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "Your ethnic background" %} + +{% set bodyTextMarkdown %} +We ask this question because your ethnicity may impact your chances of developing lung cancer. +{% endset %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + + {{ bodyTextMarkdown | markdownToHtml | safe }} + +
+ + {{ radios({ + name: "answers[ethnicity]", + fieldset: { + legend: { + text: "What is your ethnic background?", + isPageHeading: false, + classes: "nhsuk-fieldset__legend--m" + } + }, + value: data.answers.ethnicity, + items: [ + { + value: "asian_or_asian_british", + text: "Asian or Asian British" + }, + { + value: "black_african_caribbean_or_black british", + text: "Black, African, Caribbean or Black British" + }, + { + value: "mixed_or_multiple_ethnic_groups", + text: "Mixed or multiple ethnic groups" + }, + { + value: "white", + text: "White" + }, + { + value: "other_ethnic_group", + text: "Other ethnic group" + }, + { + divider: "or" + }, + { + value: "prefer_not_to_say", + text: "I prefer not to say" + } + ] + }) }} + + {{ button({ + text: "Continue" + }) }} + +
+ +

+ Cancel +

+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/face-to-face-appointment.html b/app/prototype_v4/views/questions/face-to-face-appointment.html new file mode 100644 index 0000000..0e3be05 --- /dev/null +++ b/app/prototype_v4/views/questions/face-to-face-appointment.html @@ -0,0 +1,69 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "Check if you need a face-to-face appointment" %} + +{% set bodyTextMarkdown %} +This online service uses automatic calculations based on your height and weight. This means it is not suitable for everyone. + +You need to do your questionnaire in person, not online, if you: + +- have a condition that affects your height +- have had a limb amputation, or were born with a limb difference +- have been diagnosed with an eating disorder, or think you may have one +- are pregnant +{% endset %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + + {{ bodyTextMarkdown | markdownToHtml | safe }} + +
+ + {{ radios({ + name: "answers[faceToFaceAppointment]", + fieldset: { + legend: { + text: "Do you need to leave the online service and ask for a face-to-face appointment?", + isPageHeading: false, + classes: "nhsuk-fieldset__legend--m" + } + }, + value: data.answers.faceToFaceAppointment, + items: [ + { + value: "yes", + text: "Yes, one or more of these things applies to me and I need a face-to-face appointment" + }, + { + value: "no", + text: "No, I can continue online" + } + ] + }) }} + + {{ button({ + text: "Continue" + }) }} + +
+ +

+ Cancel +

+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/gender.html b/app/prototype_v4/views/questions/gender.html new file mode 100644 index 0000000..e2b698e --- /dev/null +++ b/app/prototype_v4/views/questions/gender.html @@ -0,0 +1,75 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "Your gender identity" %} + +{% set bodyTextMarkdown %} +The answers you submit will not be shared with your patient care advisor during your phone appointment, or with your GP. + +In the future we plan to use information about someone's gender identity to help us plan their care in the NHS lung cancer screening programme. +{% endset %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + + {{ bodyTextMarkdown | markdownToHtml | safe }} + +
+ + {{ radios({ + name: "answers[gender]", + fieldset: { + legend: { + text: "Which of these best describes you?", + isPageHeading: false, + classes: "nhsuk-fieldset__legend--m" + } + }, + value: data.answers.gender, + items: [ + { + value: "female", + text: "Female" + }, + { + value: "male", + text: "Male" + }, + { + value: "non_binary", + text: "Non-binary" + }, + { + divider: "or" + }, + { + value: "prefer_not_to_say", + text: "I prefer not to say" + } + ] + }) }} + + {{ button({ + text: "Continue" + }) }} + +
+ +

+ Cancel +

+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/height-imperial.html b/app/prototype_v4/views/questions/height-imperial.html new file mode 100644 index 0000000..c9d995c --- /dev/null +++ b/app/prototype_v4/views/questions/height-imperial.html @@ -0,0 +1,84 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "Your height" %} + +{% set bodyTextMarkdown %} +An accurate measurement is important. + +You can measure your height at home with a measuring tape. Some pharmacies and gyms have machines to measure your height. +{% endset %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + + {{ bodyTextMarkdown | markdownToHtml | safe }} + +
+ + {% call fieldset({ + legend: { + text: "What is your height in feet and inches?", + classes: "nhsuk-fieldset__legend--m", + isPageHeading: false + } + }) %} + +
+
+ {{ input({ + id: "height-imperial-feet", + name: "answers[height][imperial][feet]", + label: { + text: "Feet" + }, + suffix: "ft", + value: data.answers.height.imperial.feet, + classes: "nhsuk-input--width-4" + }) }} +
+ +
+ {{ input({ + id: "height-imperial-inches", + name: "answers[height][imperial][inches]", + label: { + text: "Inches" + }, + suffix: "in", + value: data.answers.height.imperial.inches, + classes: "nhsuk-input--width-4" + }) }} +
+
+ + {% endcall %} + +

+ Switch to centimetres +

+ + {{ button({ + text: "Continue" + }) }} + +
+ +

+ Cancel +

+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/height-metric.html b/app/prototype_v4/views/questions/height-metric.html new file mode 100644 index 0000000..2d02fe6 --- /dev/null +++ b/app/prototype_v4/views/questions/height-metric.html @@ -0,0 +1,59 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "Your height" %} + +{% set bodyTextMarkdown %} +An accurate measurement is important. + +You can measure your height at home with a measuring tape. Some pharmacies and gyms have machines to measure your height. +{% endset %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + + {{ bodyTextMarkdown | markdownToHtml | safe }} + +
+ + {{ input({ + id: "height-metric", + name: "answers[height][metric]", + label: { + text: "What is your height in centimetres?", + isPageHeading: false, + classes: "nhsuk-label--m" + }, + suffix: "cm", + value: data.answers.height.metric, + classes: "nhsuk-input--width-4" + }) }} + +

+ Switch to feet and inches +

+ + {{ button({ + text: "Continue" + }) }} + +
+ +

+ Cancel +

+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/not-eligible-for-scan.html b/app/prototype_v4/views/questions/not-eligible-for-scan.html new file mode 100644 index 0000000..4acb448 --- /dev/null +++ b/app/prototype_v4/views/questions/not-eligible-for-scan.html @@ -0,0 +1,51 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "You are not eligible for an NHS lung scan" %} + +{% set bodyTextMarkdown %} +The NHS lung scan is for people between the ages of 55 and 74. + +According to your date of birth you are not in this age range. +{% endset %} + +{% set cardDescriptionMarkdown %} +You have any of the following symptoms: + +- a cough that does not go away after 3 weeks +- a long-standing cough that gets worse +- [chest infections](https://www.nhs.uk/conditions/chest-infection/) that keep coming back +- [coughing up blood](https://www.nhs.uk/conditions/coughing-up-blood/) +- an ache or pain when breathing or coughing +- persistent [breathlessness](https://www.nhs.uk/conditions/shortness-of-breath/) +- persistent tiredness or lack of energy +- loss of appetite or unexplained weight loss + +They could be [symptoms of lung cancer](https://www.nhs.uk/conditions/lung-cancer/symptoms/). Your GP will ask about your general health and your symptoms. + +You may be asked to have a [blood test](https://www.nhs.uk/conditions/blood-tests/) to rule out some of the possible causes of your symptoms, such as a [chest infection](https://www.nhs.uk/conditions/chest-infection/). +{% endset %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + + {{ bodyTextMarkdown | markdownToHtml | safe }} + + {{ card({ + type: "non-urgent", + heading: "Speak to a GP if:", + descriptionHtml: cardDescriptionMarkdown | markdownToHtml | safe + }) }} + +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/not-eligible-for-screening.html b/app/prototype_v4/views/questions/not-eligible-for-screening.html new file mode 100644 index 0000000..0fc2188 --- /dev/null +++ b/app/prototype_v4/views/questions/not-eligible-for-screening.html @@ -0,0 +1,49 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "You are not eligible for lung cancer screening" %} + +{% set bodyTextMarkdown %} +You told us you have never smoked or have smoked fewer than 100 cigarettes in your lifetime. This means you are not eligible for NHS lung cancer screening. +{% endset %} + +{% set cardDescriptionMarkdown %} +You have any of the following symptoms: + +- a cough that does not go away after 3 weeks +- a long-standing cough that gets worse +- [chest infections](https://www.nhs.uk/conditions/chest-infection/) that keep coming back +- [coughing up blood](https://www.nhs.uk/conditions/coughing-up-blood/) +- an ache or pain when breathing or coughing +- persistent [breathlessness](https://www.nhs.uk/conditions/shortness-of-breath/) +- persistent tiredness or lack of energy +- loss of appetite or unexplained weight loss + +They could be [symptoms of lung cancer](https://www.nhs.uk/conditions/lung-cancer/symptoms/). Your GP will ask about your general health and your symptoms. + +You may be asked to have a [blood test](https://www.nhs.uk/conditions/blood-tests/) to rule out some of the possible causes of your symptoms, such as a [chest infection](https://www.nhs.uk/conditions/chest-infection/). +{% endset %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + + {{ bodyTextMarkdown | markdownToHtml | safe }} + + {{ card({ + type: "non-urgent", + heading: "Speak to a GP if:", + descriptionHtml: cardDescriptionMarkdown | markdownToHtml | safe + }) }} + +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/periods-stopped-smoking.html b/app/prototype_v4/views/questions/periods-stopped-smoking.html new file mode 100644 index 0000000..cb10af0 --- /dev/null +++ b/app/prototype_v4/views/questions/periods-stopped-smoking.html @@ -0,0 +1,85 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "Periods when you stopped smoking" %} + +{% set bodyTextMarkdown %} +There may have been periods when you stopped or quit smoking. + +If you stopped smoking for periods of 1 year or longer, tell us the total number of years you stopped smoking. +{% endset %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + + {{ bodyTextMarkdown | markdownToHtml | safe }} + +
+ + {% set conditionalHtml %} + {{ input({ + id: "years-stopped-smoking", + name: "answers[yearsStoppedSmoking]", + label: { + text: "Enter the total number of years you stopped smoking", + isPageHeading: false, + classes: "nhsuk-label--s" + }, + hint: { + text: "Give an estimate if you are not sure" + }, + suffix: "Years", + value: data.answers.yearsStoppedSmoking, + classes: "nhsuk-input--width-4" + }) }} + {% endset %} + + {{ radios({ + name: "answers[periodsStoppedSmoking]", + fieldset: { + legend: { + text: "Have you ever stopped smoking for periods of 1 year or longer?", + isPageHeading: false, + classes: "nhsuk-fieldset__legend--m" + } + }, + value: data.answers.periodsStoppedSmoking, + items: [ + { + value: "yes", + text: "Yes", + conditional: { + html: conditionalHtml + } + }, + { + value: "no", + text: "No" + } + ] + }) }} + + {{ button({ + text: "Continue" + }) }} + +
+ +

+ Cancel +

+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/phone-questionnaire-exit.html b/app/prototype_v4/views/questions/phone-questionnaire-exit.html new file mode 100644 index 0000000..8e1a60e --- /dev/null +++ b/app/prototype_v4/views/questions/phone-questionnaire-exit.html @@ -0,0 +1,53 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "You do not need to test the online service" %} + +{% set bodyTextMarkdown %} +Because you have completed the questionnaire by phone you do not need to test the online service. This is because the online service asks the same questions. + +Find out more about NHS lung cancer screening in [North West and South West London](https://www.healthylondon.org/our-work/lung-health-check/). +{% endset %} + +{% set cardDescriptionMarkdown %} +You have any of the following symptoms: + +- a cough that does not go away after 3 weeks +- a long-standing cough that gets worse +- [chest infections](https://www.nhs.uk/conditions/chest-infection/) that keep coming back +- [coughing up blood](https://www.nhs.uk/conditions/coughing-up-blood/) +- an ache or pain when breathing or coughing +- persistent [breathlessness](https://www.nhs.uk/conditions/shortness-of-breath/) +- persistent tiredness or lack of energy +- loss of appetite or unexplained weight loss + +They could be [symptoms of lung cancer](https://www.nhs.uk/conditions/lung-cancer/symptoms/). Your GP will ask about your general health and your symptoms. + +You may be asked to have a [blood test](https://www.nhs.uk/conditions/blood-tests/) to rule out some of the possible causes of your symptoms, such as a [chest infection](https://www.nhs.uk/conditions/chest-infection/). +{% endset %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + + {{ bodyTextMarkdown | markdownToHtml | safe }} + + {{ card({ + type: "non-urgent", + heading: "Speak to a GP if:", + descriptionHtml: cardDescriptionMarkdown | markdownToHtml | safe + }) }} + +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/phone-questionnaire.html b/app/prototype_v4/views/questions/phone-questionnaire.html new file mode 100644 index 0000000..d6537ee --- /dev/null +++ b/app/prototype_v4/views/questions/phone-questionnaire.html @@ -0,0 +1,71 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "Confirm if you have completed a lung cancer risk questionnaire by phone" %} + +{% set bodyTextMarkdown %} +If you have already completed a questionnaire about your lung health or lung cancer risk by phone you do not need to test the online service. This is because the online service asks the same questions. + +The questionnaire would have asked you questions about: + +- your height and weight +- your ethnicity +- your education +- if you have ever had a cancer diagnosis +- if your parents, siblings, or children have ever had a lung cancer diagnosis +- your smoking habits +{% endset %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + + {{ bodyTextMarkdown | markdownToHtml | safe }} + +
+ + {{ radios({ + name: "answers[phoneQuestionnaire]", + fieldset: { + legend: { + text: "Have you previously completed a lung cancer risk questionnaire by phone?", + isPageHeading: false, + classes: "nhsuk-fieldset__legend--m" + } + }, + value: data.answers.phoneQuestionnaire, + items: [ + { + value: "yes", + text: "Yes" + }, + { + value: "no", + text: "No" + } + ] + }) }} + + {{ button({ + text: "Continue" + }) }} + +
+ +

+ Cancel +

+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/respiratory-conditions.html b/app/prototype_v4/views/questions/respiratory-conditions.html new file mode 100644 index 0000000..5576e9d --- /dev/null +++ b/app/prototype_v4/views/questions/respiratory-conditions.html @@ -0,0 +1,102 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "Have you ever been diagnosed with any of the following respiratory conditions?" %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% set headingHtml %} + {% include "prototype_v4/views/includes/page-heading-legend.html" %} + {% endset %} + +
+ + {{ checkboxes({ + name: "answers[respiratoryConditions]", + fieldset: { + legend: { + html: headingHtml, + isPageHeading: true, + classes: "nhsuk-fieldset__legend--l" + } + }, + hint: { + text: "Select all that apply" + }, + values: data.answers.respiratoryConditions, + items: [ + { + value: "pneumonia", + text: "Pneumonia", + hint: { + text: "An infection of the lungs, usually diagnosed by a chest x-ray" + }, + exclusiveGroup: "conditions-list" + }, + { + value: "emphysema", + text: "Emphysema", + hint: { + text: "Damage to the air sacs in the lungs" + }, + exclusiveGroup: "conditions-list" + }, + { + value: "bronchitis", + text: "Bronchitis", + hint: { + text: "An inflammation of the airways in the lungs that is usually caused by an infection" + }, + exclusiveGroup: "conditions-list" + }, + { + value: "tuberculosis", + text: "Tuberculosis (TB)", + hint: { + text: "An infection that usually affects the lungs, but can affect any part of the body" + }, + exclusiveGroup: "conditions-list" + }, + { + value: "chronic_obstructive_pulmonary_disease", + text: "Chronic obstructive pulmonary disease (COPD)", + hint: { + text: "A group of lung conditions that cause breathing difficulties" + }, + exclusiveGroup: "conditions-list" + }, + { + divider: "or" + }, + { + value: "no", + text: "No, I have not had any of these respiratory conditions", + exclusive: true, + exclusiveGroup: "conditions-list" + } + ] + }) }} + + {{ button({ + text: "Continue" + }) }} + +
+ +

+ Cancel +

+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/sex.html b/app/prototype_v4/views/questions/sex.html new file mode 100644 index 0000000..6271edb --- /dev/null +++ b/app/prototype_v4/views/questions/sex.html @@ -0,0 +1,62 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "Your sex at birth" %} + +{% set bodyTextMarkdown %} +Your sex may impact your chances of developing lung cancer. +{% endset %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + + {{ bodyTextMarkdown | markdownToHtml | safe }} + +
+ + {{ radios({ + name: "answers[sex]", + fieldset: { + legend: { + text: "What was your sex at birth?", + isPageHeading: false, + classes: "nhsuk-fieldset__legend--m" + } + }, + value: data.answers.sex, + items: [ + { + value: "female", + text: "Female" + }, + { + value: "male", + text: "Male" + } + ] + }) }} + + {{ button({ + text: "Continue" + }) }} + +
+ +

+ Cancel +

+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/smoker.html b/app/prototype_v4/views/questions/smoker.html new file mode 100644 index 0000000..7ccdcf1 --- /dev/null +++ b/app/prototype_v4/views/questions/smoker.html @@ -0,0 +1,82 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "Tobacco smoking" %} + +{% set bodyTextMarkdown %} +We will ask you questions about your smoking habits. This includes different types of tobacco smoking such as: + +- cigarettes from a packet +- rolling tobacco, or roll ups +- a pipe +- cigars +- cigarillos +- shisha + +It does not currently include vaping or e-cigarettes. +{% endset %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + + {{ bodyTextMarkdown | markdownToHtml | safe }} + +
+ + {{ radios({ + name: "answers[smoker]", + fieldset: { + legend: { + text: "Have you ever smoked tobacco?", + isPageHeading: false, + classes: "nhsuk-fieldset__legend--m" + } + }, + hint: { + text: "This includes social smoking" + }, + value: data.answers.smoker, + items: [ + { + value: "yes_current", + text: "Yes, I currently smoke" + }, + { + value: "yes_previous", + text: "Yes, I used to smoke" + }, + { + value: "yes_fewer_than_100", + text: "Yes, but I have smoked fewer than 100 cigarettes in my lifetime" + }, + { + value: "no", + text: "No, I have never smoked" + } + ] + }) }} + + {{ button({ + text: "Continue" + }) }} + +
+ +

+ Cancel +

+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/smoking-change.html b/app/prototype_v4/views/questions/smoking-change.html new file mode 100644 index 0000000..d886393 --- /dev/null +++ b/app/prototype_v4/views/questions/smoking-change.html @@ -0,0 +1,73 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = smokingType.changeHeading %} +{% set caption = smokingType.caption %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% set legendText %} + {% include "prototype_v4/views/includes/page-heading-legend.html" %} + {% endset %} + +
+ + {{ checkboxes({ + name: "answers[" + type + "][smokingChange]", + fieldset: { + legend: { + text: legendText, + isPageHeading: true, + classes: "nhsuk-fieldset__legend--l" + } + }, + hint: { + text: "Select all that apply" + }, + values: data.answers[type].smokingChange, + items: [ + { + value: "more", + text: "Yes, I used to smoke more " + smokingType.quantityUnit + " a day", + exclusiveGroup: "change-list" + }, + { + value: "fewer", + text: "Yes, I used to smoke fewer " + smokingType.quantityUnit + " a day", + exclusiveGroup: "change-list" + }, + { + divider: "or" + }, + { + value: "no", + text: "No, it has not changed", + exclusive: true, + exclusiveGroup: "change-list" + } + ] + }) }} + + {{ button({ + text: "Continue" + }) }} + +
+ +

+ Cancel +

+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/smoking-frequency.html b/app/prototype_v4/views/questions/smoking-frequency.html new file mode 100644 index 0000000..40cfcfb --- /dev/null +++ b/app/prototype_v4/views/questions/smoking-frequency.html @@ -0,0 +1,76 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = smokingType.frequencyHeading %} +{% set caption = smokingType.caption %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% set headingText %} + {% include "prototype_v4/views/includes/page-heading-legend.html" %} + {% endset %} + +
+ + {{ radios({ + name: "answers[" + type + "][smokingFrequency]", + fieldset: { + legend: { + text: headingText, + isPageHeading: true, + classes: "nhsuk-fieldset__legend--l" + } + }, + value: data.answers[type].smokingFrequency, + items: [ + { + value: "daily", + text: "Daily" + }, + { + value: "weekly", + text: "Weekly", + hint: { + text: "For example, on the weekend" + } + }, + { + value: "monthly", + text: "Monthly", + hint: { + text: "Select this option if you smoke at least once a month" + } + }, + { + value: "yearly", + text: "Yearly", + hint: { + text: "For example, 2 to 3 times a year or fewer" + } + } + ] + }) }} + + {{ button({ + text: "Continue" + }) }} + +
+ +

+ Cancel +

+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/smoking-quantity.html b/app/prototype_v4/views/questions/smoking-quantity.html new file mode 100644 index 0000000..61da37d --- /dev/null +++ b/app/prototype_v4/views/questions/smoking-quantity.html @@ -0,0 +1,133 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = smokingType.quantityHeading %} +{% set caption = smokingType.caption %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% set headingText %} + {% include "prototype_v4/views/includes/page-heading-legend.html" %} + {% endset %} + +
+ + {% if type == "rolling_tobacco" %} + + {{ radios({ + name: "answers[" + type + "][smokingQuantity]", + fieldset: { + legend: { + text: headingText, + isPageHeading: true, + classes: "nhsuk-fieldset__legend--l" + } + }, + hint: { + text: "Give an estimate if you are not sure" + }, + value: data.answers[type].smokingQuantity, + items: [ + { + value: "less_than_10", + text: "Less than 10g" + }, + { + value: "10_to_30", + text: "10g to 30g" + }, + { + value: "31_to_50", + text: "31g to 50g" + }, + { + value: "51_to_75", + text: "51g to 75g" + }, + { + value: "76_to_100", + text: "76g to 100g" + }, + { + value: "more_than_100", + text: "More than 100g" + } + ] + }) }} + + {% else %} + + {{ input({ + id: "smoking-quantity", + name: "answers[" + type + "][smokingQuantity]", + label: { + text: headingText, + isPageHeading: true, + classes: "nhsuk-label--l" + }, + hint: { + text: "Give an estimate if you are not sure" + }, + suffix: smokingType.suffix, + value: data.answers[type].smokingQuantity, + classes: "nhsuk-input--width-4" + }) }} + + {% endif %} + + {# {{ radios({ + name: "answers[" + type + "][smokingQuantity]", + fieldset: { + legend: { + text: headingText, + isPageHeading: true, + classes: "nhsuk-fieldset__legend--l" + } + }, + hint: { + text: "Give an estimate if you are not sure" + }, + value: data.answers[type].smokingQuantity, + items: [ + { + value: "0_to_10", + text: "Up to 10" + }, + { + value: "11_to_20", + text: "11 to 20" + }, + { + value: "21_to_30", + text: "21 to 30" + }, + { + value: "more_than_30", + text: "More than 30" + } + ] + }) }} #} + + {{ button({ + text: "Continue" + }) }} + +
+ +

+ Cancel +

+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/smoking-setting.html b/app/prototype_v4/views/questions/smoking-setting.html new file mode 100644 index 0000000..2430ba1 --- /dev/null +++ b/app/prototype_v4/views/questions/smoking-setting.html @@ -0,0 +1,63 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = smokingType.settingHeading %} +{% set caption = smokingType.caption %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ +
+ + {% set legendText %} + {% include "prototype_v4/views/includes/page-heading-legend.html" %} + {% endset %} + + {{ radios({ + name: "answers[" + type + "][smokingSetting]", + fieldset: { + legend: { + text: legendText, + isPageHeading: true, + classes: "nhsuk-fieldset__legend--l" + } + }, + value: data.answers[type].smokingSetting, + items: [ + { + value: "group", + text: "In a group" + }, + { + value: "own", + text: "On my own" + }, + { + value: "both", + text: "Both" + } + ] + }) }} + + {{ button({ + text: "Continue" + }) }} + +
+ +

+ Cancel +

+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/type-of-smoking-exit.html b/app/prototype_v4/views/questions/type-of-smoking-exit.html new file mode 100644 index 0000000..e4af1ff --- /dev/null +++ b/app/prototype_v4/views/questions/type-of-smoking-exit.html @@ -0,0 +1,49 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "You are not eligible for lung cancer screening" %} + +{% set bodyTextMarkdown %} +You told us you have never smoked the types of tobacco listed. This means you are not eligible for NHS lung cancer screening. +{% endset %} + +{% set cardDescriptionMarkdown %} +You have any of the following symptoms: + +- a cough that does not go away after 3 weeks +- a long-standing cough that gets worse +- [chest infections](https://www.nhs.uk/conditions/chest-infection/) that keep coming back +- [coughing up blood](https://www.nhs.uk/conditions/coughing-up-blood/) +- an ache or pain when breathing or coughing +- persistent [breathlessness](https://www.nhs.uk/conditions/shortness-of-breath/) +- persistent tiredness or lack of energy +- loss of appetite or unexplained weight loss + +They could be [symptoms of lung cancer](https://www.nhs.uk/conditions/lung-cancer/symptoms/). Your GP will ask about your general health and your symptoms. + +You may be asked to have a [blood test](https://www.nhs.uk/conditions/blood-tests/) to rule out some of the possible causes of your symptoms, such as a [chest infection](https://www.nhs.uk/conditions/chest-infection/). +{% endset %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + + {{ bodyTextMarkdown | markdownToHtml | safe }} + + {{ card({ + type: "non-urgent", + heading: "Speak to a GP if:", + descriptionHtml: cardDescriptionMarkdown | markdownToHtml | safe + }) }} + +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/type-of-smoking.html b/app/prototype_v4/views/questions/type-of-smoking.html new file mode 100644 index 0000000..f104a9c --- /dev/null +++ b/app/prototype_v4/views/questions/type-of-smoking.html @@ -0,0 +1,122 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "The type of tobacco you smoke or used to smoke" %} + +{% set bodyTextMarkdown %} +Smoking affects your health in different ways depending on what you smoke. + +We need to know what you smoke, or used to smoke, frequently. For example, if you have smoked a pipe on a weekly basis for a year or longer. + +You do not need to tell us about less frequent forms of smoking. For example, a cigar on special occasions. +{% endset %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + + {{ bodyTextMarkdown | markdownToHtml | safe }} + +
+ + {{ checkboxes({ + name: "answers[typeOfSmoking]", + fieldset: { + legend: { + text: "What do you or have you smoked?", + isPageHeading: false, + classes: "nhsuk-fieldset__legend--m" + } + }, + hint: { + text: "Select all that apply" + }, + values: data.answers.typeOfSmoking, + items: [ + { + value: "cigarettes", + text: "Cigarettes", + exclusiveGroup: "types-list" + }, + { + value: "rolling_tobacco", + text: "Rolling tobacco, or roll-ups", + exclusiveGroup: "types-list" + }, + { + value: "pipes", + text: "Pipes", + exclusiveGroup: "types-list" + }, + { + value: "small_cigars", + text: "Small cigars", + hint: { + text: "Petit Corona or Short Panetela, usually 4 to 5 inches long" + }, + exclusiveGroup: "types-list" + }, + { + value: "medium_cigars", + text: "Medium cigars", + hint: { + text: "Robusto or Corona, usually 5 to 6 inches long" + }, + exclusiveGroup: "types-list" + }, + { + value: "large_cigars", + text: "Large cigars", + hint: { + text: "Churchill or Double Corona, usually 7 to 8 inches long" + }, + exclusiveGroup: "types-list" + }, + { + value: "cigarillos", + text: "Cigarillos", + hint: { + text: "Cafe Creme or Signature cigars, roughly the size of a cigarette" + }, + exclusiveGroup: "types-list" + }, + { + value: "shisha", + text: "Shisha", + exclusiveGroup: "types-list" + }, + { + divider: "or" + }, + { + value: "none", + text: "I have not smoked any of these types of tobacco", + exclusive: true, + exclusiveGroup: "types-list" + } + ] + }) }} + + {{ button({ + text: "Continue" + }) }} + +
+ +

+ Cancel +

+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/weight-imperial.html b/app/prototype_v4/views/questions/weight-imperial.html new file mode 100644 index 0000000..4ea7afe --- /dev/null +++ b/app/prototype_v4/views/questions/weight-imperial.html @@ -0,0 +1,84 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "Your weight" %} + +{% set bodyTextMarkdown %} +An accurate measurement is important. + +If you have digital scales, use these to check your weight. Some pharmacies and gyms have scales where you can check for free. +{% endset %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + + {{ bodyTextMarkdown | markdownToHtml | safe }} + +
+ + {% call fieldset({ + legend: { + text: "What is your weight in stones and pounds?", + classes: "nhsuk-fieldset__legend--m", + isPageHeading: false + } + }) %} + +
+
+ {{ input({ + id: "weight-imperial-stones", + name: "answers[weight][imperial][stones]", + label: { + text: "Stones" + }, + suffix: "st", + value: data.answers.weight.imperial.stones, + classes: "nhsuk-input--width-4" + }) }} +
+ +
+ {{ input({ + id: "weight-imperial-pounds", + name: "answers[weight][imperial][pounds]", + label: { + text: "Pounds" + }, + suffix: "lb", + value: data.answers.weight.imperial.pounds, + classes: "nhsuk-input--width-4" + }) }} +
+
+ + {% endcall %} + +

+ Switch to kilograms +

+ + {{ button({ + text: "Continue" + }) }} + +
+ +

+ Cancel +

+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/weight-metric.html b/app/prototype_v4/views/questions/weight-metric.html new file mode 100644 index 0000000..9725cde --- /dev/null +++ b/app/prototype_v4/views/questions/weight-metric.html @@ -0,0 +1,59 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "Your weight" %} + +{% set bodyTextMarkdown %} +An accurate measurement is important. + +If you have digital scales, use these to check your weight. Some pharmacies and gyms have scales where you can check for free. +{% endset %} + +{% block beforeContent %} +{{ backLink({ + text: "Back", + href: actions.back +}) }} +{% endblock %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + + {{ bodyTextMarkdown | markdownToHtml | safe }} + +
+ + {{ input({ + id: "weight-metric", + name: "answers[weight][metric]", + label: { + text: "What is your weight in kilograms?", + isPageHeading: false, + classes: "nhsuk-label--m" + }, + suffix: "kg", + value: data.answers.weight.metric, + classes: "nhsuk-input--width-4" + }) }} + +

+ Switch to stones and pounds +

+ + {{ button({ + text: "Continue" + }) }} + +
+ +

+ Cancel +

+ +
+
+{% endblock %} diff --git a/app/prototype_v4/views/questions/xyz.html b/app/prototype_v4/views/questions/xyz.html new file mode 100644 index 0000000..c3a34eb --- /dev/null +++ b/app/prototype_v4/views/questions/xyz.html @@ -0,0 +1,25 @@ +{% extends "prototype_v4/views/layouts/main.html" %} + +{% set title = "XYZ" %} + +{% block content %} + {% include "prototype_v4/views/includes/error-summary.html" %} + +
+
+ + {% include "prototype_v4/views/includes/page-heading.html" %} + +
+ + + + {{ button({ + text: "Continue" + }) }} + +
+ +
+
+{% endblock %} diff --git a/app/views/index.html b/app/views/index.html index b2d91e0..cbfe9af 100755 --- a/app/views/index.html +++ b/app/views/index.html @@ -14,7 +14,7 @@
-

NHS {{ serviceName }} online prototypes

+

{{ serviceName }} online prototypes

This page allows you to view current and previous prototypes for the check if you need a lung scan service.

@@ -27,16 +27,16 @@

NHS {{ serviceName }} online prototypes

- {# +

Prototype version 4.0 - pilot

Last updated: 5 May 2026

Multiple changes have been made to v4, including major revisions to the tobacco smoking screens.

- + Open prototype -
#} +

Prototype version 3.0 - pre-pilot