could not connect to www.swissreg.ch: #<Net::HTTPInternalServerError:0x007f8a7d69bb58>
---
Continuing work of http://dev.ywesee.com/Niklaus/20140224-add-medical-products-2#add-medical-products
Status: Import works, Package is found via trademark and via iksnr. But import does not correctly handle descriptions. This impedes displaying the FI. Sequence is displayed correctly (http://oddb-ci2.dyndns.org/de/gcc/drug/reg/1229107/seq/0) but cannot display a package.
Displaying http://oddb-ci2.dyndns.org/de/gcc/fachinfo/reg/1229107 returns
NoMethodError undefined method `de' for #<ODDB::State::Drugs::Fachinfo::FachinfoWrapper:0x007fb8ae727ea0>
Search for "Sinvoial" displays
In bin/oddb I see that localized_name for fachinfo is not present. Verifying with bin/admin
registration('1229107').localized_name('de') -> Sinovial® HighVisc 1,6% registration('1229107').fachinfo.localized_name('de') -> undefined method `localized_name' for #<ODDB::FachinfoDocument2001:0x007fb8b22a1bc0> registration('61630').fachinfo.localized_name('de') -> Fluconazol Pfizer® registration('61630').fachinfo.de -> #<ODDB::FachinfoDocument2001:0x007fb86d0a1c48> registration('1229107').fachinfo -> #<ODDB::FachinfoDocument2001:0x007fb8b22a1bc0> registration('1229107').fachinfo.de -> undefined method `de' for #<ODDB::FachinfoDocument2001:0x007fb8b22a1bc0>
This works for usual registrations lik 61630. Must investigate why our newly medical product registration 1229107 does not respond to the method 'de' even when it is of the same type as the registration 61630. Probably we don't handle the language correctly when importing.
Found one reason, passed the fachinfo directly but must pass it as {lang => parsed_info}. Dropped the database and after a re-import things look good.
Running the import for french jobs/import_medical_products fr
resulted in the following error-mail
Had the following errors File /var/www/oddb.org/data/medical_products/fr/Sinovial_FR.docx does not contain a chapter Packages with an ean13 inside
Analysing a french document is not so easy, as the ydocx-gem has all the chapter name as HTML-entities, whereas our document is UTF-8 formatted. After monkey patching the chapter names I am able to parse the following chapters
Composition Indications/Possibilités d’emploi Posologie/Mode d’emploi Contre-indications Mises en garde et précautions Interactions Effets indésirables Remarques particulières Fabricant Distributeur Mise à jour de l’information
Missing the "Présentation" which contains the ean13 and composition values, e.g. 7612291078458, seringue prête 2 ml
. Banging my head against the wall, why this chapter is not recognised.
Scanning the ean13s and composition works now. Must add them to the database.
Pushed changes to ydocx, to parse the *docx without monkey-patching. See [https://github.com/ngiger/ydocx/commit/6e2f1a4f8b9fdefab257de75994ccbd2a688543e|Adapted UTF-8. Documented problem parsing french]]
After running into a memory error when debugging with pry I had to restart and suddenly bin/oddbd had error like
error in SBSM::Session#process: / NoMethodError undefined method `[]' for #<DRb::DRbUnknown:0x007fb2a7d62408> /usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/session.rb:208:in `import_cookies' /usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/session.rb:360:in `process' /var/www/oddb.org/src/util/session.rb:125:in `process' /usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/session.rb:172:in `block in drb_process' <internal:prelude>:10:in `synchronize' e
Changed line 128 in /usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/session.rb from
if (cuki = request.cookies[self::class::PERSISTENT_COOKIE_NAME])
to
if RUBY_VERSION < "1.9" && (cuki = request.cookies[self::class::PERSISTENT_COOKIE_NAME])