view · edit · sidebar · attach · print · history

Index>

20140217-Praeparateliste-latest-missing

Summary

  • Swissmedic-Update does not work correctly. Does not generate Präparateliste-latest.xlsx
  • Move "Wann ist ein Medikament ein Generikum?" to generica.cc.
  • Links for AmiKo on iPhone

Commits

Index

Keep in Mind
  • Search nach Anwendung (indications), z.B. Konjunktivitis, does not report all occurrences in the section "Anwendung" of Fachinfo. Probably index is corrupted or not set up correctly.
  • Error: Patents with could not connect to www.swissreg.ch: #<Net::HTTPInternalServerError:0x007f8a7d69bb58>
  • vagrant-oddb.org: cleanup installation for yus with ruby 1.8, logrotate.conf and local vhosts for tests

---

Fix error in patents when running jobs/import_swissmedic

Got daily the following mail

Plugin: ODDB::SwissregPlugin
Error: RuntimeError
Message: could not connect to www.swissreg.ch: #<Net::HTTPInternalServerError:0x000000011f0cb0>
Backtrace:
(druby://localhost:10007) /var/www/oddb.org/src/util/http.rb:98:in `post'
(druby://localhost:10007) /var/www/oddb.org/ext/swissreg/src/session.rb:203:in `post'
(druby://localhost:10007) /var/www/oddb.org/ext/swissreg/src/session.rb:196:in `get_result_list'
(druby://localhost:10007) /var/www/oddb.org/ext/swissreg/src/swissreg.rb:12:in `search'
(druby://localhost:10007) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block'
(druby://localhost:10007) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1508:in `perform'
(druby://localhost:10007) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop'
(druby://localhost:10007) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in `loop'
(druby://localhost:10007) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop'
/var/www/oddb.org/src/plugin/swissreg.rb:58:in `update_registrations'
/var/www/oddb.org/src/plugin/swissreg.rb:52:in `block in update_news'
/var/www/oddb.org/src/plugin/swissreg.rb:49:in `each_key'
/var/www/oddb.org/src/plugin/swissreg.rb:49:in `update_news'
/var/www/oddb.org/src/util/updater.rb:505:in `update_immediate'
/var/www/oddb.org/src/util/updater.rb:418:in `update_swissreg_news'
/var/www/oddb.org/src/util/updater.rb:406:in `update_swissmedic_followers'
jobs/import_swissmedic:15: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'
jobs/import_swissmedic:12:in `<module:Util>'
jobs/import_swissmedic:11:in `<module:ODDB>'
jobs/import_swissmedic:10:in `<main>'

Added some debug output and running jobs/import_swissmedic on oddb-ci2. It goes further but has the following error

Plugin: ODDB::SwissregPlugin
Error: NameError
Message: undefined local variable or method `patents' for #<ODDB::SwissregPlugin:0x007fc8eb3db740>
Backtrace:
/var/www/oddb.org/src/plugin/swissreg.rb:61:in `update_registrations'
/var/www/oddb.org/src/plugin/swissreg.rb:55:in `block in update_news'
/var/www/oddb.org/src/plugin/swissreg.rb:52:in `each_key'
/var/www/oddb.org/src/plugin/swissreg.rb:52:in `update_news'
/var/www/oddb.org/src/util/updater.rb:505:in `update_immediate'
/var/www/oddb.org/src/util/updater.rb:418:in `update_swissreg_news'
/var/www/oddb.org/src/util/updater.rb:406:in `update_swissmedic_followers'
jobs/import_swissmedic:15: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'
jobs/import_swissmedic:12:in `<module:Util>'
jobs/import_swissmedic:11:in `<module:ODDB>'
jobs/import_swissmedic:10:in `<main>'

Will investigate tomorrow.

Fix error in import_swissmedic with lppv

Got the following error

Plugin: ODDB::LppvPlugin
Error: EOFError
Message: end of file reached
Backtrace:
/usr/local/lib/ruby/1.9.1/openssl/buffering.rb:174:in `sysread_nonblock'
/usr/local/lib/ruby/1.9.1/openssl/buffering.rb:174:in `read_nonblock'
/usr/local/lib/ruby/1.9.1/net/protocol.rb:141:in `rbuf_fill'
/usr/local/lib/ruby/1.9.1/net/protocol.rb:122:in `readuntil'
/usr/local/lib/ruby/1.9.1/net/protocol.rb:132:in `readline'
/usr/local/lib/ruby/1.9.1/net/smtp.rb:929:in `recv_response'
/usr/local/lib/ruby/1.9.1/net/smtp.rb:915:in `block in getok'
/usr/local/lib/ruby/1.9.1/net/smtp.rb:939:in `critical'
/usr/local/lib/ruby/1.9.1/net/smtp.rb:913:in `getok'
/usr/local/lib/ruby/1.9.1/net/smtp.rb:907:in `quit'
/usr/local/lib/ruby/1.9.1/net/smtp.rb:613:in `do_finish'
/usr/local/lib/ruby/1.9.1/net/smtp.rb:522:in `ensure in start'
/usr/local/lib/ruby/1.9.1/net/smtp.rb:522:in `start'
/usr/local/lib/ruby/1.9.1/net/smtp.rb:457:in `start'
/var/www/oddb.org/src/util/log.rb:119:in `send_mail'
/var/www/oddb.org/src/util/log.rb:84:in `notify'
/var/www/oddb.org/src/util/updater.rb:508:in `update_immediate'
/var/www/oddb.org/src/util/updater.rb:343:in `update_lppv'
/var/www/oddb.org/src/util/updater.rb:407:in `update_swissmedic_followers'
jobs/import_swissmedic:15: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'
jobs/import_swissmedic:12:in `<module:Util>'
jobs/import_swissmedic:11:in `<module:ODDB>'
jobs/import_swissmedic:10:in `<main>'

Added some debug output to lppv.rb. Seems to run okay on oddb-ci2. Got the following mail

ch.ODDB.org Report - Lppv prices - 02/2014

Updated Packages (lppv flag true): 0
Packages with SL-Entry: 3
Not updated were: J, U

Is there a gem that needs updating on thinpower? On oddb-ci2 mail 2.2.7 (and tmail 1.2.7.1) is installed, whereas we have mail 2.3.0 (and tmail 1.2.0) on thinpower.

Replacing gem mail version 2.3.0 by 2.2.7 and running jobs/update_lppv on thin_power. Job completed without error. Nice!

Adding enough stuff to run firefox to test local generika.cc

Installing some package on my oddb-ci2.

sudo emerge x11-misc/slim awesome firefox --autounmask-write
cat /etc/portage/package.use/X 
=x11-libs/gdk-pixbuf-2.28.2 X
=x11-libs/cairo-1.12.16 xcb X
=x11-libs/pango-1.34.1 X introspection
>=media-libs/libpng-1.6.8 apng
sudo emerge x11-misc/slim awesome firefox-bin x11-base/xorg-server xorg-x11
USE="-minimal" emerge -1 xinit

See also http://www.funtoo.org/X_Window_System

Links for AmiKo on iPhone

Must insert for ch.oddb.org and generika.cc LF the following links (above "AmiKo: Fachinfo App für Android"):

Pushed commit Add link for AmiKo on iPhone/iPad

Move "Wann ist ein Medikament ein Generikum?" to generica.cc

Had to add host name and correct resolution for generika.oddb-ci2.ngiger.dyndns.org in dnsmasq, apache2/vhosts.d/oddb.org. Had to adapt a rewrite rule too. I think we should have a closer look at the apache configuration.

First attempt did not work correctly. generic_definition comes in via centered_search_form and is inconditionally there. In LookandfeelPhytoPharma, LookandfeelPhytoPharma and LookandfeelAnthroposophy the wording is replaced. Does Zeno want displayed when these LNF are enabled? Adding generic_definition only if is in the eanbled section. Adding generic_definition to LookandfeelGenerika.

Found a way to distinguish between generika an default. Tried adding phyto-pharma, too.

Pushed commit Move 'Wann ist' -> generika.cc.

Swissmedic-Update does not work correctly. Does not generate Präparateliste-latest.xlsx

The Swissmedic update does not work correctly. To correct the following stuff was made

cp Präparateliste-2014.01.23.xlsx Präparateliste-latest.xlsx

The swissmedic update must to the following stuff

  • After each successfull Download (because there is an Update) the Präparateliste.xlsx and Packungen.xls must be saved and copied as *-latest.xls.

This worked fine, but was broken with my changes when moving vom *.xls to *.xlsx files.

Grepping for swissmedic.r in the log log/oddb/debug/2014/02.log I find

2014-02-16 09:19:26 +0100: /var/www/oddb.org/src/plugin/swissmedic.rb: 262 updated download.size is 2688134. /var/www/oddb.org/data/xls/Packungen-2014.02.16.xlsx now 2688134 bytes != /var/www/oddb.org/data/xls/Packungen-latest.xlsx 2676058
2014-02-16 09:19:26 +0100: /var/www/oddb.org/src/plugin/swissmedic.rb: 53 update target "/var/www/oddb.org/data/xls/Packungen-2014.02.16.xlsx"2688134 bytes. Latest /var/www/oddb.org/data/xls/Packungen-latest.xlsx 2676058 bytes
2014-02-16 09:19:27 +0100: /var/www/oddb.org/src/plugin/swissmedic.rb: 262 updated download.size is 2212361. /var/www/oddb.org/data/xls/Präparateliste-2014.02.16.xlsx now 2212361 bytes != /var/www/oddb.org/data/xls/Präparateliste-latest.xlsx 2214581

Looking at line 262 of swissmedic.rb on sees clearly that there it only saves the content into Packungen-2014.02.16.xlsx but does not produce a Packungen-latest.xlsx file. Comparing with an old version of swissmedic.rb of last october I see that I removed a FileUtils.cp target, latest_name in initialize_export_registrations. Corrected this error with commit Corrected generating Präparateliste-latest.xlsx

Now looking at why the Packungen-latest.xlsx does not get created. I see in the log that the lenght of Packungen-latest.xlsx and Packungen-2014.02.16.xlsx differ. Therefore I would expect that I see also a log entry from line 84 of swissmedic.rb. But it seems, that we skip updating even when the variable target tested in line 58 is not null in line 56. This can only happen if the whole update is aborted via an exit or Ruby exceptiion. Probably after fixining the next task this error will go away.

Fix File::Storage::FormatError. Message: OLE2 signature is invalid

Got the following error message

Plugin: ODDB::SwissmedicPlugin
Error: Ole::Storage::FormatError
Message: OLE2 signature is invalid
Backtrace:
/usr/local/lib/ruby/gems/1.9.1/gems/ruby-ole-1.2.11.7/lib/ole/storage/base.rb:378:in `validate!'
/usr/local/lib/ruby/gems/1.9.1/gems/ruby-ole-1.2.11.7/lib/ole/storage/base.rb:370:in `initialize'
/usr/local/lib/ruby/gems/1.9.1/gems/ruby-ole-1.2.11.7/lib/ole/storage/base.rb:112:in `new'
/usr/local/lib/ruby/gems/1.9.1/gems/ruby-ole-1.2.11.7/lib/ole/storage/base.rb:112:in `load'
/usr/local/lib/ruby/gems/1.9.1/gems/ruby-ole-1.2.11.7/lib/ole/storage/base.rb:79:in `initialize'
/usr/local/lib/ruby/gems/1.9.1/gems/ruby-ole-1.2.11.7/lib/ole/storage/base.rb:85:in `new'
/usr/local/lib/ruby/gems/1.9.1/gems/ruby-ole-1.2.11.7/lib/ole/storage/base.rb:85:in `open'
/usr/local/lib/ruby/gems/1.9.1/gems/spreadsheet-0.9.6/lib/spreadsheet/excel/reader.rb:1276:in `setup'
/usr/local/lib/ruby/gems/1.9.1/gems/spreadsheet-0.9.6/lib/spreadsheet/excel/reader.rb:134:in `read'
/usr/local/lib/ruby/gems/1.9.1/gems/spreadsheet-0.9.6/lib/spreadsheet/excel/workbook.rb:32:in `open'
/usr/local/lib/ruby/gems/1.9.1/gems/spreadsheet-0.9.6/lib/spreadsheet.rb:63:in `open'
/usr/local/lib/ruby/gems/1.9.1/gems/spreadsheet-0.9.6/lib/spreadsheet.rb:66:in `block in open'
/usr/local/lib/ruby/gems/1.9.1/gems/spreadsheet-0.9.6/lib/spreadsheet.rb:65:in `open'
/usr/local/lib/ruby/gems/1.9.1/gems/spreadsheet-0.9.6/lib/spreadsheet.rb:65:in `open'
/var/www/oddb.org/src/plugin/swissmedic.rb:280:in `initialize_export_registrations'
/var/www/oddb.org/src/plugin/swissmedic.rb:58:in `update'
/var/www/oddb.org/src/util/updater.rb:393:in `block in update_swissmedic'
/var/www/oddb.org/src/util/updater.rb:495:in `call'
/var/www/oddb.org/src/util/updater.rb:495:in `wrap_update'
/var/www/oddb.org/src/util/updater.rb:391:in `update_swissmedic'
/var/www/oddb.org/src/util/updater.rb:196:in `run'
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'
jobs/import_daily:12:in `<module:Util>'
jobs/import_daily:11:in `<module:ODDB>'
jobs/import_daily:10:in `<main>'

This error stems from the fact, that as the file Präparateliste-latest.xlsx was not updated. Therefore trying to parse the old "Präparateliste-latest.xls file as XSLX file failed. I believe that with my commit Corrected generating Präparateliste-latest.xlsx this problem is solved, too. Waiting for my local run of jobs/import_swissmedic to finish. My local job seems to work fine.

On thinpower we still get the same error, as we had swissmedic-diff 0.1.6 installed. Installing swissmedic-diff 0.1.7 and running the job again.

Pushed . Applied it on thinpower by calling git pull https://github.com/ngiger/oddb.org.git. Now it seems to work better.

view · edit · sidebar · attach · print · history
Page last modified on February 19, 2014, at 01:01 PM