Class: Renalware::Forms::Generic::Homecare::V1::Medications

Inherits:
Base
  • Object
show all
Defined in:
lib/renalware/forms/generic/homecare/v1/medications.rb

Constant Summary

Constants inherited from Base

Base::TABLE_WIDTH

Constants inherited from Base

Base::CHECKBOX, Base::EMPTY_CHECKBOX

Instance Method Summary collapse

Methods inherited from Base

#heading, #table_styles

Methods inherited from Base

#borderless_table_style, #cell_with_leading_checkbox, #cell_with_trailing_checkbox, #underlined_table_style

Instance Method Details

#buildObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/renalware/forms/generic/homecare/v1/medications.rb', line 6

def build
  move_down 20
  font_size 10

  rows = []
  rows << [
    heading("Date"),
    heading("Drug"),
    heading("Dose"),
    heading("Route"),
    heading("Freq"),
    heading("Pharmacy comments")
  ]

  args.medications.map do |med|
    rows << [
      med.date.to_s,
      med.drug,
      med.dose,
      med.route,
      med.frequency,
      ""
    ]
  end

  table(
    rows,
    column_widths: {
      0 => 60,
      1 => 140,
      2 => 80,
      3 => 75,
      4 => 75,
      5 => 110
    },
    **table_styles,
    **underlined_table_style
  )
end