view · edit · sidebar · attach · print · history

20131015-swissmedic-update-2

<< | Index | >>


Summary

  • Swissmedic update must complete

Commits

Index

---

Swissmedic update must complete

Things don't look good:

  • import_daily still working on my VM after 20 hours (read 14790 of 19108 lines)
  • index_therapeuticus, export oddb.csv, export oddb2.csv (on VM) have all the following error
Error: SBSM::InvalidDataError
Message: e_invalid_ean_code
Backtrace:
/var/www/oddb.org/src/model/ean13.rb:12:in `initialize'
/var/www/oddb.org/src/model/ean13.rb:26:in `new'
/var/www/oddb.org/src/model/ean13.rb:26:in `new_unchecked'
/var/www/oddb.org/src/model/package.rb:163:in `barcode'

Full stack for index_therapeuticus.csv is

Error: SBSM::InvalidDataError
Message: e_invalid_ean_code
Backtrace:
(druby://localhost:10005) /var/www/oddb.org/src/model/ean13.rb:12:in `initialize'
(druby://localhost:10005) /var/www/oddb.org/src/model/ean13.rb:26:in `new'
(druby://localhost:10005) /var/www/oddb.org/src/model/ean13.rb:26:in `new_unchecked'
(druby://localhost:10005) /var/www/oddb.org/src/model/package.rb:163:in `barcode'
(druby://localhost:10005) /var/www/oddb.org/ext/export/src/csv_exporter.rb:71:in `block in collect_data'
(druby://localhost:10005) /var/www/oddb.org/ext/export/src/csv_exporter.rb:67:in `collect'
(druby://localhost:10005) /var/www/oddb.org/ext/export/src/csv_exporter.rb:67:in `collect_data'
(druby://localhost:10005) /var/www/oddb.org/ext/export/src/csv_exporter.rb:99:in `block in dump'
(druby://localhost:10005) /usr/lib64/ruby/1.9.1/csv.rb:1367:in `open'
(druby://localhost:10005) /var/www/oddb.org/ext/export/src/csv_exporter.rb:98:in `dump'
(druby://localhost:10005) /var/www/oddb.org/ext/export/src/odba_exporter.rb:137:in `block (2 levels) in export_ean13_idx_th_csv'
(druby://localhost:10005) /var/www/oddb.org/ext/export/src/odba_exporter.rb:135:in `each'
(druby://localhost:10005) /var/www/oddb.org/ext/export/src/odba_exporter.rb:135:in `block in export_ean13_idx_th_csv'
(druby://localhost:10005) /var/www/oddb.org/ext/export/src/odba_exporter.rb:286:in `call'
(druby://localhost:10005) /var/www/oddb.org/ext/export/src/odba_exporter.rb:286:in `block in safe_export'
(druby://localhost:10005) /usr/lib64/ruby/1.9.1/tempfile.rb:320:in `open'
(druby://localhost:10005) /var/www/oddb.org/ext/export/src/odba_exporter.rb:285:in `safe_export'
(druby://localhost:10005) /var/www/oddb.org/ext/export/src/odba_exporter.rb:131:in `export_ean13_idx_th_csv'
(druby://localhost:10005) /usr/lib64/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block'
(druby://localhost:10005) /usr/lib64/ruby/1.9.1/drb/drb.rb:1508:in `perform'
(druby://localhost:10005) /usr/lib64/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop'
(druby://localhost:10005) /usr/lib64/ruby/1.9.1/drb/drb.rb:1582:in `loop'
(druby://localhost:10005) /usr/lib64/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop'
/var/www/oddb.org/src/plugin/csv_export.rb:163:in `export_index_therapeuticus'
/var/www/oddb.org/src/util/exporter.rb:169:in `block in export_index_therapeuticus_csv'
/var/www/oddb.org/src/util/exporter.rb:425:in `call'
/var/www/oddb.org/src/util/exporter.rb:425:in `safe_export'
/var/www/oddb.org/src/util/exporter.rb:167:in `export_index_therapeuticus_csv'
/var/www/oddb.org/src/util/exporter.rb:74:in `run'
/var/www/oddb.org/jobs/export_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/export_daily:12:in `<module:Util>'
/var/www/oddb.org/jobs/export_daily:11:in `<module:ODDB>'
/var/www/oddb.org/jobs/export_daily:10:in `<main>

Added some debug output to package and started manually jobs/mail_index_therapeuticus_csv.

The file test/test_plugin/swissmedic.rb contains tests for Packungen. It uses the data from test/data/xls/Packungen.xls When replacing the old file with the new one, we get a lot of errors. But this are errors, because the original Packungen.xls contained only 14 records carefully crafted to test the differences with other packungen.xls.

Therefore we will need a different way to solve our problem. Differences are:

  • Rows are all +1
  • Zulassungnumber is now an Integer not a String
  • Verpackungs ID is now an Integer not a String

Make tests pass. Use .by_default when possible

I often reorganised unit tests where flexmock methods were overridden in some tests as I had not grasped that https://github.com/jimweirich/flexmock had allows to specify a default behaviour (using .by_default) which can be overridden later.

Sometime reading the whole documentation gives more insights than just reading the first chapter or two!

view · edit · sidebar · attach · print · history
Page last modified on October 16, 2013, at 08:21 AM