20110630-export-gag-customer-data-testcases-oddb_org-view-11-state-4-model-1-command-1
<< | Index | >>
- Check source code bbmb.ch
- Testcases oddb.org
- Goal/Estimate/Evaluation
-
- Export customer data / 100% / 100%
- Testcases / 93% / 92.62%
- Milestones
-
- Summary
-
- Commits
-
Check source code bbmb.ch
Experiment (src/util/oddbapp.rb)
def output_active_users(file_path=nil)
dir = File.expand_path('../../data', File.dirname(__FILE__))
file_path ||= File.join(dir, 'active_users_' + Time.now.strftime('%Y%m%d') + '.csv')
open(file_path,'w') do |out|
out.print "EAN-Code,GAG-Code,Name,Address,Last Login Time\n"
users.values.each do |user|
if user.name == 'hospital' and user.value(:active) == 'y'
out.print user.value(:customer_ean13), ",", user.value(:customer_id), ",", user.value(:firstname), " ", user.value(:lastname), ",", user.value(:address1), " ", user.value(:address2), " ", user.value(:address3), ",", user.value(:last_login), "\n"
end
end
end
file_path
end
Run
masa@masa ~/ywesee/bbmb.ch $ bin/admin
ch.bbmb.globopharm> output_active_users
-> /home/masa/ywesee/bbmb.ch/data/active_users_20110630.csv
Result
masa@masa ~/ywesee/bbmb.ch $ cat data/active_users_20110630.csv
EAN-Code,GAG-Code,Name,Address,Last Login Time
7601001056657,584674,firstname lastname,add1 hoge hoge 11 ,Thu Jun 30 07:50:08 +0200 2011
Restart bbmbd online server
- It takes about 5 minutes to reboot bbmbd
Commit
IMPORTANT
- Never use ',' (comma) for csv file, use ';' (semicolon)
- Sometimes, name and address data includes ',' (comma)
Testcases oddb.org
src/view/admin/indication.rb (coverage: 100%)
src/view/exception.rb (coverage: 100%)
src/view/hospitals/centeredsearchform.rb (coverage: 100%)
src/view/substances/centeredsearchform.rb (coverage: 100%)
src/view/user/passthru.rb (coverage: 100%)
src/view/admin/patinfopreview.rb (coverage: 100%)
src/view/user/auth_info.rb (coverage: 100%)
src/view/substances/centeredsearchform.rb (coverage: 100%)
src/view/user/sponsorlink.rb (coverage: 100%)
src/view/confirm.rb (coverage: 100%)
src/view/resulttemplate.rb (coverage: 100%)
src/state/drugs/fachinfos.rb (coverage: 100%)
src/state/user/contributor.rb (coverage: 100%)
src/state/admin/global.rb (coverage: 100%)
src/state/user/download.rb (coverage: 100%)
src/command/accept_orphan.rb (coverage: 100%)
src/model/sequence_observer.rb (coverage: 100%)
- src/state/drugs/ddd.rb (coverage: 39.39%)
- src/state/ajax/ddd_chart.rb (coverage: 37.50%)
- src/state/drugs/init.rb (coverage: 75.00%)
- src/state/drugs/payment_method.rb (coverage: 46.88%)
- src/state/substances/result.rb (coverage: 46.88%)
- src/remote/sequence.rb (coverage: 42.42%)
Commit