view · edit · sidebar · attach · print · history

Index>

20140520-fix-swissreg

Summary

  • Fix error getting swissreg patents

Commits

Index

Keep in Mind

---

Must ensure that only medicaments for humans are in oddb2xml output

Marco Descher reported that we have some veterinary products, e.g. QG04BX90, when producing oddb_product.xml

   <DSCRD>CANIPHEDRIN Tabl 50 mg ad us vet.</DSCRD>
     <ARTCOMP>
       <COMPNO>7601001004214</COMPNO>
    </ARTCOMP>
    <ARTBAR>
      <CDTYP>E13</CDTYP>
      <BC>7680470660428</BC>

This must be fixed. Came in via prices ZurRose.

Made a unit test fail. Added checks for veterinary Now all unit tests pass again. Running rake test before pushing changes.

Problem is not correctly solved. Here the results of my tests with version 1.8.1 and upcoming 1.8.4

niklaus@ng-tr /o/s/o/ausgabe> grep -c CANIPHE 1.8.4/*/*.xml | grep -v ":0"
1.8.4/oddb2xml__e/oddb_article.xml:8
niklaus@ng-tr /o/s/o/ausgabe> grep -c CANIPHE 1.8.1/*/*.xml | grep -v ":0"
1.8.1/oddb2xml__a_nonpharma/oddb_article.xml:8
1.8.1/oddb2xml__e/oddb_article.xml:16
1.8.1/oddb2xml__f_xml/oddb_article.xml:8
1.8.1/oddb2xml__t_md/md_article.xml:8

We don't have the CANIPHEDRIN in oddb_article.xml except when we call oddb2xml -e. But inside the unit tests I had tested exactly with the option -e. Will fix this problem tomorrow.

Also forgot to not emit these products when producing *.dat files, as manifested via

niklaus@ng-tr /o/s/o/ausgabe> grep CANIPHE 1.8.4/*/*.dat 
1.8.4/oddb2xml__e/zurrose_transfer.dat:1122871437CANIPHEDRIN Tabl 20 mg ad us vet. 100 Stk         001266001550400C000000076804706601832
1.8.4/oddb2xml__e/zurrose_transfer.dat:1122871443CANIPHEDRIN Tabl 20 mg ad us vet. 500 Stk         004872006910400C000000000000000000002
1.8.4/oddb2xml__e/zurrose_transfer.dat:1122871466CANIPHEDRIN Tabl 50 mg ad us vet. 100 Stk         001424001750400C000000076804706604282
1.8.4/oddb2xml__e/zurrose_transfer.dat:1122871472CANIPHEDRIN Tabl 50 mg ad us vet. 500 Stk         005443007580400C000000000000000000002
1.8.4/oddb2xml__f_dat/oddb.dat:1112871466CANIPHEDRIN Tabl 50 mg ad us vet. 100 Stk         0000000000003000000000076804706604282
1.8.4/oddb2xml__f_dat/oddb.dat:1112871437CANIPHEDRIN Tabl 20 mg ad us vet. 100 Stk         0000000000003000000000076804706601832
1.8.4/oddb2xml__f_dat__a_nonpharma/oddb_with_migel.dat:1112871466CANIPHEDRIN Tabl 50 mg ad us vet. 100 Stk         0000000000003000000000076804706604282
1.8.4/oddb2xml__f_dat__a_nonpharma/oddb_with_migel.dat:1112871437CANIPHEDRIN Tabl 20 mg ad us vet. 100 Stk         0000000000003000000000076804706601832
niklaus@ng-tr /o/s/o/ausgabe> grep CANIPHE 1.8.1/*/*.dat 
1.8.1/oddb2xml__f_dat/oddb.dat:1112871466CANIPHEDRIN Tabl 50 mg ad us vet. 100 Stk         0000000000003000000000076804706604282
1.8.1/oddb2xml__f_dat/oddb.dat:1112871437CANIPHEDRIN Tabl 20 mg ad us vet. 100 Stk         0000000000003000000000076804706601832
1.8.1/oddb2xml__f_dat__a_nonpharma/oddb_with_migel.dat:1112871466CANIPHEDRIN Tabl 50 mg ad us vet. 100 Stk         0000000000003000000000076804706604282
1.8.1/oddb2xml__f_dat__a_nonpharma/oddb_with_migel.dat:1112871437CANIPHEDRIN Tabl 20 mg ad us vet. 100 Stk         0000000000003000000000076804706601832
n

Fix error getting swissreg patents

Continue work from yesterday. Switch using Mechanize and profit from last years work with brand2csv.

I must note that the following unit tests do not work at all:

  • ext/export/src/oddbdat.rb
  • ext/swissreg/test/test_writer.rb

Corrected ext/swissreg/test/test_session.rb as the patent which we tested expired in 2013.

Don't know how to make ext/swissreg/test/test_writer.rb pass.

Committed locally my changes and trying to run jobs/import_swissmedic again. Have problem with drb. Must change code a little bit.

The API must have changed even more. As I get errors.

Plugin: ODDB::SwissregPlugin
Error: TypeError
Message: can't convert Symbol into Integer
Backtrace:
/var/www/oddb.org/src/plugin/swissreg.rb:68:in `[]'
/var/www/oddb.org/src/plugin/swissreg.rb:68:in `block in update_registrations'
/var/www/oddb.org/src/plugin/swissreg.rb:63:in `each'
/var/www/oddb.org/src/plugin/swissreg.rb:63:in `update_registrations'
/var/www/oddb.org/src/plugin/swissreg.rb:53:in `block in update_news'
/var/www/oddb.org/src/plugin/swissreg.rb:50:in `each_key'
/var/www/oddb.org/src/plugin/swissreg.rb:50:in `update_news'
/var/www/oddb.org/src/util/updater.rb:511:in `update_immediate'
/var/www/oddb.org/src/util/updater.rb:424:in `update_swissreg_news'
jobs/import_swissreg_news:14: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_swissreg_news:12:in `<module:Util>'
jobs/import_swissreg_news:11:in `<module:ODDB>'
jobs/import_swissreg_news:10:in `<main>'

Must take another look at the changes made by Yasu. But at least I get the correct results form swissreg.

view · edit · sidebar · attach · print · history
Page last modified on May 20, 2014, at 07:12 PM