<< | Index | >>
ch.oddb> Updater.new(self).update_swissreg_news ->
Plugin: ODDB::SwissregPlugin Error: NoMethodError Message: undefined method `values' for nil:NilClass Backtrace: /var/www/oddb.org/src/model/registration.rb:151:in `each_sequence' /var/www/oddb.org/src/plugin/swissreg.rb:60:in `block in update_news' /var/www/oddb.org/src/plugin/swissreg.rb:58:in `each_key' /var/www/oddb.org/src/plugin/swissreg.rb:58:in `update_news' /var/www/oddb.org/src/util/updater.rb:427:in `update_immediate' /var/www/oddb.org/src/util/updater.rb:341:in `update_swissreg_news' /var/www/oddb.org/src/util/updater.rb:329:in `update_swissmedic_followers' jobs/import_swissmedic:15:in `block in <module:Util>' /var/www/oddb.org/src/util/job.rb:18:in `call' /var/www/oddb.org/src/util/job.rb:18:in `run' jobs/import_swissmedic:12:in `<module:Util>' jobs/import_swissmedic:11:in `<module:ODDB>' jobs/import_swissmedic:10:in `<main>'
Registration#sequence must be Hash.
But in Database, Some Registration have as nil
.
EAN-Code (Package#barcode) Pharmacode (Package#pharmacode) Product-Name (Package#name_base) Teilbar (Sequence#division['divisable']) Auflösbar oder suspendierbar (Sequence#division['dissolvable']) Zermörsebar (Sequence#division['crunshable']) Öffnen von Kapseln (Sequence#division['openable']) Bemerkungen / Alternativen (Sequence#division['notes']) Quellen (Sequence#division['source'])
ch.oddb> registration('55297').sequence('05').division.divisable -> Ja
I created read methods to attributes only for csv exporting.
(Package model does not have access directly)
+ def self.define_division_attributes keys + keys.each do |attribute| + define_method(attribute) { |pack| + if seq = pack.sequence and + div = seq.division and + !div.empty? + value = div.send(attribute) + if value + @counts[attribute.to_s] += 1 + end + value + end + } + end + define_division_attributes [ + :divisable, :dissolvable, :crushable, :openable, :notes, + :source +
* Job/export_teilbarkeit (jobs/export_teilbarkeit) * export_teilbarkeit_csv (src/util/exporter.rb) * export_teilbarkeit (src/plugin/csv_export.rb) * _export_drugs (src/plugin/csv_export.rb) * View::Drugs::CsvResult (src/view/drugs/csv_result.rb) * compress (ext/extport/src/odba_exporter.rb)
updated csv format and report.
total: 709 crushable: 706 dissolvable: 709 divisable: 709 has_notes: 552 can be opened: 705 have a source: 183