view · edit · sidebar · attach · print · history

Index>

20171120-oddb2xml-new-links

Summary

  • oddb2xml fails, because swissmedic has new download links
  • adapt oddb.org to new swissmedic download links
  • Keep in Mind

Commits

Index

oddb2xml fails, because swissmedic has new download linksd

Calling bundle exec bin/oddb2xml --log --append --extended fails with

bundler: failed to load command: bin/oddb2xml (bin/oddb2xml)
Mechanize::ResponseCodeError: 404 => Net::HTTPNotFound for https://www.swissmedic.ch/arzneimittel/00156/00221/00222/00223/00224/00227/00228/index.html?lang=de -- unhandled response
  /home/niklaus/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/mechanize-2.7.5/lib/mechanize/http/agent.rb:323:in `fetch'
  /home/niklaus/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/mechanize-2.7.5/lib/mechanize.rb:464:in `get'
  /home/niklaus/git/oddb2xml/lib/oddb2xml/downloader.rb:295:in `download'
  /home/niklaus/git/oddb2xml/lib/oddb2xml/cli.rb:191:in `download'
  /home/niklaus/git/oddb2xml/lib/oddb2xml/cli.rb:54:in `run'
  bin/oddb2xml:50:in `<top (required)>'

The new links are:

This should be fixed. Adpated the spec tests. Before pushing the commit and releasing the new version waiting for bundle exec bin/oddb2xml --log --append --extended to finishe.

adapt oddb.org to new swissmedic download links

Remarked that we could also download an excel version of the comarketing. Also found in https://www.swissmedic.ch/swissmedic/de/home/services/nicht-inverkehrbringen---vertriebsunterbruch-zugelassener-praepa.html

Refactored src/plugin/comarceting.rb to use open-uri instead of Mechanize. Adding fetch_with_http and save_file in src/plugin/plugin.rb eases mocking the plugin. Same for packungen und präparateliste.

Running jobs/import_swissmedic_only before pushing changes.

Must fix also the error

Plugin: ODDB::RssPlugin

Error: Mechanize::ResponseCodeError
Message: 404 => Net::HTTPNotFound for https://www.swissmedic.ch/marktueberwachung/00135/00166/index.html?lang=de -- unhandled response
Backtrace:
/var/www/oddb.org/vendor/ruby/2.4.0/gems/mechanize-2.7.3/lib/mechanize/http/agent.rb:308:in `fetch'
/var/www/oddb.org/vendor/ruby/2.4.0/gems/mechanize-2.7.3/lib/mechanize.rb:440:in `get'
/var/www/oddb.org/src/plugin/rss.rb:47:in `download'
/var/www/oddb.org/src/plugin/rss.rb:119:in `block in swissmedic_entries_of'
/var/www/oddb.org/src/plugin/rss.rb:115:in `each_key'
/var/www/oddb.org/src/plugin/rss.rb:115:in `swissmedic_entries_of'
/var/www/oddb.org/src/plugin/rss.rb:169:in `update_swissmedic_feed'
/var/www/oddb.org/src/plugin/rss.rb:192:in `update_recall_feed'
/var/www/oddb.org/src/util/updater.rb:566:in `update_immediate_with_error_report'
/var/www/oddb.org/src/util/updater.rb:417:in `update_recall_feed'
/var/www/oddb.org/src/util/updater.rb:413:in `update_swissmedic_feeds'
/var/www/oddb.org/src/util/updater.rb:211:in `run'
jobs/import_daily:13:in `block in <module:Util>'
/var/www/oddb.org/src/util/job.rb:40:in `run'
jobs/import_daily:12:in `<module:Util>'
jobs/import_daily:11:in `<module:ODDB>'
jobs/import_daily:10:in `<main>'

This looks like a bitmor work, we here we really have to parse the pages.

Fixed the URL for drugshortage. Running the update failed, because a package did not have an ATC-code. Error was

Plugin: ODDB::ShortagePlugin

Error: NoMethodError
Message: undefined method `code' for nil:NilClass
Backtrace:
/var/www/oddb.org/src/plugin/shortage.rb:245:in `block in update_nomarketing_packages'
/var/www/oddb.org/src/plugin/shortage.rb:243:in `each'
/var/www/oddb.org/src/plugin/shortage.rb:243:in `update_nomarketing_packages'
/var/www/oddb.org/src/plugin/shortage.rb:232:in `update_nomarketing'
/var/www/oddb.org/src/plugin/shortage.rb:52:in `update'
/var/www/oddb.org/src/util/updater.rb:371:in `block in update_drugshortage'
/var/www/oddb.org/src/util/updater.rb:541:in `wrap_update'
/var/www/oddb.org/src/util/updater.rb:369:in `update_drugshortage'
/var/www/oddb.org/src/util/updater.rb:208:in `run'
jobs/import_daily:13:in `block in <module:Util>'
/var/www/oddb.org/src/util/job.rb:40:in `run'
jobs/import_daily:12:in `<module:Util>'
jobs/import_daily:11:in `<module:ODDB>'
jobs/import_daily:10:in `<main>'

Pushed the following commits

view · edit · sidebar · attach · print · history
Page last modified on November 20, 2017, at 07:01 PM