Skip to content

Commit cd161a3

Browse files
authored
Merge pull request #4000 from nhsuk/next
Version 2.10.0
2 parents da5e67c + 20ce6b6 commit cd161a3

File tree

150 files changed

+2351
-2960
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+2351
-2960
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@ jobs:
2626
- run: tflint --chdir=terraform --init
2727
- uses: jdx/mise-action@v2
2828
with:
29+
version: v2025.7.12
2930
install_args: hk pkl
3031
- run: hk check --all

Gemfile.lock

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,18 +113,18 @@ GEM
113113
ast (2.4.3)
114114
attr_required (1.0.2)
115115
aws-eventstream (1.4.0)
116-
aws-partitions (1.1126.0)
116+
aws-partitions (1.1130.0)
117117
aws-sdk-accessanalyzer (1.73.0)
118118
aws-sdk-core (~> 3, >= 3.225.0)
119119
aws-sigv4 (~> 1.5)
120-
aws-sdk-core (3.226.2)
120+
aws-sdk-core (3.226.3)
121121
aws-eventstream (~> 1, >= 1.3.0)
122122
aws-partitions (~> 1, >= 1.992.0)
123123
aws-sigv4 (~> 1.9)
124124
base64
125125
jmespath (~> 1, >= 1.6.1)
126126
logger
127-
aws-sdk-ec2 (1.537.0)
127+
aws-sdk-ec2 (1.539.0)
128128
aws-sdk-core (~> 3, >= 3.225.0)
129129
aws-sigv4 (~> 1.5)
130130
aws-sdk-ecr (1.104.0)
@@ -139,7 +139,7 @@ GEM
139139
aws-sdk-rds (1.283.0)
140140
aws-sdk-core (~> 3, >= 3.225.0)
141141
aws-sigv4 (~> 1.5)
142-
aws-sdk-s3 (1.192.0)
142+
aws-sdk-s3 (1.193.0)
143143
aws-sdk-core (~> 3, >= 3.225.0)
144144
aws-sdk-kms (~> 1)
145145
aws-sigv4 (~> 1.5)
@@ -217,7 +217,7 @@ GEM
217217
dry-cli (1.2.0)
218218
email_validator (2.2.4)
219219
activemodel
220-
erb (5.0.1)
220+
erb (5.0.2)
221221
erubi (1.13.1)
222222
et-orbi (1.2.11)
223223
tzinfo
@@ -305,7 +305,7 @@ GEM
305305
domain_name (~> 0.5)
306306
i18n (1.14.7)
307307
concurrent-ruby (~> 1.0)
308-
io-console (0.8.0)
308+
io-console (0.8.1)
309309
irb (1.15.2)
310310
pp (>= 0.6.0)
311311
rdoc (>= 4.0.0)
@@ -435,11 +435,10 @@ GEM
435435
prettier_print (1.2.1)
436436
prettyprint (0.2.0)
437437
prism (1.4.0)
438-
propshaft (1.1.0)
438+
propshaft (1.2.0)
439439
actionpack (>= 7.0.0)
440440
activesupport (>= 7.0.0)
441441
rack
442-
railties (>= 7.0.0)
443442
pry (0.14.2)
444443
coderay (~> 1.1)
445444
method_source (~> 1.0)
@@ -651,7 +650,7 @@ GEM
651650
attr_required (>= 0.0.5)
652651
faraday (~> 2.0)
653652
faraday-follow_redirects
654-
syntax_tree (6.2.0)
653+
syntax_tree (6.3.0)
655654
prettier_print (>= 1.2.0)
656655
syntax_tree-haml (4.0.3)
657656
haml (>= 5.2)

README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,6 @@ See the [releasing documentation](docs/releasing.md) for more information.
340340
- `access_log:for_patient[id]`
341341
- `access_log:for_user[id]`
342342
- `clinics:create[name,address,town,postcode,ods_code,organisation_ods_code]`
343-
- `schools:add_to_organisation[ods_code,team_name,urn,...]`
344343
- `teams:create[ods_code,name,email,phone]`
345344
- `users:create[email,password,given_name,family_name,organisation_ods_code]`
346345
- `vaccines:seed[type]`
@@ -351,13 +350,6 @@ See the [Rake tasks documentation](docs/rake-tasks.md) for more information.
351350

352351
See the [Ops tasks documentation](docs/ops-tasks.md) for more information.
353352

354-
## MESH Connection
355-
356-
Mavis connects to the NHS MESH (Message Exchange for Social Care and Health) to
357-
send data to DPS for upstream reporting of vaccination records.
358-
359-
See the [MESH documentation](docs/mesh.md) for more information.
360-
361353
## NHS Personal Demographic Service (PDS) Connection
362354

