Sha256: 32194f1f3ece0c89f5f4155a1196de4a0b385e827ae619f8a44eeb607642dad0
Contents?: true
Size: 753 Bytes
Versions: 71
Compression:
Stored size: 753 Bytes
Contents
# frozen_string_literal: true require_dependency "renalware/letters" module Renalware module Letters class PathologyLayout # This method helps us iterate over the pathology required in a letter. # Path in letters should be grouped and ordered within that group. # We might display a date only once a group for instance. def each_group Pathology::ObservationDescription .select(:id, :code, :letter_group, :letter_order) .where("letter_group is not null") .order("letter_group asc, letter_order asc") .group_by(&:letter_group) .each do |group_number, descriptions| yield(group_number, descriptions) if block_given? end end end end end
Version data entries
71 entries across 71 versions & 1 rubygems