view · edit · sidebar · attach · print · history

20131002-recognize-URL-in-FI

<< | Index | >>


Summary

  • Transform a HTTP in an imported FI/PI into a real link Create links in FI/PI from swissmedicinfo
  • Avoid error about number of arguments when runntn swissINDEX Pharma after running SL-update

Commits

Index

---

Avoid error about number of arguments when runntn swissINDEX Pharma after running SL-update

Stack-Trace in error message is

Plugin: ODDB::SwissindexPharmaPlugin
Error: ArgumentError
Message: wrong number of arguments (2 for 1)
Backtrace:
/var/www/oddb.org/src/plugin/plugin.rb:40:in `initialize'
/var/www/oddb.org/src/util/updater.rb:508:in `new'
/var/www/oddb.org/src/util/updater.rb:508:in `block in update_notify_simple'
/var/www/oddb.org/src/util/updater.rb:488:in `call'
/var/www/oddb.org/src/util/updater.rb:488:in `wrap_update'
/var/www/oddb.org/src/util/updater.rb:506:in `update_notify_simple'
/var/www/oddb.org/src/util/updater.rb:423:in
`update_package_trade_status_by_swissindex'
/var/www/oddb.org/src/util/updater.rb:260:in `update_bsv_followers'
/var/www/oddb.org/src/util/updater.rb:202:in `run'
/var/www/oddb.org/jobs/import_daily:13:in `block in <module:Util>'
/var/www/oddb.org/src/util/job.rb:40:in `call'
/var/www/oddb.org/src/util/job.rb:40:in `run'
/var/www/oddb.org/jobs/import_daily:12:in `<module:Util>'
/var/www/oddb.org/jobs/import_daily:11:in `<module:ODDB>'
/var/www/oddb.org/jobs/import_daily:10:in `<main>'

In src/util/updater.rb update_package_trade_status_by_swissindex calls update_notify_simple(SwissindexPharmaPlugin, 'Swissindex Pharma', :update_package_trade_status, [logging]). Which in turn will pass @options to plug = klass.new(@app, @options). @options is set in update_company_textinfos2 since a commit by Yasu of February 19 2013. The solution I will try is to set it @options = nil at the beginning of update_package_trade_status_by_swissindex. To avoid similar errors, I reset @options in update_company_textinfos2

I did not see this error on my VM (6GB RAM) because update_textinfo_swissmedicinfo(pi) failed with not enough memory available.

Added some GC.start and debugs for memory usage to see whether I can make the import_daily pass on my VM.

Transform a HTTP in an imported FI/PI into a real link

An example can be found in "Levex" (61816) where we find "Die vom EUCAST (European Committee on Antimicrobial Susceptibility Testing, siehe http://www.eucast.org/) empfohlenen minimalen Hemmstoff-Konzentrationen".

  • Added new class HttpLink in src/model/text.rb and added corresponding unit tests HttpsUrl.
  • Added tests in test/test_view/chapter.rb and made them by modifying src/view/chapter.rb
  • Handled parsing hpricot for links in ext/fiparse/src/textinfo_hpricot.rb. Unit tests in ext/fiparse/test/test_fachinfo_hpricot.rb

Imported Levex and in the yaml file I see that there we have link tag in it. Adapted src/view/chapter.rb to create HREF in theses cases. Reimporting the Levex and I still cannot see view on the generated html (via http://oddb-ci.dyndns.org/de/gcc/fachinfo/swissmedicnr/61816).

After re-thinking again, added just a format :link to the ODDB::Text::Paragraph and removed ODDB::Text::HttpLink. Now the tests are okay and after importing Levex and Rimifon the URL display.

17417 Rimifon does not yet correctly display http://www.who.int/docstore/gtb/publications/ttgnp/PDF/2003.313.pdf. But I don't like to patch this error, as the writer did use one style for for http://www.who.int and a different one for docstore/gtb/publications/ttgnp.

Pushed commit Create links in FI/PI from swissmedicinfo

There is a problem in the paragraph handling that sometimes a leading space is inserted or removed. This should be fixed sometime, but will probably break quite a few test cases.

view · edit · sidebar · attach · print · history
Page last modified on October 02, 2013, at 05:15 PM