Sha256: 995802a26eec552a9f95443e87f6676087c454854647ce30ddb91fd91e79a4cb

Contents?: true

Size: 723 Bytes

Versions: 24

Compression:

Stored size: 723 Bytes

Contents

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

24 entries across 24 versions & 1 rubygems

Version Path
renalware-core-2.0.37 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.36 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.35 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.34 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.33 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.32 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.31 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.30 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.28 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.27 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.26 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.25 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.24 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.23 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.22 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.21 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.20 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.18 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.17 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.16 app/models/renalware/letters/pathology_layout.rb