-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add link to create patients from consent forms
When an unmatched consent form doesn't map to any existing patient, we want to allow users to create a new patient record. This record should use an NHS number that's looked up via PDS, have a consent attached to it that matches the consent from the parent form, and a parent that also uses the details from the form.
- Loading branch information
Showing
5 changed files
with
83 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<% content_for :before_main do %> | ||
<%= render AppBacklinkComponent.new( | ||
href: consent_forms_path, | ||
name: "unmatched consent responses", | ||
) %> | ||
<% end %> | ||
<% page_title = "Create a new child record from this consent response?" %> | ||
<%= h1 page_title: do %> | ||
<span class="nhsuk-caption-l"> | ||
Consent response from <%= @consent_form.parent_full_name %> | ||
</span> | ||
<%= page_title %> | ||
<% end %> | ||
<%= render AppCardComponent.new do |c| %> | ||
<% c.with_heading { "Child record" } %> | ||
<%= render AppPatientSummaryComponent.new(@patient, | ||
show_preferred_name: true, | ||
show_address: true, | ||
show_parent_or_guardians: true) %> | ||
<% end %> | ||
<%= render AppCardComponent.new do |c| | ||
c.with_heading { "Consent response" } | ||
render AppConsentFormSummaryComponent.new( | ||
name: @consent_form.parent_full_name, | ||
relationship: @consent_form.parent_relationship_label, | ||
contact: { | ||
phone: @consent_form.parent_phone, | ||
email: @consent_form.parent_email, | ||
}, | ||
response: { | ||
text: @consent_form.summary_with_route, | ||
timestamp: @consent_form.recorded_at, | ||
}, | ||
refusal_reason: { | ||
reason: @consent_form.human_enum_name(:reason).presence, | ||
notes: @consent_form.reason_notes, | ||
}, | ||
) | ||
end %> | ||
<%= govuk_button_to "Create a new record from response", | ||
patient_consent_form_path(@consent_form) %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters