Skip to content

Commit 1425070

Browse files
authored
Merge pull request #4240 from nhsuk/next
Version 2.16
2 parents 9883eac + cd1bee4 commit 1425070

File tree

243 files changed

+5267
-2020
lines changed

Some content is hidden

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

243 files changed

+5267
-2020
lines changed

.github/workflows/build-and-push-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ jobs:
105105
aws-role: ${{ fromJSON(needs.define-matrix.outputs.aws-roles) }}
106106
steps:
107107
- name: Download Docker image
108-
uses: actions/download-artifact@v4
108+
uses: actions/download-artifact@v5
109109
with:
110110
name: image
111111
- name: Configure AWS Credentials

.github/workflows/data-replication-pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ jobs:
197197
role-to-assume: ${{ env.aws_role }}
198198
aws-region: eu-west-2
199199
- name: Download artifact
200-
uses: actions/download-artifact@v4
200+
uses: actions/download-artifact@v5
201201
with:
202202
name: tfplan_infrastructure-${{ inputs.environment }}
203203
path: ${{ runner.temp }}

.github/workflows/deploy-application.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
id-token: write
100100
steps:
101101
- name: Download artifact
102-
uses: actions/download-artifact@v4
102+
uses: actions/download-artifact@v5
103103
with:
104104
name: DEPLOYMENT_ENVS-${{ inputs.environment }}
105105
path: ${{ runner.temp }}
@@ -132,7 +132,7 @@ jobs:
132132
id-token: write
133133
steps:
134134
- name: Download Artifact
135-
uses: actions/download-artifact@v4
135+
uses: actions/download-artifact@v5
136136
with:
137137
name: DEPLOYMENT_ENVS-${{ inputs.environment }}
138138
path: ${{ runner.temp }}

.github/workflows/deploy-backup-infrastructure.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
role-to-assume: ${{ env.aws_role }}
8181
aws-region: eu-west-2
8282
- name: Download artifact
83-
uses: actions/download-artifact@v4
83+
uses: actions/download-artifact@v5
8484
with:
8585
name: tfplan_infrastructure-${{ inputs.environment }}
8686
path: ${{ runner.temp }}

.github/workflows/deploy-infrastructure.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
role-to-assume: ${{ env.aws_role }}
112112
aws-region: eu-west-2
113113
- name: Download artifact
114-
uses: actions/download-artifact@v4
114+
uses: actions/download-artifact@v5
115115
with:
116116
name: tfplan_infrastructure-${{ inputs.environment }}
117117
path: ${{ runner.temp }}

.github/workflows/deploy-monitoring.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
role-to-assume: ${{ env.aws_role }}
104104
aws-region: eu-west-2
105105
- name: Download AWS plan artifact
106-
uses: actions/download-artifact@v4
106+
uses: actions/download-artifact@v5
107107
with:
108108
name: tfplan_monitoring_aws-${{ inputs.environment }}
109109
path: ${{ runner.temp }}

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ gem "rubyzip"
6161
gem "sentry-rails"
6262
gem "sentry-ruby"
6363
gem "splunk-sdk-ruby"
64+
gem "table_tennis"
6465
gem "tzinfo-data", platforms: %i[mingw mswin x64_mingw jruby]
6566
gem "uk_postcode"
6667
gem "wicked"

Gemfile.lock

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ GEM
367367
rubyntlm (~> 0.6, >= 0.6.3)
368368
webrick (~> 1.7)
369369
webrobots (~> 0.1.2)
370+
memo_wise (1.13.0)
370371
method_source (1.1.0)
371372
mime-types (3.6.0)
372373
logger
@@ -425,6 +426,7 @@ GEM
425426
orm_adapter (0.5.0)
426427
ostruct (0.6.2)
427428
pagy (9.3.5)
429+
paint (2.3.0)
428430
parallel (1.27.0)
429431
parser (3.3.8.0)
430432
ast (~> 2.4.1)
@@ -662,6 +664,12 @@ GEM
662664
prettier_print
663665
rbs
664666
syntax_tree (>= 2.0.1)
667+
table_tennis (0.0.7)
668+
csv (~> 3.3)
669+
ffi (~> 1.17)
670+
memo_wise (~> 1.11)
671+
paint (~> 2.3)
672+
unicode-display_width (~> 3.1)
665673
temple (0.10.0)
666674
thor (1.4.0)
667675
thruster (0.1.15-arm64-darwin)
@@ -811,6 +819,7 @@ DEPENDENCIES
811819
syntax_tree
812820
syntax_tree-haml
813821
syntax_tree-rbs
822+
table_tennis
814823
thruster
815824
turbo-rails
816825
tzinfo-data

app/components/app_activity_log_component.rb

Lines changed: 73 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -318,59 +318,87 @@ def programmes_by_id
318318
def decision_expiration_events
319319
all_programmes = Programme.all.to_a
320320

321-
AcademicYear.all.filter_map do |academic_year|
322-
next if academic_year >= AcademicYear.current
321+
AcademicYear.all.flat_map do |academic_year|
322+
next [] if academic_year >= AcademicYear.current
323323

324-
vaccinated_programmes =
325-
all_programmes.select do |programme|
324+
not_vaccinated_programmes =
325+
all_programmes.reject do |programme|
326326
patient.vaccination_status(programme:, academic_year:).vaccinated?
327327
end
328328

329-
programmes_with_expired_consents =
330-
consents
331-
.select { it.academic_year == academic_year }
332-
.flat_map { programmes_for(it) }
333-
.reject { vaccinated_programmes.include?(it) }
334-
335-
programmes_with_expired_triages =
336-
triages
337-
.select { it.academic_year == academic_year }
338-
.flat_map { programmes_for(it) }
339-
.reject { vaccinated_programmes.include?(it) }
340-
341-
programmes_with_expired_psds =
342-
patient_specific_directions
343-
.select { it.academic_year == academic_year }
344-
.flat_map { programmes_for(it) }
345-
.reject { vaccinated_programmes.include?(it) }
346-
347-
expired_items = []
348-
if programmes_with_expired_consents.any?
349-
expired_items += ["consent", "health information"]
350-
end
351-
expired_items << "triage outcome" if programmes_with_expired_triages.any?
352-
expired_items << "PSD status" if programmes_with_expired_psds.any?
329+
vaccinated_but_seasonal_programmes =
330+
all_programmes.select do |programme|
331+
patient.vaccination_status(programme:, academic_year:).vaccinated? &&
332+
programme.seasonal?
333+
end
353334

354-
next if expired_items.empty?
335+
expired_items =
336+
{
337+
vaccinated_but_seasonal: vaccinated_but_seasonal_programmes,
338+
not_vaccinated: not_vaccinated_programmes
339+
}.transform_values do |programmes|
340+
get_expired_items(academic_year:, programmes:)
341+
end
355342

356-
programmes_with_expired_items = [
357-
programmes_with_expired_consents,
358-
programmes_with_expired_triages,
359-
programmes_with_expired_psds
360-
].flatten.uniq
343+
expired_items.map do |category, expired_items_in_category|
344+
expired_item_names = []
345+
if expired_items_in_category[:consents].any?
346+
expired_item_names += ["consent", "health information"]
347+
end
348+
if expired_items_in_category[:triages].any?
349+
expired_item_names << "triage outcome"
350+
end
351+
if expired_items_in_category[:psds].any?
352+
expired_item_names << "PSD status"
353+
end
361354

362-
expired_items_sentence =
363-
expired_items.to_sentence(
364-
words_connector: ", ",
365-
last_word_connector: " and "
366-
)
355+
next [] if expired_item_names.empty?
356+
357+
title =
358+
"#{
359+
expired_item_names.to_sentence(
360+
words_connector: ", ",
361+
last_word_connector: " and "
362+
).upcase_first
363+
} expired"
364+
365+
body =
366+
case category
367+
when :not_vaccinated
368+
"#{@patient.full_name} was not vaccinated."
369+
when :vaccinated_but_seasonal
370+
"#{@patient.full_name} was vaccinated."
371+
end
367372

368-
{
369-
title: "#{expired_items_sentence.upcase_first} expired",
370-
body: "#{@patient.full_name} was not vaccinated.",
371-
at: academic_year.to_academic_year_date_range.end.end_of_day - 1.second,
372-
programmes: programmes_with_expired_items
373-
}
373+
programmes = expired_items_in_category.values.flatten.uniq
374+
375+
{
376+
title:,
377+
body:,
378+
at:
379+
academic_year.to_academic_year_date_range.end.end_of_day - 1.second,
380+
programmes:
381+
}
382+
end
383+
end
384+
end
385+
386+
private
387+
388+
def filter_expired(items, academic_year:, programmes:)
389+
items
390+
.select { it.academic_year == academic_year }
391+
.flat_map { programmes_for(it) }
392+
.select { programmes.include?(it) }
393+
end
394+
395+
def get_expired_items(academic_year:, programmes:)
396+
{
397+
consents:,
398+
triages:,
399+
psds: patient_specific_directions
400+
}.transform_values do |items|
401+
filter_expired(items, academic_year:, programmes:)
374402
end
375403
end
376404
end

app/components/app_imports_navigation_component.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ def issues_text
4646
end
4747

4848
def notices_text
49-
count = helpers.policy_scope(Patient).with_notice.count
50-
49+
count =
50+
ImportantNotices.call(patient_scope: helpers.policy_scope(Patient)).length
5151
safe_join(["Important notices", " ", render(AppCountComponent.new(count))])
5252
end
5353
end

0 commit comments

Comments
 (0)