Permalink
Browse files

Finished patient activity report csv export

  • Loading branch information...
1 parent 894410a commit 49e90bdecb609fe5800a094137d457383f823c5d Catchit committed Feb 23, 2012
Showing with 10 additions and 0 deletions.
  1. +10 −0 application/lib/csv_helper.rb
@@ -141,6 +141,16 @@ def export_to_csv(report_name, report_headers, report_data, patient_type,groupin
end
when 'patient_activity_report'
+ FasterCSV.open(output_file, 'w',:headers => report_headers) do |csv|
+ csv << report_headers
+ report_data.reverse.map do |data|
+ csv << ["#{grouping} beginning : #{data[:start_date]} ending : #{data[:end_date]}",
+ "#{data[:total] rescue 0}", "#{data[:symptoms] rescue 0}",
+ "#{data[:symptoms_pct] rescue 0}", "#{data[:danger] rescue 0}",
+ "#{data[:danger_pct] rescue 0}", "#{data[:info] rescue 0}",
+ "#{data[:info_pct] rescue 0}"]
+ end
+ end
when 'patient_referral_report'

0 comments on commit 49e90bd

Please sign in to comment.