Skip to content
Merged

1.1 #2489

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
9afec60
Replace outcome column with status
tvararu Nov 19, 2024
c2bee77
Remove unique constraint on Gillick assessment patient_session_id
thomasleese Nov 20, 2024
f737bf0
Model Gillick assessments as one-to-many
thomasleese Nov 20, 2024
6ae66db
Show Gillick assessments in activity log
thomasleese Nov 20, 2024
cfb846d
Amend Gillick assessments rather than replacing
thomasleese Nov 20, 2024
782f0c3
Refactor GillickAssessmentsController
thomasleese Nov 20, 2024
ae7cc6a
Show archived or expired batches when editing records
thomasleese Nov 21, 2024
2f25aa1
Use full layout for vaccines views
paulrobertlloyd Nov 20, 2024
5e1b54a
Use secondary button for add a new batch link
paulrobertlloyd Nov 20, 2024
1142d78
Use normal paragraph for vaccine manufacturer
paulrobertlloyd Nov 20, 2024
8ba2830
Handle sending texts from a consent correctly
thomasleese Nov 21, 2024
b7105cf
Validate that either parent phone or email is present
thomasleese Nov 21, 2024
2df13e7
Hide "Edit vaccination record" button for admins
thomasleese Nov 21, 2024
db3fd33
Add autocomplete values to relevant consent form fields
paulrobertlloyd Nov 21, 2024
5decdaa
Conditionally show links in footer
paulrobertlloyd Nov 21, 2024
f28f0ba
Avoid including before using PatientMerger
thomasleese Nov 21, 2024
8806e16
Allow looking up NHS numbers for invalidated patients
thomasleese Nov 21, 2024
e38ae90
Look up NHS numbers for invalidated patients
thomasleese Nov 21, 2024
c03b324
Redirect user to import page if file is small
thomasleese Nov 22, 2024
fd08637
Prevent importing class lists or cohorts with duplicate NHS numbers
thomasleese Nov 22, 2024
7baf305
Allow navigating back to draft consent/vaccination record
thomasleese Nov 22, 2024
c3de276
Refactor OfflineSessionExporter
thomasleese Nov 25, 2024
632c4d6
Strike through invalidated NHS numbers
thomasleese Nov 25, 2024
dc218ba
Show session academic year on patients page
thomasleese Nov 25, 2024
36e7e59
Allow not passing year_groups if programme is passed in
thomasleese Nov 27, 2024
2deb175
Remove percentage_of
thomasleese Nov 27, 2024
2f93c63
Remove Programme::PatientsController
thomasleese Nov 27, 2024
73b3f47
Add filtering patients by date of birth
thomasleese Nov 27, 2024
67fed49
Add available_states to PatientSessionStateConcern
tvararu Nov 19, 2024
2c05c3c
Add filtering by patient status
tvararu Nov 19, 2024
cff407c
Shrink checkboxes in patient filters
tvararu Nov 27, 2024
bf0c543
Don't create patient sessions in UnscheduledSessionsFactory
thomasleese Nov 27, 2024
e7d6f0f
Add Patient#in_organisation scope
thomasleese Nov 27, 2024
c538a8b
Always set ConsentForm#school
thomasleese Nov 27, 2024
8ccb814
Consolidate school and home_educated values
thomasleese Nov 27, 2024
c2d9850
Validate patient school and home educated
thomasleese Nov 27, 2024
810a4e5
Add migration to consolidate patient school and home educated values
thomasleese Nov 28, 2024
795590e
Fix alignment of button group
paulrobertlloyd Nov 28, 2024
67e8af2
Remove app-summary-list--no-bottom-border class
paulrobertlloyd Nov 28, 2024
640650c
Update text and colour for consent status
paulrobertlloyd Nov 28, 2024
d6d3eab
Remove bottom margin on form buttons
paulrobertlloyd Nov 28, 2024
3de2135
Remove unused app-table--select-cohort table styles
paulrobertlloyd Nov 28, 2024
6e50ecd
Update usage of app-table--csv and app-table--small styles
paulrobertlloyd Nov 28, 2024
421f3c7
Remove unused app-table--patients styles
paulrobertlloyd Nov 28, 2024
63f7e04
Add table row status styling for consent responses
paulrobertlloyd Nov 28, 2024
5cc646a
Update text and colour for consent status
paulrobertlloyd Nov 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/assets/stylesheets/_button-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
gap: nhsuk-spacing(3) nhsuk-spacing(4);