363355
Mavis is also configured to connect to PDS to retrieve patient information such

app/assets/stylesheets/_card.scss

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949
}
5050
}
5151

52+
&--offset {
53+
background-color: rgba($color_nhsuk-grey-5, 0.5);
54+
}
55+
5256
&--data {
5357
display: flex;
5458

@@ -132,3 +136,22 @@
132136
color: $nhsuk-link-active-color;
133137
}
134138
}
139+
140+
.app-card--compact {
141+
@include nhsuk-responsive-margin(3, "bottom");
142+
143+
.app-button-group {
144+
gap: nhsuk-spacing(2);
145+
margin-bottom: nhsuk-spacing(1);
146+
margin-top: nhsuk-spacing(-4);
147+
}
148+
149+
.nhsuk-card__heading {
150+
@include nhsuk-responsive-margin(1, "bottom");
151+
}
152+
153+
.nhsuk-card__content {
154+
@include nhsuk-responsive-padding(4);
155+
@include nhsuk-responsive-padding(3, "bottom");
156+
}
157+
}

app/components/app_activity_log_component.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,17 @@ def session_events
215215

216216
def triage_events
217217
triages.map do |triage|
218+
programmes = programmes_for(triage)
219+
title = "Triaged decision: #{triage.human_enum_name(:status)}"
220+
title +=
221+
" with #{triage.human_enum_name(:vaccine_method)}" if triage.vaccine_method.present? &&
222+
programmes.first.has_multiple_vaccine_methods?
218223
{
219-
title: "Triaged decision: #{triage.human_enum_name(:status)}",
224+
title:,
220225
body: triage.notes,
221226
at: triage.created_at,
222227
by: triage.performed_by,
223-
programmes: programmes_for(triage)
228+
programmes:
224229
}
225230
end
226231
end

app/components/app_card_component.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def initialize(
3434
secondary: false,
3535
data: false,
3636
patient: false,
37+
compact: false,
3738
filters: false,
3839
section: false
3940
)
@@ -44,10 +45,11 @@ def initialize(
4445
@secondary = secondary
4546
@data = data
4647
@patient = patient
48+
@compact = compact
4749
@filters = filters
4850
@section = section
4951

50-
@feature = (colour.present? && !data) || filters
52+
@feature = (colour.present? && !data && !compact) || filters
5153
end
5254

5355
private
@@ -64,6 +66,7 @@ def card_classes
6466
("nhsuk-card--secondary" if @secondary),
6567
("app-card--data" if @data),
6668
("app-card--patient" if @patient),
69+
("app-card--compact" if @compact),
6770
("app-filters" if @filters)
6871
].compact.join(" ")
6972
end
@@ -80,7 +83,7 @@ def content_classes
8083
def heading_size
8184
if @data
8285
"xs"
83-
elsif @feature || @secondary || @patient
86+
elsif @feature || @secondary || @patient || @compact
8487
"s"
8588
else
8689
"m"
Lines changed: 56 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,74 @@
11
# frozen_string_literal: true
22

33
class AppConsentCardComponent < ViewComponent::Base
4-
def initialize(patient_session:, programme:)
4+
def initialize(consent, session:)
55
super
66

7-
@patient_session = patient_session
8-
@programme = programme
7+
@consent = consent
8+
@session = session
99
end
1010

11-
attr_reader :patient_session, :programme
12-
13-
delegate :patient, :session, to: :patient_session
14-
15-
def colour
16-
I18n.t(status, scope: %i[status consent colour])
17-
end
18-
19-
def heading
20-
"#{programme.name}: #{I18n.t(status, scope: %i[status consent label])}"
11+
def call
12+
render AppCardComponent.new(**card_options) do |card|
13+
card.with_heading { heading }
14+
govuk_summary_list(rows:)
15+
end
2116
end
2217

23-
def latest_consent_request
24-
@latest_consent_request ||=
25-
patient
26-
.consent_notifications
27-
.request
28-
.has_programme(programme)
29-
.order(sent_at: :desc)
30-
.first
31-
end
18+
private
3219

33-
def consent_status
34-
@consent_status ||= patient.consent_status(programme:)
35-
end
20+
attr_reader :consent, :session
3621

37-
def vaccination_status
38-
@vaccination_status ||= patient.vaccination_status(programme:)
39-
end
22+
delegate :patient, :programme, to: :consent
4023

41-
def can_send_consent_request?
42-
consent_status.no_response? && patient.send_notifications? &&
43-
session.open_for_consent? && patient.parents.any?
24+
def link_to
25+
session_patient_programme_consent_path(session, patient, programme, consent)
4426
end
4527

