Skip to content

Commit d06f64d

Browse files
Updates after P1 (#48)
1 parent 60b8b18 commit d06f64d

File tree

6 files changed

+39
-19
lines changed

6 files changed

+39
-19
lines changed

app/lib/generators/event-generator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ const generateEvent = ({ slot, participant, clinic, outcomeWeights, forceStatus
153153

154154
// Higher chance of symptoms in assessment clinics
155155
// const symptomProbability = clinic.clinicType === 'assessment' ? 0.4 : 0.15
156-
const symptomProbability = 0.25
156+
const symptomProbability = 0.15
157157
event.currentSymptoms = generateSymptoms({
158158
probabilityOfSymptoms: symptomProbability
159159
})

app/lib/generators/mammogram-generator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const REPEAT_REASONS = [
3030
// Default probability settings
3131
const DEFAULT_PROBABILITIES = {
3232
viewMissing: 0.05, // 5% chance of a view being missing
33-
needsRepeat: 0.25, // 25% chance of needing a repeat
33+
needsRepeat: 0.10, // 10% chance of needing a repeat
3434
repeatsPerRound: [1, 2] // When repeating, how many views to repeat (min, max)
3535
}
3636

app/lib/generators/symptoms-generator.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ const generateSymptoms = (options = {}) => {
158158

159159
// Determine how many symptoms (weighted towards fewer)
160160
const numberOfSymptoms = weighted.select({
161-
1: 0.6,
162-
2: 0.3,
163-
3: 0.1
161+
1: 0.8,
162+
2: 0.15,
163+
3: 0.05
164164
})
165165

166166
// Track used types to avoid duplicates

app/routes/reading.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,20 @@ module.exports = router => {
147147
const hasRepeatImages = event?.mammogramData?.metadata?.hasRepeat
148148
// const hasAcknowledgedItems = data?.acknowledgeItems?.includes('true')
149149

150+
const existingResult = event.reads?.[0]?.result
151+
console.log({existingResult})
152+
if (existingResult && existingResult === result) {
153+
const events = getReadableEvents(data, clinicId)
154+
const progress = getReadingProgress(events, eventId)
155+
156+
// Redirect to next participant if available
157+
if (progress.hasNextUnread) {
158+
return res.redirect(`/reading/clinics/${clinicId}/events/${progress.nextUnreadId}`)
159+
} else {
160+
return res.redirect(`/reading/clinics/${clinicId}`)
161+
}
162+
}
163+
150164
// if ((hasSymptoms || hasRepeatImages) && !hasAcknowledgedItems) {
151165
// console.log('still with the errors')
152166
// req.flash('error', {

app/views/reading/assessment.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ <h3>Partial mammography</h3>
207207
}) }}
208208

209209
{{ button({
210-
text: "Update assessment"
210+
text: "Update opinion"
211211
}) }}
212212
{% else %}
213213

app/views/reading/recall-for-assessment-details.html

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,6 @@
8282
] | removeEmpty
8383
}) }}
8484

85-
{{ input({
86-
label: {
87-
text: (params.side + " breast comment (optional)") | sentenceCase,
88-
classes: "nhsuk-label--s"
89-
},
90-
classes: "nhsuk-u-width-two-thirds",
91-
id: "comment-" + params.side,
92-
name: "comment-" + params.side
93-
}) }}
94-
9585
<h3 class="nhsuk-heading-s">Image annotations</h3>
9686

9787
{% if data['annotatedSide' + params.side] == 'true' %}
@@ -124,18 +114,34 @@ <h3 class="nhsuk-heading-s">Image annotations</h3>
124114
]
125115
}) }}
126116
{% else %}
127-
{% set insetHtml %}
117+
{# {% set insetHtml %}
128118
<p>No image annotations have been added.</p>
129119
{% endset %}
130120

131121
{{ insetText({
132122
html: insetHtml
133-
}) }}
123+
}) }} #}
134124
{% endif %}
135125

126+
{{ button({
127+
text: "Add an annotation",
128+
classes: "nhsuk-button--secondary",
129+
href: "./annotation?side=" + params.side
130+
}) }}
131+
132+
{# <p><a href="./annotation?side={{ params.side }}">Add an annotation</a></p> #}
133+
134+
{{ input({
135+
label: {
136+
text: (params.side + " breast comment (optional)") | sentenceCase,
137+
classes: "nhsuk-label--s"
138+
},
139+
classes: "nhsuk-u-width-two-thirds",
140+
id: "comment-" + params.side,
141+
name: "comment-" + params.side
142+
}) }}
136143

137144

138-
<p><a href="./annotation?side={{ params.side }}">Add an annotation</a></p>
139145

140146
{% endset %}
141147

0 commit comments

Comments
 (0)