view · edit · sidebar · attach · print · history

Index>

20140115-swissmedic-xlsx-format-4

Summary

  • Use new swissmedic-xslx format for oddb2xml
  • Add link to search via atc/iksnr for interaction

Commits

Index

---

Add link to search via atc/iksnr for interaction]]

Goal: can specify interaction between inderal and aspirin via URL and atc or iksrn

Mepha example is http://matrix.epha.ch/#/56751,61537,39053,59256

  1. Nolvadex: atc_cod L02BA01: Tamoxifen IKSNR 39053
  2. Losartan: 09CA01: Losartan IKSNR: 58392

The ATC-link http://oddb-ci2.dyndns.org/de/gcc/interaction_search/atc/C09CA01,L02BA01 works now. Pushed commit Made interaction_search by atc possible

Will adapt it to IKSNR next week.

Use new swissmedic-xslx format for oddb2xml

Got the following error when running import_daily

swissmedic-diff returns a lot of new entries which have all the IKSNR 0.

swissmedic-diff.diff target /var/www/oddb.org/data/xls/Packungen-2014.01.14.xlsx latest /var/www/oddb.org/data/xls/Packungen-latest.xls
new Spreadsheet.open for "/var/www/oddb.org/data/xls/Packungen-2014.01.14.xlsx"
using rubyXL for "/var/www/oddb.org/data/xls/Packungen-2014.01.14.xlsx"
2014-01-14 23:20:33 +0100: /var/www/oddb.org/src/plugin/swissmedic.rb: 66 Found 19003 news, 18 updates, 0 replacements and 17652 package_deletions
2014-01-14 23:20:33 +0100: /var/www/oddb.org/src/plugin/swissmedic.rb: 67 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

Openening the file locally to debug the problem (with locally patched swissmedic-diff). Did not work well.

Now my question is. Can I monkey patch rubyXL to get a similar behaviour?

Updated the swissmedic-test with a subset of the packungen.xls and paying more attention that there should be not too many news-items. Found the problem that in lib/swissmedic-diff.rb I must change the method cell to

    def cell(row, pos)
      if(cell = row[pos])
        defined?(cell.value) ? cell.value.to_s : cell.to_s
      end
    end

Next problem is that expiration/registration_date always differ. Debugging with pry. Changed one line to use the monkey-patch method Spreadsheet.date_sheet. Now the import_daily continues a lot further. Import_daily did not complete. Got the following error msg

Plugin: ODDB::SwissmedicPlugin
Error: TypeError
Message: can't dup NilClass
Backtrace:
(eval):2:in `dup'
(eval):2:in `dup'
/var/www/oddb.org/src/model/package.rb:169:in `checkout'
/var/www/oddb.org/src/model/package.rb:475:in `checkout'
/var/www/oddb.org/src/util/persistence.rb:240:in `issue_delete'
/var/www/oddb.org/src/util/oddbapp.rb:120:in `block in delete'
/var/www/oddb.org/src/util/failsafe.rb:10:in `call'
/var/www/oddb.org/src/util/failsafe.rb:10:in `failsafe'
/var/www/oddb.org/src/util/oddbapp.rb:116:in `delete'
/var/www/oddb.org/src/command/delete.rb:11:in `execute'
/var/www/oddb.org/src/util/oddbapp.rb:694:in `execute_command'
/var/www/oddb.org/src/util/oddbapp.rb:1507:in `delete'
/var/www/oddb.org/src/plugin/swissmedic.rb:165:in `block in delete'
/var/www/oddb.org/src/plugin/swissmedic.rb:161:in `each'
/var/www/oddb.org/src/plugin/swissmedic.rb:161:in `delete'
/var/www/oddb.org/src/plugin/swissmedic.rb:74:in `update'
/var/www/oddb.org/src/util/updater.rb:394:in `block in update_swissmedic'
/var/www/oddb.org/src/util/updater.rb:496:in `call'
/var/www/oddb.org/src/util/updater.rb:496:in `wrap_update'
/var/www/oddb.org/src/util/updater.rb:392: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>'

But bin/admin still has this registration.

ch.oddb> registration('19246').name_base
-> Laxamalt
ch.oddb> registration('16858').fachinfo.class
-> NilClass
ch.oddb> registration('16858').name_base
-> Kamillofluid

Adding more debug-info, sending hup to all services and restarting import_daily. Import reports again 2014-01-15 10:54:26 +0100: /var/www/oddb.org/src/plugin/swissmedic.rb: 66 Found 106 news, 899 updates, 5 replacements and 165 package_deletions. import_daily completed successfully the swissmedic import and reported

ODDB::SwissmedicPlugin - Report 15.01.2014
Created Packages: 106
Updated Packages: 899
Deleted Packages: 165 (5 Replaced)
Deactivated Sequences: 84
Deactivated Registrations: 51
Updated new Export-Registrations: 0
Updated existing Export-Registrations: 0
Updated new Export-Sequences: 0
Updated existing Export-Sequences: 0
Skipped Packages: 0
Total time to update: 52.10 [m]
Total Sequences without ATC-Class: 28
Anzahl Sequenzen mit leerem Feld Zusammensetzung: 0
http://ch.oddb.apache.org/de/gcc/show/reg/00000/seq/00
<..>
http://ch.oddb.apache.org/de/gcc/show/reg/72736/seq/00

Committed my changes to swissmedic-diff. These are Added debugger to Gemfile, Must use rubyzip 0.9.9 to support all ruby versions and Support comparing xls and xslx files

The travis-CI completed successfully. Pushed commit for oddb.org Adapt swissmedic-import for xlsx files. Remove some unused methods

Import_daily still has errors because the links for co_marketing and patents.Fixed comarketing URL with commit Updated comarketing UR

view · edit · sidebar · attach · print · history
Page last modified on January 15, 2014, at 10:45 PM