46-
def who_refused
47-
consents =
48-
patient.consents.where(programme:).not_invalidated.includes(:parent)
28+
def card_options = { link_to:, colour: "offset", compact: true }
4929

50-
ConsentGrouper
51-
.call(consents, programme:)
52-
.find(&:response_refused?)
53-
&.who_responded
30+
def heading
31+
if consent.via_self_consent?
32+
consent.who_responded
33+
else
34+
"#{consent.name} (#{consent.who_responded})"
35+
end
5436
end
5537

56-
delegate :status, to: :consent_status
38+
def rows
39+
[
40+
if (phone = consent.parent&.phone).present?
41+
{ key: { text: "Phone number" }, value: { text: phone } }
42+
end,
43+
if (email = consent.parent&.email).present?
44+
{ key: { text: "Email address" }, value: { text: email } }
45+
end,
46+
{
47+
key: {
48+
text: "Date"
49+
},
50+
value: {
51+
text: consent.responded_at.to_fs(:long)
52+
}
53+
},
54+
{
55+
key: {
56+
text: "Decision"
57+
},
58+
value: {
59+
text: helpers.consent_status_tag(consent)
60+
}
61+
},
62+
if consent.vaccine_method_nasal?
63+
{
64+
key: {
65+
text: "Consent also given for injected vaccine?"
66+
},
67+
value: {
68+
text: consent.vaccine_method_injection? ? "Yes" : "No"
69+
}
70+
}
71+
end
72+
].compact
73+
end
5774
end

app/components/app_consent_summary_component.rb

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,35 @@ def initialize(consent, change_links: {})
1010

1111
def call
1212
govuk_summary_list(actions: @change_links.present?) do |summary_list|
13-
if @consent.responded_at.present?
13+
summary_list.with_row do |row|
14+
row.with_key { "Programme" }
15+
row.with_value do
16+
tag.strong(
17+
programme.name,
18+
class: "nhsuk-tag app-tag--attached nhsuk-tag--white"
19+
)
20+
end
21+
end
22+
23+
if consent.responded_at.present?
1424
summary_list.with_row do |row|
15-
row.with_key { "Response date" }
16-
row.with_value { @consent.responded_at.to_fs(:long) }
25+
row.with_key { "Date" }
26+
row.with_value { consent.responded_at.to_fs(:long) }
27+
end
28+
end
29+
30+
summary_list.with_row do |row|
31+
row.with_key { "Method" }
32+
row.with_value { consent.human_enum_name(:route).humanize }
33+
if (href = change_links[:route])
34+
row.with_action(text: "Change", visually_hidden_text: "method", href:)
1735
end
1836
end
1937

2038
summary_list.with_row do |row|
2139
row.with_key { "Decision" }
22-
row.with_value { helpers.consent_status_tag(@consent) }
23-
if (href = @change_links[:response])
40+
row.with_value { helpers.consent_status_tag(consent) }
41+
if (href = change_links[:response])
2442
row.with_action(
2543
text: "Change",
2644
visually_hidden_text: "decision",
@@ -29,38 +47,32 @@ def call
2947
end
3048
end
3149

32-
summary_list.with_row do |row|
33-
row.with_key { "Response method" }
34-
row.with_value do
35-
Consent.human_enum_name(:route, @consent.route).humanize
36-
end
37-
if (href = @change_links[:route])
38-
row.with_action(
39-
text: "Change",
40-
visually_hidden_text: "response method",
41-
href:
42-
)
50+
if consent.vaccine_method_nasal?
51+
summary_list.with_row do |row|
52+
row.with_key { "Consent also given for injected vaccine?" }
53+
row.with_value { consent.vaccine_method_injection? ? "Yes" : "No" }
4354
end
4455
end
4556

46-
if @consent.reason_for_refusal.present?
57+
if consent.reason_for_refusal.present?
4758
summary_list.with_row do |row|
4859
row.with_key { "Reason for refusal" }
49-
row.with_value do
50-
Consent.human_enum_name(
51-
:reason_for_refusal,
52-
@consent.reason_for_refusal
53-
)
54-
end
60+
row.with_value { consent.human_enum_name(:reason_for_refusal) }
5561
end
5662
end
5763

58-
if @consent.notes.present?
64+
if consent.notes.present?
5965
summary_list.with_row do |row|
6066
row.with_key { "Notes" }
61-
row.with_value { @consent.notes }
67+
row.with_value { consent.notes }
6268
end
6369
end
6470
end
6571
end
72+
73+
private
74+
75+
attr_reader :consent, :change_links
76+
77+
delegate :programme, to: :consent
6678
end

0 commit comments

Comments
 (0)