@include mq($from: tablet) {
align-items: baseline;
flex-direction: row;
flex-wrap: wrap;
}
Expand Down
1 change: 1 addition & 0 deletions app/assets/stylesheets/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ $app-cis2-button-shadow-color: #003087;
$button-shadow-size: 4px;

.nhsuk-button {
.button_to &,
.nhsuk-table & {
margin-bottom: 0;
}
Expand Down
16 changes: 16 additions & 0 deletions app/assets/stylesheets/_patients.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@
@include govuk-media-query($from: desktop) {
order: 2;
}

.nhsuk-checkboxes__label {
padding-left: 0;

&::before {
border-width: 3px;
padding: 0;
transform: scale(0.6667);
transform-origin: center left;
}

&::after {
left: 3px;
transform: rotate(-45deg) scale(0.6667);
}
}
}

& &__table {
Expand Down
13 changes: 7 additions & 6 deletions app/assets/stylesheets/_summary-list.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
.app-summary-list--no-bottom-border {
.nhsuk-summary-list__row:last-child {
.nhsuk-summary-list__key,
.nhsuk-summary-list__value,
.nhsuk-summary-list__actions {
border-bottom: none;
// Ensure width of value cell not affected by presence of actions cell
.nhsuk-summary-list:where(:not(:has(.nhsuk-summary-list__actions))) {
.nhsuk-summary-list__value {
@include mq($from: tablet) {
width: 70%;
}
}
}
Expand Down Expand Up @@ -36,6 +35,7 @@
}
}

// Full width summary list
.app-summary-list--full-width {
.nhsuk-summary-list__row {
border-bottom: 1px solid $nhsuk-border-color;
Expand All @@ -59,6 +59,7 @@

.nhsuk-summary-list__key {
margin-bottom: 0;
padding: 0;
}

.nhsuk-summary-list__value {
Expand Down
66 changes: 24 additions & 42 deletions app/assets/stylesheets/_table.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
.app-table--csv {
i {
color: shade($color_nhsuk-red, 50%);
font-family: ui-monospace, monospace;
font-style: normal;
font-weight: 500;
padding: 2px;
}
}

.app-table--small {
th,
td {
Expand All @@ -12,53 +22,25 @@
}
}

.app-table--patients {
margin: 0;

.nhsuk-table__cell {
padding-top: nhsuk-spacing(2);
padding-bottom: nhsuk-spacing(2);
.app-table__cell-status {
&--aqua-green:first-of-type {
border-left: nhsuk-spacing(2) solid $color_nhsuk-aqua-green;
padding-left: nhsuk-spacing(3);
}
}

.app-table--select-cohort {
.nhsuk-table__cell,
th {
padding-top: nhsuk-spacing(1);
padding-bottom: nhsuk-spacing(1);
vertical-align: middle;
}
&--grey {
background-color: $color_nhsuk-grey-5;
color: $nhsuk-secondary-text-color;

.nhsuk-checkboxes {
padding: 0;
transform-origin: center left;
transform: scale(0.75);
&:first-of-type {
border-left: nhsuk-spacing(2) solid $color_nhsuk-grey-3;
padding-left: nhsuk-spacing(3);
}
}

.nhsuk-checkboxes__item {
padding: 0;
}
}

.app-table--csv {
th,
td {
@include nhsuk-typography-responsive(16);
@include nhsuk-responsive-padding(2, "bottom");
@include nhsuk-responsive-padding(3, "right");
@include nhsuk-responsive-padding(2, "top");
}

caption {
@include nhsuk-font($size: 19, $weight: bold);
}

i {
color: shade($color_nhsuk-red, 50%);
font-family: ui-monospace, monospace;
font-style: normal;
font-weight: 500;
padding: 2px;
&--red:first-of-type {
border-left: nhsuk-spacing(2) solid $color_nhsuk-red;
padding-left: nhsuk-spacing(3);
}
}

Expand Down
25 changes: 25 additions & 0 deletions app/components/app_activity_log_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ def initialize(patient: nil, patient_session: nil)
@patient = patient || patient_session.patient
@patient_sessions =
patient_session ? [patient_session] : patient.patient_sessions

@consents = (patient || patient_session).consents
@gillick_assessments = (patient || patient_session).gillick_assessments
@triages = (patient || patient_session).triages
@vaccination_records =
(patient || patient_session).vaccination_records.with_discarded
Expand All @@ -22,6 +24,7 @@ def initialize(patient: nil, patient_session: nil)
attr_reader :patient,
:patient_sessions,
:consents,
:gillick_assessments,
:triages,
:vaccination_records

Expand All @@ -32,6 +35,7 @@ def events_by_day
def all_events
[
consent_events,
gillick_assessment_events,
notify_events,
session_events,
triage_events,
Expand Down Expand Up @@ -81,6 +85,27 @@ def consent_events
end
end

def gillick_assessment_events
gillick_assessments.each_with_index.map do |gillick_assessment, index|
action = index.zero? ? "Completed" : "Updated"
outcome =
(
if gillick_assessment.gillick_competent?
"Gillick competent"
else
"not Gillick competent"
end
)

{
title: "#{action} Gillick assessment as #{outcome}",
notes: gillick_assessment.notes,
time: gillick_assessment.created_at,
by: gillick_assessment.performed_by.full_name
}
end
end

def notify_events
patient.notify_log_entries.map do
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,15 @@ def address_match?
end

def school_match?
if consent_form.education_setting_school?
(consent_form.school || consent_form.location) == patient.school
elsif consent_form.education_setting_home?
patient.home_educated
else
patient.school.nil? && !patient.home_educated
end
consent_form.home_educated == patient.home_educated &&
consent_form.school == patient.school
end

def consent_form_patient
if consent_form.education_setting_school?
Patient.new(school: consent_form.school || consent_form.location)
elsif consent_form.education_setting_home?
Patient.new(school: nil, home_educated: true)
else
Patient.new(school: nil, home_educated: false)
end
Patient.new(
school: consent_form.school,
home_educated: consent_form.home_educated
)
end

def consent_form_parent
Expand Down
12 changes: 9 additions & 3 deletions app/components/app_consent_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,19 @@
<%= table.with_body do |body| %>
<% consents.each do |consent| %>
<%= body.with_row do |row| %>
<%= row.with_cell do %>
<%= row.with_cell(classes: "app-table__cell-status--#{status_colour(consent)}") do %>
<%= govuk_link_to consent&.parent&.full_name || consent.patient.full_name, session_patient_consent_path(session, patient, consent, section:, tab:) %>
<br>
<span class="nhsuk-u-font-size-16"><%= consent.who_responded %></span>
<% end %>
<%= row.with_cell(text: consent.responded_at.to_fs(:long)) %>
<%= row.with_cell(text: helpers.consent_decision(consent)) %>
<%= row.with_cell(
classes: "app-table__cell-status--#{status_colour(consent)}",
text: consent.responded_at.to_fs(:long),
) %>
<%= row.with_cell(
classes: "app-table__cell-status--#{status_colour(consent)}",
text: helpers.consent_decision(consent),
) %>
<% end %>
<% end %>
<% end %>
Expand Down
12 changes: 12 additions & 0 deletions app/components/app_consent_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,16 @@ def can_send_consent_request?
patient_session.no_consent? && patient.send_notifications? &&
session.open_for_consent? && patient.parents.any?
end

def status_colour(consent)
if consent.invalidated? || consent.withdrawn?
"grey"
elsif consent.response_given?
"aqua-green"
elsif consent.response_refused?
"red"
else
"grey"
end
end
end
4 changes: 1 addition & 3 deletions app/components/app_consent_form_summary_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ def initialize(
end

def call
govuk_summary_list(
classes: "app-summary-list--no-bottom-border"
) do |summary_list|
govuk_summary_list do |summary_list|
summary_list.with_row do |row|
row.with_key { "Name" }
row.with_value { name }
Expand Down
4 changes: 1 addition & 3 deletions app/components/app_consent_patient_summary_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ def initialize(consent)
end

def call
govuk_summary_list(
classes: "app-summary-list--no-bottom-border nhsuk-u-margin-bottom-0"
) do |summary_list|
govuk_summary_list do |summary_list|
summary_list.with_row do |row|
row.with_key { "Full name" }
row.with_value { patient.full_name }
Expand Down
6 changes: 3 additions & 3 deletions app/components/app_consent_status_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
class AppConsentStatusComponent < ViewComponent::Base
def call
if @patient_session.consent_given?
icon_tick "Given", "blue"
icon_tick "Consent given", "aqua-green"
elsif @patient_session.consent_refused?
icon_cross "Refused", "red"
icon_cross "Consent refused", "red"
elsif @patient_session.consent_conflicts?
icon_cross "Conflicts", "dark-orange"
icon_cross "Conflicting consent", "dark-orange"
end
end

Expand Down
5 changes: 1 addition & 4 deletions app/components/app_consent_summary_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ def initialize(consent, change_links: {})
end

def call
govuk_summary_list(
actions: @change_links.present?,
classes: "app-summary-list--no-bottom-border nhsuk-u-margin-bottom-0"
) do |summary_list|
govuk_summary_list(actions: @change_links.present?) do |summary_list|
if @consent.responded_at.present?
summary_list.with_row do |row|
row.with_key { "Response date" }
Expand Down
2 changes: 1 addition & 1 deletion app/components/app_health_questions_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class AppHealthQuestionsComponent < ViewComponent::Base
erb_template <<-ERB
<dl class="nhsuk-summary-list app-summary-list--full-width nhsuk-u-margin-bottom-0">
<dl class="nhsuk-summary-list app-summary-list--full-width">
<% health_answers.each do |question, answers| %>
<div class="nhsuk-summary-list__row">
<dt class="nhsuk-summary-list__key">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%= govuk_details(summary_text:) do %>
<p class="nhsuk-body">Make sure the CSV you upload uses the following columns:</p>

<%= govuk_table(classes: "app-table--csv") do |table|
<%= govuk_table(classes: "app-table--csv app-table--small") do |table|
table.with_head do |head|
head.with_row do |row|
row.with_cell(text: "Column name")
Expand Down
2 changes: 1 addition & 1 deletion app/components/app_matching_criteria_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= govuk_summary_list classes: "app-summary-list--no-bottom-border" do |summary_list|
<%= govuk_summary_list do |summary_list|
summary_list.with_row do |row|
row.with_key { "Child" }
row.with_value { child_full_name }
Expand Down
2 changes: 1 addition & 1 deletion app/components/app_outcome_banner_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def initialize(patient_session:, current_user: nil)
def call
render AppCardComponent.new(colour:) do |c|
c.with_heading { heading }
govuk_summary_list(classes: "app-summary-list--no-bottom-border", rows:)
govuk_summary_list(rows:)
end
end

Expand Down
12 changes: 7 additions & 5 deletions app/components/app_patient_page_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<% if display_gillick_assessment_card? %>
<%= render AppCardComponent.new do |c| %>
<% c.with_heading { "Gillick assessment" } %>
<% if (gillick_assessment = patient_session.gillick_assessment) %>
<% if (gillick_assessment = patient_session.latest_gillick_assessment) %>
<% if gillick_assessment.gillick_competent? %>
<p class="app-status app-status--aqua-green">
<svg class="nhsuk-icon nhsuk-icon__tick" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true">
Expand Down Expand Up @@ -53,7 +53,7 @@
<% elsif gillick_assessment_can_be_recorded? %>
<p class="nhsuk-body">
<%= govuk_button_link_to "Assess Gillick competence",
new_session_patient_gillick_assessment_path(
edit_session_patient_gillick_assessment_path(
session,
patient,
section: @section,
Expand Down Expand Up @@ -110,9 +110,11 @@

<% if Flipper.enabled?(:release_1b) %>
<div class="app-button-group">
<%= govuk_button_to "Edit vaccination record",
programme_vaccination_record_path(vaccination_record.programme, vaccination_record),
method: :put, class: "app-button--secondary" %>
<% if helpers.policy(vaccination_record).edit? %>
<%= govuk_button_to "Edit vaccination record",
programme_vaccination_record_path(vaccination_record.programme, vaccination_record),
method: :put, class: "app-button--secondary" %>
<% end %>

<% if helpers.policy(vaccination_record).destroy? %>
<%= govuk_link_to "Delete vaccination record", destroy_vaccination_record_session_patient_vaccinations_path(patient_id: patient.id, vaccination_record_id: vaccination_record.id) %>
Expand Down
2 changes: 1 addition & 1 deletion app/components/app_patient_page_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ def gillick_assessment_can_be_recorded?
end

def gillick_assessment_recorded?
patient_session.gillick_assessment.present?
patient_session.latest_gillick_assessment.present?
end
end
Loading
Loading