<< Masa.20110804-testcases-url-format-oddb_org | 2011 | Masa.20110802-debug-slupdate-oddb_org-testcases-bbmb_ch >>
Result
ch.bbmb.globopharm> test_statistics -> undefined local variable or method `resellsers' for #<BbmbApp:0x7f29d84d5ae0>
Note
Next
Experiment (src/util/bbmbapp.rb#test_statistics)
def test_statistics p "A" gid = '1' p "B" last_month = stat_last_month() p "C" resellers[gid].mail_statistics(last_month) p "D" @prevalence.statistics_mailed(gid, last_month) p "E" end
Run
Log
ch.bbmb.globopharm> test_statistics -> /usr/lib64/ruby/1.8/net/protocol.rb:206:in `initialize': Connection refused - connect(2)
"A" "B" "C" "getin mail_statistics in custom" "getin make_stats_and_total in custom" "getin make_statistics_export in custom"
Note
Experiment
require 'util/smtp_tls' ... def mail_send(mail, from, to) #smtp = Net::SMTP.new('localhost') smtp = Net::SMTP.new('smtp.gmail.com', 587) #smtp.start { #smtp.start("smpt_domain", "smtp_user", "smtp_password", :plain) { smtp.start("ywesee.com", "mhatakeyama@ywesee.com", "password", :plain) {
Result
Monatlicher Export verkaufte Produkte: Masapharm-03.08.2011 Verkaufte Produkte von 01. bis 31.07.2011 Attached: exportMasapharm-03.08.2011.csv
exportMasapharm-03.08.2011.csv
Total Umsatz;;;;;0.00 Umsatzbeteiligung exkl. MwSt.;;;;;0.00 MwSt. (8.0%);;;;;0.00 Umsatzbeteiligung inkl. MwSt. (8.0%);;;;;0.00
Note
Experiment
def test_statistics gid = '1' #last_month = stat_last_month() this_month = Time.local(now.year, now.mon)...Time.local(now.year, now.mon+1) #resellers[gid].mail_statistics(last_month) resellers[gid].mail_statistics(last_month) #@prevalence.statistics_mailed(gid, last_month) @prevalence.statistics_mailed(gid, this_month) end
Run
ch.bbmb.globopharm> test_statistics
Result
exportMasapharm-03.08.2011.csv
402858;masa;03.08.2011 08:07;;1;53000002;TYSABRI Inf Konz300mg/15ml Fl 15ml;2017.13 Total Umsatz;;;;;2017.13 Umsatzbeteiligung exkl. MwSt.;;;;;2.02 MwSt. (8.0%);;;;;0.02 Umsatzbeteiligung inkl. MwSt. (8.0%);;;;;2.03
Note
Problem
Experiment
ch.oddb> ODDB::Package.find_by_pharmacode('2204600').name -> Keppra 1000 mg, Filmtabletten ch.oddb> ODDB::Package.find_by_pharmacode('2204600').ddd_price -> 4.30 ch.oddb> ODDB::Package.find_by_pharmacode('2204600').galenic_group -> Tabletten ch.oddb> ODDB::Package.find_by_pharmacode('4876798').name -> Lev Desitin 1000 mg, Minipacks mit Mini-Filmtabletten ch.oddb> ODDB::Package.find_by_pharmacode('4876798').ddd_price -> ch.oddb> ODDB::Package.find_by_pharmacode('4876798').galenic_group -> unbekannt
Refer to src/model/package.rb#ddd_price
def ddd_price if(!@disable_ddd_price && (ddd = self.ddd) \ && (grp = galenic_group) && grp.match(@@ddd_galforms) \ && (price = price_public) && (ddose = ddd.dose) && (mdose = dose) \ && size = comparable_size) factor = (longevity || 1).to_f if(mdose > (ddose * factor)) (price / size.to_f) / factor else (price / size.to_f) \ * (ddose.to_f * factor / mdose.want(ddose.unit).to_f) / factor end end rescue RuntimeError end
Note
Experiment
ch.oddb> ODDB::Package.find_by_pharmacode('2204600').sequence.compositions[0].galenic_form.galenic_group -> Tabletten ch.oddb> ODDB::Package.find_by_pharmacode('4876798').sequence.compositions[0].galenic_form.galenic_group -> unbekannt ch.oddb> ODDB::Package.find_by_pharmacode('4876798').sequence.compositions[0].galenic_form.galenic_group = ODDB::Package.find_by_pharmacode('2204600').sequence.compositions[0].galenic_form.galenic_group -> Tabletten
Result
Note
Next
Experiment (bin/admin)
ch.oddb> open('/home/masa/work/log.dat','w'){|f| galenic_groups.keys.sort.each{|k| f.print k, "\t", galenic_groups[k], "\n"}}
Result
Experiment
Tabletten
, and 'Speichern'
Result
Task
Experiment
def _fachinfo(model, css='square infos') if(model.fachinfo_active?) link = HtmlGrid::Link.new(:square_fachinfo, model, @session, self) link.href = @lookandfeel._event_url(:fachinfo, {:swissmedicnr => model.iksnr}) link.css_class = css link.set_attribute('title', @lookandfeel.lookup(:fachinfo)) p "WWW" p link.href link end end
Run
Log
"WWW" "http://oddb.masa.org/de/gcc/fachinfo/swissmedicnr/55297" "WWW" "http://oddb.masa.org/de/gcc/fachinfo/swissmedicnr/55297" "WWW" "http://oddb.masa.org/de/gcc/fachinfo/swissmedicnr/55297" "WWW" "http://oddb.masa.org/de/gcc/fachinfo/swissmedicnr/55297" "WWW" "http://oddb.masa.org/de/gcc/fachinfo/swissmedicnr/55297" ...
Note
Experiment
def patinfo(model, session=@session)
if(model.has_patinfo?)
href = nil
klass = nil
if(pdf_patinfo = model.pdf_patinfo)
klass = HtmlGrid::PopupLink
href = @lookandfeel.resource_global(:pdf_patinfo, pdf_patinfo)
elsif(patinfo = model.patinfo and model.respond_to?(:sequence))
klass = HtmlGrid::Link
#href = @lookandfeel._event_url(:resolve, {'pointer' => patinfo.pointer})
href = @lookandfeel._event_url(:patinfo, {:seqnr => model.sequence.seqnr, :swissmedicnr => model.iksnr})
end
link = klass.new(:square_patinfo, model, @session, self)
link.href = href
link.set_attribute('title', @lookandfeel.lookup(:patinfo))
link.css_class = 'square infos'
link
end
end
def patinfo if (iksnr = @session.user_input(:swissmedicnr)) \ && (seqnr = @session.user_input(:seqnr)) \ && (reg = @session.app.registration(iksnr)) \ && (seq = reg.sequence(seqnr)) \ && (patinfo = seq.patinfo) State::Drugs::Patinfo.new(@session, patinfo) else Http404.new(@session, nil) end end
EVENTS = [ ... :patinfo, ... ]
Result
Note
Summary (URL, SBSM)
Commit
Next