class Reporting::Nursing::ExemptJob < Reporting::Job
  def process
    students = @school.students
      .includes(:student_medical, nursing_vaccine_records: :vaccine)
      .has_vaccine_exemption(true)
      .where(id: @params['ids'])
      .ordered
      .order('StudentVaccines.Vaccine')
    @tmp_file = Pdf::Nursing::ExemptService.call(@school, students)
    @filename = "nursing_vaccine_exemptions_#{timestamp}.pdf"
    save_to_user
    send_report
  end
end
