Skip to content

Commit 70719fb

Browse files
authored
Merge branch 'next' into add-python-component-to-architecture-adoc
2 parents 1c02f23 + 9c193b4 commit 70719fb

59 files changed

Lines changed: 1798 additions & 636 deletions

File tree

Some content is hidden

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

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,18 @@ jobs:
7171
if [ -z "${{ inputs.db_snapshot_arn }}" ]; then
7272
echo "No snapshot ARN provided, fetching the latest snapshot"
7373
SNAPSHOT_ARN=$(aws rds describe-db-cluster-snapshots \
74-
--query 'DBClusterSnapshots[?contains(DBClusterSnapshotIdentifier, `${{ inputs.environment}}`)].[DBClusterSnapshotArn, SnapshotCreateTime]' \
74+
--query "DBClusterSnapshots[?DBClusterIdentifier=='mavis-${{ inputs.environment }}'].[DBClusterSnapshotArn, SnapshotCreateTime]" \
7575
--output text | sort -k2 -r | head -n 1 | cut -f1)
76+
77+
if [ -z "$SNAPSHOT_ARN" ]; then
78+
echo "No snapshots found for mavis-${{ inputs.environment }}"
79+
exit 1
80+
fi
7681
else
7782
echo "Using provided snapshot ARN: ${{ inputs.db_snapshot_arn }}"
7883
SNAPSHOT_ARN="${{ inputs.db_snapshot_arn }}"
7984
fi
85+
echo "Using snapshot ARN: $SNAPSHOT_ARN"
8086
echo "SNAPSHOT_ARN=$SNAPSHOT_ARN" >> $GITHUB_OUTPUT
8187
- name: Install terraform
8288
uses: hashicorp/setup-terraform@v3

Gemfile.lock

Lines changed: 8 additions & 8 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.1118.0)
116+
aws-partitions (1.1121.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.0)
120+
aws-sdk-core (3.226.1)
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.531.0)
127+
aws-sdk-ec2 (1.533.0)
128128
aws-sdk-core (~> 3, >= 3.225.0)
129129
aws-sigv4 (~> 1.5)
130130
aws-sdk-ecr (1.104.0)
@@ -133,13 +133,13 @@ GEM
133133
aws-sdk-iam (1.123.0)
134134
aws-sdk-core (~> 3, >= 3.225.0)
135135
aws-sigv4 (~> 1.5)
136-
aws-sdk-kms (1.105.0)
136+
aws-sdk-kms (1.106.0)
137137
aws-sdk-core (~> 3, >= 3.225.0)
138138
aws-sigv4 (~> 1.5)
139-
aws-sdk-rds (1.280.0)
139+
aws-sdk-rds (1.281.0)
140140
aws-sdk-core (~> 3, >= 3.225.0)
141141
aws-sigv4 (~> 1.5)
142-
aws-sdk-s3 (1.190.0)
142+
aws-sdk-s3 (1.191.0)
143143
aws-sdk-core (~> 3, >= 3.225.0)
144144
aws-sdk-kms (~> 1)
145145
aws-sigv4 (~> 1.5)
@@ -414,7 +414,7 @@ GEM
414414
validate_url
415415
webfinger (~> 2.0)
416416
orm_adapter (0.5.0)
417-
ostruct (0.6.1)
417+
ostruct (0.6.2)
418418
pagy (9.3.4)
419419
parallel (1.27.0)
420420
parser (3.3.8.0)
@@ -610,7 +610,7 @@ GEM
610610
simplecov_json_formatter (~> 0.1)
611611
simplecov-html (0.12.3)
612612
simplecov_json_formatter (0.1.4)
613-
solargraph (0.55.1)
613+
solargraph (0.55.3)
614614
backport (~> 1.2)
615615
benchmark (~> 0.4)
616616
bundler (~> 2.0)

app/components/app_consent_table_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def consents
2323
patient
2424
.consents
2525
.where(programme:)
26-
.includes(:consent_form, :parent)
26+
.includes(:consent_form, :parent, :programme)
2727
.order(created_at: :desc)
2828
end
2929
end

app/components/app_patient_search_result_card_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def call
7070
def programme_outcome_tag
7171
status = @patient.vaccination_status(programme: @programme).status
7272
render AppProgrammeStatusTagsComponent.new(
73-
{ @programme => status },
73+
{ @programme => { status: } },
7474
outcome: :programme
7575
)
7676
end

