Created
December 18, 2019 18:53
-
-
Save sirramongabriel/20aa8396882bfb34d0d60a0517deaf18 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sample_method | |
count = 0 | |
med_name_count = 0 | |
given_at_count = 0 | |
# Ignore current_month var as it is for the histogram | |
# current_month = (Date.current.beginning_of_month..Date.current.end_of_month).to_a | |
@pdf = FillablePDF.new('app/pdfs/medication_record_form.pdf') | |
all_meds.each_slice(5) do |page| | |
page.map do |med| | |
count += 1 | |
if med_name_count >= 5 | |
med_name_count = 0 | |
end | |
@pdfs["pdf_#{count}".to_sym] = @pdf.set_field("med#{med_name_count += 1}_name", med.name) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment