Skip to content

Commit 9669e2a

Browse files
Add source to vaccination record UI
This adds a column to display `source` in the table of vaccination records at the bottom of the patient overview page. It also adds a row to the vaccination record view page
1 parent e228ded commit 9669e2a

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed

app/components/app_patient_vaccination_table_component.html.erb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<% row.with_cell(text: "Vaccination date") %>
88
<% row.with_cell(text: "Location") %>
99
<% row.with_cell(text: "Programme") if show_programme %>
10+
<% row.with_cell(text: "Source") %>
1011
<% row.with_cell(text: "Outcome") %>
1112
<% end %>
1213
<% end %>
@@ -39,6 +40,11 @@
3940
<% end %>
4041
<% end %>
4142

43+
<% row.with_cell do %>
44+
<span class="nhsuk-table-responsive__heading">Source</span>
45+
<%= vaccination_record.human_enum_name(:source) %>
46+
<% end %>
47+
4248
<% row.with_cell do %>
4349
<span class="nhsuk-table-responsive__heading">Outcome</span>
4450
<%= helpers.vaccination_record_status_tag(vaccination_record) %>

app/components/app_vaccination_record_summary_component.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,13 @@ def call
257257
end
258258
end
259259

260+
if @vaccination_record.respond_to?(:source)
261+
summary_list.with_row do |row|
262+
row.with_key { "Source" }
263+
row.with_value { source_value }
264+
end
265+
end
266+
260267
if @vaccination_record.respond_to?(:sync_status) &&
261268
Flipper.enabled?(:immunisations_fhir_api_integration)
262269
summary_list.with_row do |row|
@@ -278,6 +285,13 @@ def call
278285
:vaccination_record_location,
279286
to: :helpers
280287

288+
def source_value
289+
highlight_if(
290+
@vaccination_record.human_enum_name(:source),
291+
@vaccination_record.source_changed?
292+
)
293+
end
294+
281295
def outcome_value
282296
highlight_if(
283297
VaccinationRecord.human_enum_name(:outcome, @vaccination_record.outcome),

config/locales/en.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,11 @@ en:
269269
pending: Sync pending
270270
synced: Synced
271271
failed: Sync failed
272+
sources:
273+
service: Recorded in Mavis
274+
historical_upload: Uploaded as a historical vaccination
275+
nhs_immunisations_api: External source such as GP practice
276+
consent_refusal: Parent reported already vaccinated
272277
vaccine:
273278
methods:
274279
injection: Injection

spec/components/app_vaccination_record_summary_component_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@
311311
end
312312
end
313313

314+
314315
describe "notes row" do
315316
it do
316317
expect(rendered).to have_css(
@@ -319,6 +320,15 @@
319320
)
320321
end
321322

323+
describe "source row" do
324+
it do
325+
expect(rendered).to have_css(
326+
".nhsuk-summary-list__row",
327+
text: "SourceRecorded in Mavis"
328+
)
329+
end
330+
end
331+
322332
context "when the notes are not present" do
323333
let(:notes) { nil }
324334

0 commit comments

Comments
 (0)