Skip to content

Commit 0d34ee8

Browse files
Manual images (#173)
* Start adding support for a manual images flow * More work * Add optoins for manual page * Add more questions * Add further manual images pages and routes * Make data display better * Use same repeat reasons * Add option for direct text input * Apply free text to next page * Update heading * Update legend text * Cleanup of code * Disable manual image flow by default
1 parent b8c4bd0 commit 0d34ee8

16 files changed

+1783
-370
lines changed

app/assets/sass/_typography.scss

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@use "nhsuk-frontend/dist/nhsuk/core/settings" as *;
22
@use "nhsuk-frontend/dist/nhsuk/core/styles/typography" as *;
33
@use "nhsuk-frontend/dist/nhsuk/core/tools" as *;
4+
@use "nhsuk-frontend/dist/nhsuk/core/helpers" as *;
45

56
h1 {
67
@extend %nhsuk-heading-l;
@@ -24,7 +25,19 @@ h3 {
2425

2526
.app-link--error,
2627
.app-link--warning {
27-
color: $nhsuk-error-colour;
28+
&,
29+
&:visited {
30+
color: $nhsuk-error-colour;
31+
}
32+
33+
&:hover,
34+
&:hover:visited {
35+
color: nhsuk-shade($nhsuk-error-colour, 20%);
36+
}
37+
38+
&:hover:active {
39+
color: $nhsuk-text-colour;
40+
}
2841
}
2942

3043
.app-button-link {

app/data/repeat-reasons.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// app/data/repeat-reasons.js
2+
3+
module.exports = [
4+
'Patient moved during exposure',
5+
'Unable to maintain compression',
6+
'Inadequate compression achieved',
7+
'Incorrect positioning identified',
8+
'Image too light - exposure needs adjustment',
9+
'Image too dark - exposure needs adjustment',
10+
'Motion blur affecting image quality',
11+
'Equipment technical fault',
12+
'Folded skin needs smoothing',
13+
'Pectoral muscle not visualised correctly',
14+
'Nipple not in profile',
15+
'Other'
16+
]

app/data/session-data-defaults.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const path = require('path')
1010
const fs = require('fs')
1111
const { needsRegeneration } = require('../lib/utils/regenerate-data')
1212
const config = require('../config')
13+
const repeatReasons = require('./repeat-reasons')
1314

1415
// Check if generated data folder exists and create if needed
1516
const generatedDataPath = path.join(__dirname, 'generated')
@@ -59,7 +60,8 @@ try {
5960
const defaultSettings = {
6061
darkMode: 'false',
6162
screening: {
62-
confirmIdentityOnCheckIn: 'true'
63+
confirmIdentityOnCheckIn: 'true',
64+
manualImageCollection: 'false'
6365
},
6466
reading: {
6567
blindReading: config.reading.blindReading,
@@ -83,5 +85,6 @@ module.exports = {
8385
config,
8486
settings: defaultSettings,
8587
defaultSettings,
86-
medicalHistoryTypes
88+
medicalHistoryTypes,
89+
repeatReasons
8790
}

app/lib/generators/mammogram-generator.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const { faker } = require('@faker-js/faker')
44
const generateId = require('../utils/id-generator')
55
const dayjs = require('dayjs')
66
const weighted = require('weighted')
7+
const REPEAT_REASONS = require('../../data/repeat-reasons')
78

89
const STANDARD_VIEWS = [
910
{ side: 'right', view: 'mediolateral oblique' },
@@ -12,20 +13,6 @@ const STANDARD_VIEWS = [
1213
{ side: 'left', view: 'mediolateral oblique' }
1314
]
1415

15-
const REPEAT_REASONS = [
16-
'patient moved during exposure',
17-
'unable to maintain compression',
18-
'inadequate compression achieved',
19-
'incorrect positioning identified',
20-
'image too light - exposure needs adjustment',
21-
'image too dark - exposure needs adjustment',
22-
'motion blur affecting image quality',
23-
'equipment technical fault',
24-
'folded skin needs smoothing',
25-
'pectoral muscle not visualized correctly',
26-
'nipple not in profile'
27-
]
28-
2916
// Default probability settings
3017
const DEFAULT_PROBABILITIES = {
3118
viewMissing: 0.05, // 5% chance of a view being missing

app/lib/utils/status.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ const isActive = (input) => {
113113
* @returns {boolean} Whether the event is in the appointment workflow for this user
114114
*/
115115
const isAppointmentWorkflow = function (event, currentUser) {
116+
if (!event) return false
117+
116118
// Get currentUser from context if not provided
117119
currentUser = currentUser || this?.ctx?.data?.currentUser
118120

0 commit comments

Comments
 (0)