<% entries_by_section = {} udcs = nil if measures.length > 0 udcs = unique_data_criteria(measures) end Record::Sections.each do |section| if section != :insurance_providers if patient.respond_to? section patient.send(section).each do |entry| if udcs.nil? || entry_matches_criteria(entry, udcs) decoded_section = decode_hqmf_section(section, entry.oid) entries_by_section[decoded_section] ||= [] entries_by_section[decoded_section] << entry end end end end end %> <% entries_by_section.each do |section, entries| %> <%== render :partial => 'section', :locals => {entries: entries, section: section, code_map: code_map, by_encounter: false} %> <% end %>