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

Version Path
renalware-core-2.0.159 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.158 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.157 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.156 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.155 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.153 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.152 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.151 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.149 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.148 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.147 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.146 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.145 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.144 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.143 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.142 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.141 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.140 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.139 app/models/renalware/letters/pathology_layout.rb
renalware-core-2.0.138 app/models/renalware/letters/pathology_layout.rb