Sha256: f94eeafeb9a224b473fffb703e5bf316f6b536c72232986369541f0eac060100
Contents?: true
Size: 1.14 KB
Versions: 20
Compression:
Stored size: 1.14 KB
Contents
require_dependency "renalware/reporting" module Renalware module Reporting class FetchAuditJson class << self def call(view_name) convert_rows_from_audit_view_into_datatables_compatible_json(view_name) end def convert_rows_from_audit_view_into_datatables_compatible_json(view_name) conn = ActiveRecord::Base.connection result = conn.execute("select audit_view_as_json(#{conn.quote(view_name)});") result.values[0][0] end end # A WIP to translate audit column names into human friendly ones. # May need to establish guidelines for instance apply text case in the view itself so # eg pct_HGB = % HGB without having to know to upcase certain bits of the name but # capitalise others etc. # def self.humanize_column_name(column) # column # .gsub("pct_", "% ") # .gsub("count_", "No.") # .gsub("avg_", "Avg ") # .gsub("max", "Max ") # .gsub("gt_eq_", "≥ ") # .gsub("lt_eq_", "≤ ") # .gsub("gt_", "> ") # .gsub("lt_", "< ") # end end end end
Version data entries
20 entries across 20 versions & 1 rubygems