class Reporting::Nursing::ImmunizationsJob < Reporting::Job
  def process
    students = @school.students.where(id: @params['ids']).ordered
    create_tmp_file
    create_pdf
    students.each do |student|
      file = Pdf::Nursing::ImmunizationsService.call(student)
      @pdf << CombinePDF.load(file.path)
    end
    save_pdf
    @filename = "nursing_immunizations_#{timestamp}.pdf"
    save_to_user
    send_report
  end
end
