class StatusGenerator::Consent
Public Class Methods
Source
# File app/lib/status_generator/consent.rb, line 4 def initialize( programme_type:, academic_year:, patient:, consents:, vaccination_records:, parents:, sessions:, consent_notifications: ) @programme_type = programme_type @academic_year = academic_year @patient = patient @consents = consents @vaccination_records = vaccination_records @parents = parents @sessions = sessions @consent_notifications = consent_notifications end
Public Instance Methods
Source
# File app/lib/status_generator/consent.rb, line 50 def date consents_for_status.map(&:submitted_at).max.to_date end
Source
# File app/lib/status_generator/consent.rb, line 62 def disease_types status_should_be_given? ? agreed_disease_types : [] end
Source
# File app/lib/status_generator/consent.rb, line 24 def programme Programme.find(programme_type, disease_types:, patient:) end
Source
# File app/lib/status_generator/consent.rb, line 28 def status if status_should_be_given? :given elsif status_should_be_refused? :refused elsif status_should_be_follow_up_requested? :follow_up_requested elsif status_should_be_conflicts? :conflicts elsif status_should_be_no_contact_details? :no_contact_details elsif status_should_be_request_scheduled? :request_scheduled elsif status_should_be_request_not_scheduled? :request_not_scheduled elsif status_should_be_no_response? :no_response else :not_required end end
Source
# File app/lib/status_generator/consent.rb, line 54 def vaccine_methods status_should_be_given? ? agreed_vaccine_methods : [] end
Source
# File app/lib/status_generator/consent.rb, line 58 def without_gelatine status_should_be_given? ? agreed_without_gelatine : nil end