class PatientSearchForm
Attributes
Public Class Methods
Source
# File app/forms/patient_search_form.rb, line 22 def initialize(current_user:, session: nil, **attributes) @current_user = current_user @session = session super(**attributes) end
Calls superclass method
SearchForm::new
Public Instance Methods
Source
# File app/forms/patient_search_form.rb, line 70 def any_filters_applied? attributes.any? { |_, v| v.present? } end
Source
# File app/forms/patient_search_form.rb, line 53 def apply(scope) scope = filter_aged_out_of_programmes(scope) scope = filter_archived(scope) scope = filter_date_of_birth_year(scope) scope = filter_invited_to_clinic(scope) scope = filter_name(scope) scope = filter_nhs_number(scope) scope = filter_patient_specific_direction_status(scope) scope = filter_programme_statuses(scope) scope = filter_programmes(scope) scope = filter_registration_status(scope) scope = filter_vaccine_criteria(scope) scope = filter_year_groups(scope) scope.order_by_name end
Source
# File app/forms/patient_search_form.rb, line 32 def programme_statuses=(values) super(values&.compact_blank || []) end
Calls superclass method
Source
# File app/forms/patient_search_form.rb, line 28 def programme_types=(values) super(values&.compact_blank || []) end
Calls superclass method
Source
# File app/forms/patient_search_form.rb, line 44 def programmes @programmes ||= if programme_types.present? Programme.find_all(programme_types) else session&.programmes || team&.programmes || [] end end
Source
# File app/forms/patient_search_form.rb, line 36 def vaccine_criteria=(values) super(values&.compact_blank || []) end
Calls superclass method
Source
# File app/forms/patient_search_form.rb, line 40 def year_groups=(values) super(values&.compact_blank&.map(&:to_i)&.compact || []) end
Calls superclass method