Skip to content

Commit 4d4477a

Browse files
Start work on normal details page (#45)
* Start work on normal details page * Tweaks to annotation page
1 parent ef0b4c4 commit 4d4477a

File tree

5 files changed

+163
-26
lines changed

5 files changed

+163
-26
lines changed

app/routes/reading.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const { getReadingClinics, getReadingProgress, getReadableEvents, getClinicReadi
55
const { needsReading } = require('../lib/utils/status')
66
const { getFullName } = require('../lib/utils/participants')
77
const { snakeCase } = require('../lib/utils/strings')
8+
const { has } = require('browser-sync')
89

910
module.exports = router => {
1011
// Set nav state
@@ -137,8 +138,8 @@ module.exports = router => {
137138
if (!event) return res.redirect(`/reading/clinics/${clinicId}`)
138139

139140
// Check if current event has symptoms that need acknowledging
140-
// const hasSymptoms = event?.currentSymptoms?.length > 0
141-
// const hasRepeatImages = event?.mammogramData?.metadata?.hasRepeat
141+
const hasSymptoms = event?.currentSymptoms?.length > 0
142+
const hasRepeatImages = event?.mammogramData?.metadata?.hasRepeat
142143
// const hasAcknowledgedItems = data?.acknowledgeItems?.includes('true')
143144

144145
// if ((hasSymptoms || hasRepeatImages) && !hasAcknowledgedItems) {
@@ -156,7 +157,11 @@ module.exports = router => {
156157
case 'normal':
157158
if (data.confirmNormalResults === 'true') {
158159
return res.redirect(`/reading/clinics/${clinicId}/events/${eventId}/confirm-normal`)
159-
} else {
160+
}
161+
else if (hasSymptoms) {
162+
return res.redirect(`/reading/clinics/${clinicId}/events/${eventId}/normal-details`)
163+
}
164+
else {
160165
return res.redirect(307, `/reading/clinics/${clinicId}/events/${eventId}/result-normal`)
161166
}
162167
case 'technical_recall':

app/views/reading/annotation.html

Lines changed: 49 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
{% extends 'layout-reading.html' %}
44

5-
{% set pageHeading = "Add annotation for " + query.side + " breast" %}
5+
{% set pageHeading = "Add " + query.side + " breast annotation" %}
66

77
{% set gridColumn = "nhsuk-grid-column-two-thirds" %}
88

@@ -24,6 +24,23 @@ <h1 class="nhsuk-heading-l js-image-count">
2424
{{ pageHeading }}
2525
</h1>
2626

27+
{{ input({
28+
label: {
29+
text: "Where in the breast is this annotation for?",
30+
classes: "nhsuk-label--s"
31+
},
32+
id: "location",
33+
name: "location"
34+
}) }}
35+
36+
<div class="nhsuk-form-group nhsuk-u-margin-bottom-0">
37+
{{ button({
38+
text: "Select location on image",
39+
classes: "nhsuk-button--secondary",
40+
href: "#"
41+
}) }}
42+
</div>
43+
2744
{% set checkboxItems = [] %}
2845

2946
{% set abnormalityList = [
@@ -43,12 +60,30 @@ <h1 class="nhsuk-heading-l js-image-count">
4360
}) %}
4461
{% endfor %}
4562

63+
{% set otherTextInputHtml %}
64+
{{ input({
65+
label: {
66+
text: "Provide details"
67+
},
68+
id: "other text",
69+
name: "other text"
70+
}) }}
71+
{% endset %}
72+
73+
{% set checkboxItems = checkboxItems | push({
74+
value: "other",
75+
text: "Other",
76+
conditional: {
77+
html: otherTextInputHtml
78+
}
79+
}) %}
80+
4681
{{ checkboxes({
4782
idPrefix: "example",
4883
name: "example",
4984
fieldset: {
5085
legend: {
51-
text: "What have you observed?",
86+
text: "What features have you idenitfied?",
5287
classes: "nhsuk-fieldset__legend--s",
5388
isPageHeading: true
5489
}
@@ -60,7 +95,8 @@ <h1 class="nhsuk-heading-l js-image-count">
6095
id: "select-1",
6196
name: "select-1",
6297
label: {
63-
text: "Level of concern"
98+
text: "What is your level of concern?",
99+
classes: "nhsuk-label--s"
64100
},
65101
items: [
66102
{
@@ -92,35 +128,28 @@ <h1 class="nhsuk-heading-l js-image-count">
92128
]
93129
}) }}
94130

95-
{{ input({
96-
label: {
97-
text: "Location on " + query.side + " breast"
98-
},
99-
id: "location",
100-
name: "location"
101-
}) }}
102131

103-
<div class="nhsuk-form-group nhsuk-u-margin-bottom-0">
104-
{{ button({
105-
text: "Mark location on mammogram",
106-
classes: "nhsuk-button--secondary",
107-
href: "#"
108-
}) }}
109-
</div>
110132

111-
{{ input({
133+
{{ textarea({
112134
label: {
113-
text: "General comment"
135+
text: "Provide additional comments",
136+
classes: "nhsuk-label--s"
114137
},
115138
id: "comment",
116139
name: "comment"
117140
}) }}
118141

119142
<div class="nhsuk-form-group nhsuk-u-margin-top-7">
120143
{{ button({
121-
text: "Add annotation",
144+
text: "Save and close",
122145
href: "./recall-for-assessment-details?annotatedSide" + query.side + "=true"
123146
}) }}
147+
148+
{{ button({
149+
text: "Save and add another",
150+
classes: "nhsuk-button--secondary",
151+
href: "#"
152+
}) }}
124153
</div>
125154

126155
{% endblock %}

app/views/reading/assessment.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ <h2>{{ questionText }}</h2>
228228
{# Go to page to collect a comment and mark features #}
229229
{% if not hasSymptoms %}
230230
<p class="nhsuk-u-margin-bottom-0">
231-
<a href="#" class="nhsuk-link--no-visited-state">
231+
<a href="./normal-details" class="nhsuk-link--no-visited-state">
232232
Normal, but add details
233233
</a>
234234
</p>

app/views/reading/list.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ <h3 class="nhsuk-notification-banner__heading">
112112
})}}
113113
{% endif %}
114114
{# Only for testing showing where repeats are: #}
115-
{# {% if event.mammogramData.metadata.hasRepeat %}
115+
{% if event.mammogramData.metadata.hasRepeat %}
116116
{{ tag({
117117
text: "Has repeat",
118118
classes: "nhsuk-tag--yellow"
119119
})}}
120-
{% endif %} #}
120+
{% endif %}
121121
</td>
122122
<td>
123123
{{ event.participant.demographicInformation.dateOfBirth | formatDate }}
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
{# /app/views/events/reading/recall-reason.html #}
2+
3+
{% extends 'layout-reading.html' %}
4+
5+
{% set pageHeading = "Confirm your opinion" %}
6+
7+
{% set gridColumn = "nhsuk-grid-column-two-thirds" %}
8+
9+
{% set formAction = './result-normal' %}
10+
11+
{% set hideSecondaryNavigation = true %}
12+
13+
{% set backLink = value %}
14+
15+
{% block pageContent %}
16+
17+
{{ participant | log("Participant") }}
18+
{{ event | log("Event") }}
19+
20+
<span class="nhsuk-caption-l">
21+
{{ participant | getFullName }}
22+
</span>
23+
24+
<h1 class="nhsuk-heading-l js-image-count">
25+
{{ pageHeading }}
26+
</h1>
27+
28+
{% set hasSymptoms = event.currentSymptoms | length > 0 %}
29+
30+
{% if hasSymptoms %}
31+
32+
<h2>{{ event.currentSymptoms | length }} {{ "symptom" | pluralise(event.currentSymptoms | length )}} reported</h2>
33+
{% set symptoms = event.currentSymptoms %}
34+
{% include "summary-lists/symptoms.njk" %}
35+
36+
{{ textarea({
37+
name: "symptomsExplanation",
38+
id: "symptomsExplanation",
39+
label: {
40+
text: "Explain why these symptoms do not require further assessment (optional)",
41+
classes: "nhsuk-label--s"
42+
},
43+
_hint: {
44+
text: "Any other details that may be relevant"
45+
}
46+
}) }}
47+
48+
<h2>Other details</h2>
49+
50+
{% endif %}
51+
52+
{% for side in ['right', 'left'] %}
53+
{{ input({
54+
label: {
55+
text: (side + " breast comment (optional)") | sentenceCase,
56+
classes: "nhsuk-label--s"
57+
},
58+
_classes: "nhsuk-u-width-two-thirds",
59+
id: "normalDetails-" + side,
60+
name: "normalDetails-" + side
61+
}) }}
62+
{% endfor %}
63+
64+
{% set radioConditionalHtml %}
65+
<p>
66+
<a href="./annotation?side={{ params.side }}">Add an annotation</a>
67+
</p>
68+
{% endset %}
69+
70+
{{ radios({
71+
idPrefix: "markFeatures",
72+
name: "markFeatures",
73+
fieldset: {
74+
legend: {
75+
text: "Do you want to mark any features on these images?",
76+
classes: "nhsuk-fieldset__legend--s",
77+
isPageHeading: false
78+
}
79+
},
80+
items: [
81+
{
82+
value: "yes",
83+
text: "Yes",
84+
conditional: {
85+
html: radioConditionalHtml
86+
}
87+
},
88+
{
89+
value: "no",
90+
text: "No"
91+
}
92+
]
93+
}) }}
94+
95+
96+
97+
{{ button({
98+
text: "Submit normal and move to next"
99+
}) }}
100+
101+
{% endblock %}
102+
103+

0 commit comments

Comments
 (0)