view · edit · sidebar · attach · print · history

Index>

20140114-swissmedic-xlsx-format-3

Summary

  • Use new swissmedic-xslx format for oddb2xml

Commits

Index

---

Use new swissmedic-xslx format for oddb2xml

Got the following error when running import_daily

Plugin: ODDB::SwissmedicPlugin
Error: NoMethodError
Message: undefined method `worksheet' for #<RubyXL::Workbook:0x000000a966a658>
Backtrace:
/var/www/oddb.org/vendor/bundle/ruby/1.9.1/bundler/gems/swissmedic-diff-462da47c7cf0/lib/swissmedic-diff.rb:104:in `diff'
/var/www/oddb.org/src/plugin/swissmedic.rb:64: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>'

Tweaking swissmedic-diff to be even more compatible with spreadsheet. Adding the following methods:

  • RubyXL::Worksheet::row
  • RubyXL::Workbook::worksheet
  • RubyXL::Cell::to_i

Must also fix the case when we compare a new .xlsx-file with an old *.xls. My commit only considered *.xlsx file. This must be corrected, or we will have problems with all changes between the last *.xls and the first *.xlsx file.

Had to copy manually the latest Präparate xls using sudo cp data/xls/Präparateliste-2013.11.06.xls data/xls/Präparateliste-latest.xls. Same for for Packungen-2013.11.07.xls. Now the import_daily begins its work.

But there is still something wrong with the comparision, as I get (snippet)

line 19071): , , , , , , , , , , , , , , , , , 
2014-01-14 17:50:11 +0100: Found 19003 news, 0 updates and 0 replacements
2014-01-14 17:50:11 +0100: first news: ["00000", "00", (4,2): Cardio-Pulmo-Rénal Sérocytol, suppositoire, datatype = s, style_index = 0, (4,3): Sérolab, société anonyme, datatype = s, style_index = 2, (4,4): 08.07., datatype = s, style_index = 2, (4,5): J06AA, datatype = s, style_index = 2, (4,6): Blutprodukte, datatype = s, style_index = 2, (4,7): 40294, datatype = , style_index = 18, (4,8): 40294, datatype = , style_index = 18, (4,9): 42119, datatype = , style_index = 18, "000", (4,11): 3, datatype = s, style_index = 2, (4,12): Suppositorien, datatype = s, style_index = 5, (4,13): B, datatype = s, style_index = 0, (4,14): globulina equina (immunisé avec coeur, tissu pulmonaire, reins de porcins), datatype = s, style_index = 0, (4,15): globulina equina (immunisé avec coeur, tissu pulmonaire, reins de porcins) 8 mg, propylenglycolum, conserv.: E 216, E 218, excipiens pro suppositorio., datatype = s, style_index = 0, (4,16): Traitement immunomodulant  selon le Dr Thomas

Possibilités d'emploi voir information professionnelle, datatype = s, style_index = 0, nil, 0]
2014-01-14 17:50:11 +0100: /var/www/oddb.org/src/plugin/swissmedic.rb: 831 2014-01-14 17:50:11 +0100: update_registrations iksnr '00000' seqnr 00 pack 000
d

Why the hell is the IKSNR of the first news == 00000 instead of 00274 in the test case? Added some debug info. Restarting the import.

I think that we should consider monkey-patch the csv.rb when starting Oddb.ch instead of relying on a patched ruby-installation.

view · edit · sidebar · attach · print · history
Page last modified on January 14, 2014, at 06:30 PM