<< | Index | >>
solved
solved
solved
solved
solved
solved
deleted
solved
solved
solved
solved
Commit
Check
masa@masa ~/ywesee/oddb.org/test/test_view $ ruby suite.rb ... 33 tests, 61 assertions, 0 failures, 0 errors masa@masa ~/ywesee/oddb.org/test/test_state $ ruby suite.rb ... 88 tests, 191 assertions, 2 failures, 3 errors
Note
Commit
Plugin: ODDB::CsvExportPlugin Error: NoMethodError Message: undefined method `bsv_dossier' for nil:NilClass Backtrace: /usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:112:in `send' /usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:112:in `method_missing' /var/www/oddb.org/src/view/drugs/csv_result.rb:72:in `bsv_dossier' /var/www/oddb.org/src/view/drugs/csv_result.rb:315:in `send' /var/www/oddb.org/src/view/drugs/csv_result.rb:315:in `to_csv' /var/www/oddb.org/src/view/drugs/csv_result.rb:313:in `collect' /var/www/oddb.org/src/view/drugs/csv_result.rb:313:in `to_csv' /var/www/oddb.org/src/view/drugs/csv_result.rb:311:in `each' /var/www/oddb.org/src/view/drugs/csv_result.rb:311:in `to_csv' /var/www/oddb.org/src/view/drugs/csv_result.rb:309:in `each' /var/www/oddb.org/src/view/drugs/csv_result.rb:309:in `to_csv' /var/www/oddb.org/src/view/drugs/csv_result.rb:330:in `to_csv_file' /var/www/oddb.org/src/view/drugs/csv_result.rb:330:in `open' /var/www/oddb.org/src/view/drugs/csv_result.rb:330:in `to_csv_file' /var/www/oddb.org/src/plugin/csv_export.rb:54:in `_export_drugs' /var/www/oddb.org/src/plugin/csv_export.rb:24:in `export_drugs' /var/www/oddb.org/src/util/updater.rb:81:in `export_oddb_csv' /var/www/oddb.org/src/util/updater.rb:461:in `call' /var/www/oddb.org/src/util/updater.rb:461:in `wrap_update' /var/www/oddb.org/src/util/updater.rb:79:in `export_oddb_csv' /var/www/oddb.org/src/util/updater.rb:266:in `update_bsv_followers' (eval):1:in `_admin' /var/www/oddb.org/src/util/failsafe.rb:9:in `call' /var/www/oddb.org/src/util/failsafe.rb:9:in `failsafe' /var/www/oddb.org/src/util/oddbapp.rb:1399:in `_admin' /var/www/oddb.org/src/util/oddbapp.rb:1397:in `initialize' /var/www/oddb.org/src/util/oddbapp.rb:1397:in `new' /var/www/oddb.org/src/util/oddbapp.rb:1397:in `_admin' /usr/lib64/ruby/1.8/drb/drb.rb:1555:in `__send__' /usr/lib64/ruby/1.8/drb/drb.rb:1555:in `perform_without_block' /usr/lib64/ruby/1.8/drb/drb.rb:1515:in `perform' /usr/lib64/ruby/1.8/drb/drb.rb:1589:in `main_loop' /usr/lib64/ruby/1.8/drb/drb.rb:1585:in `loop' /usr/lib64/ruby/1.8/drb/drb.rb:1585:in `main_loop' /usr/lib64/ruby/1.8/drb/drb.rb:1581:in `start' /usr/lib64/ruby/1.8/drb/drb.rb:1581:in `main_loop' /usr/lib64/ruby/1.8/drb/drb.rb:1430:in `run' /usr/lib64/ruby/1.8/drb/drb.rb:1427:in `start' /usr/lib64/ruby/1.8/drb/drb.rb:1427:in `run' /usr/lib64/ruby/1.8/drb/drb.rb:1347:in `initialize' /usr/lib64/ruby/1.8/drb/drb.rb:1627:in `new' /usr/lib64/ruby/1.8/drb/drb.rb:1627:in `start_service' /var/www/oddb.org/bin/oddbd:38
Next
Experiment
def to_csv(keys, symbol=:active_packages) eans = {} result = [] lang = @lookandfeel.language header = keys.collect { |key| @lookandfeel.lookup("th_#{key}") || key.to_s } result.push(header) print "self.class=" p self.class print '@model.class=' p @model.class print '@model.length=' p @model.length exit @model.each { |atc| result.push(['#MGrp', atc.code.to_s, atc.description(lang).to_s]) atc.send(symbol).each { |pack| eans[pack.ikskey] = eans[pack.ikskey].to_i + 1 line = keys.collect { |key| if(self.respond_to?(key)) self.send(key, pack) else pack.send(key) end } result.push(line) } } @duplicates = eans.collect { |ikskey, count| ikskey if count > 1 }.compact.sort result.collect { |line| CSV.generate_line(line, ';') }.join("\n") end
Run
Run export_oddb_csv
masa@masa ~/ywesee/oddb.org $ bin/admin ch.oddb> Updater.new(self).export_oddb_csv
Result
self.class=ODDB::View::Drugs::CsvResult @model.class=Array @model.length=7367
Experiment
def bsv_dossier(pack) if(sl = pack.sl_entry) begin dossier = sl.bsv_dossier rescue => e raise e.message + " package ean code=" + pack.barcode.to_s end if dossier @bsv_dossiers.store dossier, true @counts['bsv_dossiers'] = @bsv_dossiers.size end dossier end end
Restart
Result
admin@ywesee.com To 自分 詳細を表示 14:21 (18分前) anthroposophy 294 bsv_dossiers 3315 complementary 282 deductible_g 8624 deductible_o 48 duplicates 0 expiration_date 21788 export_registrations 650 galenic_forms 321 generics 4609 has_generic 0 homeopathy 810 inactive_date 4249 limitation_both 142 limitation_points 142 limitation_texts 1315 limitations 1315 lppv 601 missing_size 27 originals 2105 out_of_trade 3390 phytotherapy 1339 price_exfactory 9846 price_public 12386 registration_date 23421 routes_of_administration 0 sl_entries 8672
Note
Commit