Skip to content

Commit f5358d2

Browse files
Draft changes for 1st/2nd reads (#55)
* Draft changes for 1st/2nd reads * Revert complete tag changes * Fix broken status colour --------- Co-authored-by: Ed Horsford <[email protected]>
1 parent 8057c2e commit f5358d2

File tree

3 files changed

+94
-43
lines changed

3 files changed

+94
-43
lines changed

app/lib/utils/status.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ const getStatusTagColour = (status) => {
100100

101101
// Image reading
102102
not_started: 'grey',
103-
unread: 'grey',
103+
not_provided: 'grey',
104+
not_read: 'grey',
104105
skipped: 'white',
105106

106107
// Image reading results

app/views/reading/index.html

Lines changed: 86 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -22,44 +22,99 @@ <h1>{{ pageHeading }}</h1>
2222
{{ clinic | log("First clinic") }}
2323

2424
{% set clinicCardDescriptionHtml %}
25-
<p>Clinic from {{ clinic.date | formatDate | noWrap }}</p>
25+
26+
<ul class="nhsuk-list nhsuk-list--bullet nhsuk-body-s nhsuk-u-margin-bottom-3">
27+
<li>
28+
{{ clinic.location.name }}
29+
{% if clinic.location.type === 'mobile_unit' %}
30+
at {{ clinic.siteName }}
31+
{% endif %}
32+
</li>
33+
<li>
34+
{{ clinic.date | formatDate | noWrap }} ({{ clinic.date | formatRelativeDate | sentenceCase }})
35+
</li>
36+
<li>
37+
{{ clinic.readingStatus.total }} image {{ "record" if clinic.readingStatus.total == 1 else "records" }}
38+
</li>
39+
</ul>
2640
{% endset %}
2741

2842
{% set firstUnreadEvent = data | getFirstUnreadEventOverall %}
2943
{{ firstUnreadEvent | log("First unread event") }}
3044

31-
{% set clinicHref %}
45+
{% set clinicHref -%}
3246
/reading/clinics/{{ firstUnreadEvent.clinicId }}/events/{{ firstUnreadEvent.id }}/assessment
33-
{% endset %}
47+
{%- endset %}
48+
3449
{{ card({
35-
clickable: true,
36-
heading: "Start reading",
37-
headingClasses: "nhsuk-heading-m nhsuk-link--no-visited-state",
38-
href: clinicHref | trim,
39-
descriptionHtml: clinicCardDescriptionHtml
50+
heading: "Next 1st read clinic",
51+
headingClasses: "nhsuk-heading-s",
52+
descriptionHtml: clinicCardDescriptionHtml ~ actionLink({
53+
classes: "nhsuk-link--no-visited-state",
54+
text: "Start 1st read",
55+
href: clinicHref
56+
})
4057
}) }}
58+
4159
</li>
4260
<li class="nhsuk-grid-column-one-third nhsuk-card-group__item">
4361

44-
{# {% set participantCardDescriptionHtml %}
45-
<p>72k participants registered</p>
46-
{% endset %} #}
62+
{% set clinic = clinics[2] %}
63+
{{ clinic | log("Second clinic") }}
64+
65+
{% set clinicCardDescriptionHtml %}
66+
<ul class="nhsuk-list nhsuk-list--bullet nhsuk-body-s nhsuk-u-margin-bottom-3">
67+
<li>
68+
{{ clinic.location.name }}
69+
{% if clinic.location.type === 'mobile_unit' %}
70+
at {{ clinic.siteName }}
71+
{% endif %}
72+
</li>
73+
<li>
74+
{{ clinic.date | formatDate | noWrap }} ({{ clinic.date | formatRelativeDate | sentenceCase }})
75+
</li>
76+
<li>
77+
{{ clinic.readingStatus.total }} image {{ "record" if clinic.readingStatus.total == 1 else "records" }}
78+
</li>
79+
</ul>
80+
{% endset %}
81+
82+
{% set firstUnreadEvent = data | getFirstUnreadEventOverall %}
83+
{{ firstUnreadEvent | log("First unread event") }}
84+
85+
{% set clinicHref -%}
86+
/reading/clinics/{{ firstUnreadEvent.clinicId }}/events/{{ firstUnreadEvent.id }}/assessment
87+
{%- endset %}
88+
4789
{{ card({
48-
clickable: true,
49-
heading: "Reading statistics",
50-
headingClasses: "nhsuk-heading-m",
51-
href: "#",
52-
descriptionHtml: participantCardDescriptionHtml
90+
heading: "Next 2nd read clinic",
91+
headingClasses: "nhsuk-heading-s",
92+
descriptionHtml: clinicCardDescriptionHtml ~ actionLink({
93+
classes: "nhsuk-link--no-visited-state",
94+
text: "Start 2nd read",
95+
href: clinicHref
96+
})
5397
}) }}
98+
5499
</li>
55100
<li class="nhsuk-grid-column-one-third nhsuk-card-group__item">
101+
102+
{% set clinicCardDescriptionHtml %}
103+
<p class="nhsuk-body-s nhsuk-u-margin-bottom-3">
104+
16 cases require a final decision
105+
</p>
106+
{% endset %}
107+
56108
{{ card({
57-
clickable: true,
58109
heading: "Arbitration",
59-
headingClasses: "nhsuk-heading-m",
60-
href: "#",
61-
descriptionHtml: false
110+
headingClasses: "nhsuk-heading-s",
111+
descriptionHtml: clinicCardDescriptionHtml ~ actionLink({
112+
classes: "nhsuk-link--no-visited-state",
113+
text: "See cases",
114+
href: "#"
115+
})
62116
}) }}
117+
63118
</li>
64119
</ul>
65120

@@ -71,11 +126,10 @@ <h2>All available clinics to read</h2>
71126
<table class="nhsuk-table">
72127
<thead class="nhsuk-table__head">
73128
<tr>
74-
<th scope="col">Clinic</th>
129+
<th scope="col" class="nhsuk-u-width-one-half">Location (clinic code)</th>
75130
<th scope="col">Date</th>
76-
<th scope="col" class="nhsuk-table__cell--numeric">Participants</th>
77-
<th scope="col" class="nhsuk-table__cell--numeric">Days since screening</th>
78-
<th scope="col">Reading status</th>
131+
<th scope="col">Cases</th>
132+
<th scope="col">Status</th>
79133
</tr>
80134
</thead>
81135
<tbody class="nhsuk-table__body">
@@ -95,22 +149,20 @@ <h2>All available clinics to read</h2>
95149
({{ clinic.sessionType | sentenceCase }})
96150
</a>
97151
</td>
98-
<td>{{ clinic.date | formatDate | noWrap }}<br>
99-
{{clinic.sessionTimes | formatTimeRange | asHint }}
152+
<td>
153+
{{ clinic.date | formatDate | noWrap }}<br>
154+
{{ clinic.date | formatRelativeDate | sentenceCase | asHint }}
100155
</td>
101-
<td class="nhsuk-table__cell--numeric">
156+
<td>
102157
{{ stats.total }}
103-
{% if stats.status != "Not started" %}
104-
<br>
105-
{{ (stats.remaining + " remaining") | noWrap | asHint }}
106-
{% endif %}
107-
</td>
108-
<td class="nhsuk-table__cell--numeric">
109-
{{ stats.daysSinceScreening }}
110158
</td>
111159
{# Reading status #}
112160
<td>
113161
{{ stats.status | toTag }}
162+
{% if stats.status != "Not read" %}
163+
<br>
164+
{{ (stats.remaining + " remaining") | noWrap | asHint }}
165+
{% endif %}
114166
</td>
115167
</tr>
116168
{% endfor %}

app/views/reading/list.html

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ <h1 class="nhsuk-heading-l">
3737
</div>
3838
</div>
3939
<div class="nhsuk-grid-row">
40-
<div class="nhsuk-grid-column-two-thirds">
40+
<div class="nhsuk-grid-column-full">
4141
{# Clinic time and date #}
4242
{# 9am to midday - 31 December 2024 #}
4343
<p>{{ clinic.sessionTimes | formatTimeRange }} - {{ clinic.date | formatDate }}</p>
@@ -93,8 +93,8 @@ <h3 class="nhsuk-notification-banner__heading">
9393
<table class="nhsuk-table">
9494
<thead>
9595
<tr>
96-
<th>Name</th>
97-
<th>Date of birth</th>
96+
<th>Cases</th>
97+
<th>Important info</th>
9898
<th>Your opinion</th>
9999
</tr>
100100
</thead>
@@ -104,7 +104,8 @@ <h3 class="nhsuk-notification-banner__heading">
104104
<tr>
105105
<td>
106106
<a href="/reading/clinics/{{ clinicId }}/events/{{ event.id }}/assessment">{{ event.participant | getFullName }}</a>
107-
<br>
107+
</td>
108+
<td>
108109
{% if event.currentSymptoms | length %}
109110
{{ tag({
110111
text: "Has symptoms",
@@ -119,9 +120,6 @@ <h3 class="nhsuk-notification-banner__heading">
119120
})}} #}
120121
{% endif %}
121122
</td>
122-
<td>
123-
{{ event.participant.demographicInformation.dateOfBirth | formatDate }}
124-
</td>
125123
{# <td>
126124

127125
{{ tag({
@@ -131,7 +129,7 @@ <h3 class="nhsuk-notification-banner__heading">
131129
</td> #}
132130
<td>
133131

134-
{% set metaStatus = "Unread" %}
132+
{% set metaStatus = "Not provided" %}
135133
{% set skipped = "Skipped" if data.readingSession.skippedEvents | includes(event.id) else false %}
136134
{% if event.reads and event.reads[0] %}
137135
{% set metaStatus = event.reads[0].result %}

0 commit comments

Comments
 (0)