class AppCompareConsentFormAndPatientComponent
Public Class Methods
Source
# File app/components/app_compare_consent_form_and_patient_component.rb, line 22 def initialize(consent_form:, patient:) @consent_form = consent_form @patient = patient end
Public Instance Methods
Source
# File app/components/app_compare_consent_form_and_patient_component.rb, line 27 def consent_form_rows [ { key: { text: "Full name" }, value: { text: highlight(consent_form.full_name, unless: full_name_match?) } }, if include_preferred_full_name_row? { key: { text: "Preferred name" }, value: { text: highlight( consent_form.preferred_full_name, unless: preferred_full_name_match? ) } } end, { key: { text: "Date of birth" }, value: { text: highlight( consent_form.date_of_birth.to_fs(:long), unless: date_of_birth_match? ) } }, { key: { text: "Address" }, value: { text: highlight( format_address_multi_line(consent_form), unless: address_match? ) } }, { key: { text: "School" }, value: { text: highlight(patient_school(consent_form), unless: school_match?) } }, { key: { text: "Parent" }, value: { text: format_parent_with_relationship(consent_form.parent_relationship) } } ].compact end
Source
# File app/components/app_compare_consent_form_and_patient_component.rb, line 95 def patient_rows [ { key: { text: "Full name" }, value: { text: patient.full_name } }, if include_preferred_full_name_row? { key: { text: "Preferred name" }, value: { text: patient.preferred_full_name } } end, { key: { text: "Date of birth" }, value: { text: patient.date_of_birth.to_fs(:long) } }, { key: { text: "Address" }, value: { text: format_address_multi_line(patient) } }, { key: { text: "School" }, value: { text: patient_school(patient) } }, if patient.parent_relationships.any? { key: { text: "Parents" }, value: { text: patient_parents(patient) } } end ].compact end