app/components/app_patient_session_search_result_card_component.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,10 @@ def status_tag
123123
render(
124124
AppProgrammeStatusTagsComponent.new(
125125
patient_session.programmes.index_with do |programme|
126-
patient.consent_status(programme:).status
126+
patient.consent_status(programme:).slice(
127+
:status,
128+
:vaccine_methods
129+
)
127130
end,
128131
outcome: :consent
129132
)
@@ -136,7 +139,7 @@ def status_tag
136139
render(
137140
AppProgrammeStatusTagsComponent.new(
138141
patient_session.programmes.index_with do |programme|
139-
patient.triage_status(programme:).status
142+
patient.triage_status(programme:).slice(:status)
140143
end,
141144
outcome: :triage
142145
)
@@ -149,7 +152,7 @@ def status_tag
149152
render(
150153
AppProgrammeStatusTagsComponent.new(
151154
patient_session.programmes.index_with do |programme|
152-
patient_session.session_status(programme:).status
155+
patient_session.session_status(programme:).slice(:status)
153156
end,
154157
outcome: :session
155158
)

app/components/app_patient_session_triage_component.html.erb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
<% end %>
1616

1717
<% if helpers.policy(Triage).new? %>
18-
<%= render AppTriageFormComponent.new(patient_session:, programme:, triage:, legend: :bold) %>
18+
<%= render AppTriageFormComponent.new(
19+
triage_form,
20+
url: session_patient_programme_triages_path(session, patient, programme),
21+
) %>
1922
<% end %>
2023
<% elsif latest_triage %>
2124
<% if latest_triage.ready_to_vaccinate? %>

app/components/app_patient_session_triage_component.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# frozen_string_literal: true
22

33
class AppPatientSessionTriageComponent < ViewComponent::Base
4-
def initialize(patient_session, programme:, triage:)
4+
def initialize(patient_session, programme:, triage_form: nil)
55
super
66

77
@patient_session = patient_session
88
@programme = programme
9-
@triage = triage
9+
@triage_form = triage_form || default_triage_form
1010
end
1111

1212
def render?
@@ -15,7 +15,7 @@ def render?
1515

1616
private
1717

18-
attr_reader :patient_session, :programme, :triage
18+
attr_reader :patient_session, :programme, :triage_form
1919

2020
delegate :patient, :session, to: :patient_session
2121

@@ -35,6 +35,8 @@ def triage_status
3535
.find_by(programme:)
3636
end
3737

38+
delegate :status, to: :triage_status
39+
3840
def latest_triage
3941
@latest_triage ||=
4042
patient
@@ -45,5 +47,5 @@ def latest_triage
4547
.find_by(programme:)
4648
end
4749

48-
delegate :status, to: :triage_status
50+
def default_triage_form = TriageForm.new(patient_session:, programme:)
4951
end

app/components/app_programme_status_tags_component.rb

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ def initialize(programme_statuses, outcome:)
1010

1111
def call
1212
safe_join(
13-
programme_statuses.map do |programme, status|
14-
programme_status_tag(programme, status)
13+
programme_statuses.map do |programme, hash|
14+
status = hash[:status]
15+
vaccine_methods =
16+
(hash[:vaccine_methods] if programme.has_multiple_delivery_methods?)
17+
programme_status_tag(programme, status, vaccine_methods)
1518
end
1619
)
1720
end
@@ -20,7 +23,7 @@ def call
2023

2124
attr_reader :programme_statuses, :outcome
2225

23-
def programme_status_tag(programme, status)
26+
def programme_status_tag(programme, status, vaccine_methods)
2427
programme_tag =
2528
tag.strong(
2629
programme.name,
@@ -32,6 +35,14 @@ def programme_status_tag(programme, status)
3235

3336
status_tag = tag.strong(label, class: "nhsuk-tag nhsuk-tag--#{colour}")
3437

35-
tag.p(safe_join([programme_tag, status_tag]))
38+
vaccine_methods_span =
39+
if vaccine_methods.present?
40+
tag.span(
41+
Vaccine.human_enum_name(:method, vaccine_methods.join("_")),
42+
class: "nhsuk-u-secondary-text-color"
43+
)
44+
end
45+
46+
tag.p(safe_join([programme_tag, status_tag, vaccine_methods_span]))
3647
end
3748
end

app/components/app_session_actions_component.rb

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def consent_row(text, status:)
4949
return nil if count.zero?
5050

5151
href =
52-
session_consent_path(session, search_form: { consent_status: status })
52+
session_consent_path(session, search_form: { consent_statuses: [status] })
5353

5454
{
5555
key: {
@@ -58,7 +58,7 @@ def consent_row(text, status:)
5858
value: {
5959
text: I18n.t("children", count:)
6060
},
61-
actions: [{ text: "Review", href: }]
61+
actions: [{ text: "Review", visually_hidden_text: text.downcase, href: }]
6262
}
6363
end
6464

@@ -79,7 +79,9 @@ def triage_required_row
7979
value: {
8080
text: I18n.t("children", count:)
8181
},
82-
actions: [{ text: "Review", href: }]
82+
actions: [
83+
{ text: "Review", visually_hidden_text: "triage needed", href: }
84+
]
8385
}
8486
end
8587

@@ -100,7 +102,9 @@ def register_attendance_row
100102
value: {
101103
text: I18n.t("children", count:)
102104
},
103-
actions: [{ text: "Review", href: }]
105+
actions: [
106+
{ text: "Review", visually_hidden_text: "register attendance", href: }
107+
]
104108
}
105109
end
106110

@@ -137,7 +141,9 @@ def ready_for_vaccinator_row
137141
value: {
138142
text: safe_join(texts, tag.br)
139143
},
140-
actions: [{ text: "Review", href: }]
144+
actions: [
145+
{ text: "Review", visually_hidden_text: "ready for vaccinator", href: }
146+
]
141147
}
142148
end
143149
end

app/components/app_session_details_summary_component.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def consent_refused_row
4141
patient_sessions.has_consent_status(status, programme: programmes).count
4242

4343
href =
44-
session_consent_path(session, search_form: { consent_status: status })
44+
session_consent_path(session, search_form: { consent_statuses: [status] })
4545

4646
{
4747
key: {
@@ -50,7 +50,9 @@ def consent_refused_row
5050
value: {
5151
text: I18n.t("children", count:)
5252
},
53-
actions: [{ text: "Review", href: }]
53+
actions: [
54+
{ text: "Review", visually_hidden_text: "consent refused", href: }
55+
]
5456
}
5557
end
5658

@@ -78,7 +80,7 @@ def vaccinated_row
7880
value: {
7981
text: safe_join(texts, tag.br)
8082
},
81-
actions: [{ text: "Review", href: }]
83+
actions: [{ text: "Review", visually_hidden_text: "vaccinated", href: }]
8284
}
8385
end
8486
end

0 commit comments

Comments
 (0)