view · edit · sidebar · attach · print · history

< Niklaus.20160405-changes-for-HIN | Index | Niklaus.20160329-fix-nil-problem-in-import-daily >>

20160404-import-bsv-problem

Summary

  • import_bsv: Fix problem in SL-Update (XML)
  • oddb2cml: NBR_RECORD does not match nb PRD in oddb_product.xml
  • evidentia: adapt legend text
  • fix problem with packungen.xls, eg. Ebixa 55828, sequence 03, package 888 is not correct

Commits

Index

Keep in Mind for work to do
  • Fix dojo error http://www.sitepen.com/blog/2012/10/31/debugging-dojo-common-error-messages/#forgot-dom-ready
  • I removed on May-27 tests for ix_registrationss, fix_sequences, fix_compositions, fix_packages from test/test_plugin/swissmedic.rb,as he could not find any references for them in the src code. Did I erroneously remove stuff when cleaning up the swissmedic import earlier?
  • The whole test for older/newer Packages must be adapted to xlsx. One must compare the rows (e.g. by creating csv files) and do the same stuff in xlsx!
  • creat gem: task: input=file with ean-codes, standard output show ean-codes + atc-code. Source is Swissmedic Packungen.xlsx or XML.
  • Import via data/medreg_companies.yaml
  • Fix problem with radioactivatum 99m-technetio when parsing Wirkstoffe
  • Fix galenic_forms when parsing swissmedic.xlsx
  • Cleanup generic_type. Replace it everywhere by sl_generic_type and adapt code accordingly.
  • Get updated ATC-codes from EPha for oddb.org, too.
  • Use refdatabase for oddb.org, too.
  • Check whether we should revert the part which touche src/plugin/text_info.rb of commit 17af82ba4d76a5838683411b260de265531f9e74. We should improve test/stub/oddbapp.rb to work similar for update/pointer as the real oddbapp. In this case we would have a good Stub for plugins. May we need a different stub when working with plugins (which create/modify/destroy ODDB-Objects), when in most other cases a very simple stub is sufficient.
  • When a logged in admin user changes an atc_code of a product, the corresponding atc_class must update its sequences, too.
  • Order of entering search type and value should not matter. Both should show long URL with search
  • Remove parser for minifi (but keep the minifi)
  • BSV-Plugin does not send mail. Is it sending two mails at once?
  • remove obsolete pdf_patinfo in model, admin/views

import_bsv: Fix problem in SL-Update (XML)

Got the following error mail

Plugin: ODDB::BsvXmlPlugin
Error: NoMethodError
Message: undefined method `+' for nil:NilClass
@report: {:name_base=>"Myozyme", :name_descr=>"Trockensub 50 mg ", :swissmedic_no5_bag=>"58038", :deductible=>:deductible_g, :generic_type=>:unknown, :swissmedic_no5_oddb=>"58038", :swissmedic_no8_bag=>"58038001"}
Backtrace:
/var/www/oddb.org/src/plugin/bsv_xml.rb:347:in `block in tag_end'
/var/www/oddb.org/src/plugin/bsv_xml.rb:344:in `each'
/var/www/oddb.org/src/plugin/bsv_xml.rb:344:in `tag_end'
/usr/local/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:26:in `parse'
/usr/local/lib/ruby/1.9.1/rexml/document.rb:205:in `parse_stream'
/var/www/oddb.org/src/plugin/bsv_xml.rb:915:in `update_preparations'
/var/www/oddb.org/src/plugin/bsv_xml.rb:601:in `block (2 levels) in _update'
/usr/local/lib/ruby/gems/1.9.1/gems/rubyzip-1.1.6/lib/zip/entry.rb:500:in `get_input_stream'
/var/www/oddb.org/src/plugin/bsv_xml.rb:601:in `block in _update'
/usr/local/lib/ruby/gems/1.9.1/gems/rubyzip-1.1.6/lib/zip/entry_set.rb:42:in `call'
/usr/local/lib/ruby/gems/1.9.1/gems/rubyzip-1.1.6/lib/zip/entry_set.rb:42:in `block in each'
/usr/local/lib/ruby/gems/1.9.1/gems/rubyzip-1.1.6/lib/zip/entry_set.rb:41:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/rubyzip-1.1.6/lib/zip/entry_set.rb:41:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/rubyzip-1.1.6/lib/zip/central_directory.rb:182:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/rubyzip-1.1.6/lib/zip/file.rb:139:in `block in foreach'
/usr/local/lib/ruby/gems/1.9.1/gems/rubyzip-1.1.6/lib/zip/file.rb:99:in `open'
/usr/local/lib/ruby/gems/1.9.1/gems/rubyzip-1.1.6/lib/zip/file.rb:138:in `foreach'
/var/www/oddb.org/src/plugin/bsv_xml.rb:596:in `_update'
/var/www/oddb.org/src/plugin/bsv_xml.rb:591:in `update'
/var/www/oddb.org/src/util/updater.rb:284:in `block in update_bsv'
/var/www/oddb.org/src/util/updater.rb:536:in `call'
/var/www/oddb.org/src/util/updater.rb:536:in `wrap_update'
/var/www/oddb.org/src/util/updater.rb:282:in `update_bsv'
/var/www/oddb.org/src/util/updater.rb:205: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>'

Found the problem. Easy to fix. But I think I must wait a long time to see, whether my change is okay, as it took almost 2 hours and a half till the problem got reported as shown in the log with the lines

2016-04-01 07:37:45 CEST bsv_xml: save_file   = /var/www/oddb.org/data/xml/XMLPublications-2016.04.01.zip
2016-04-01 07:37:45 CEST bsv_xml: latest_file = /var/www/oddb.org/data/xml/XMLPublications-latest.zip
<..>
2016-04-01 07:40:25 CEST bsv_xml: entry.name = Preparations.xml
2016-04-01 10:00:13 CESTlog notify Error: SL-Update (XML): start outgoing process ["log"]. Must attach 0 files and 0 parts.
2016-04-01 10:00:13 CESTUtil.send_mail list_and_recipients ["log"]
2016-04-01 10:00:13 CEST Util.log_and_deliver_mail to=["ngiger@ywesee.com", "zdavatz@ywesee.com"] subject ch.ODDB.org Report - Error: SL-Update (XML) - 04/2016 size 2284 with 0 attachments. Plugin: ODDB::BsvX

On oddb-ci2 got another error after a few minutes

Message: undefined method `active?' for #<Array:0x00000012270580>
Backtrace:
/usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing'
/var/www/oddb.org/src/model/package.rb:442:in `public?'
/usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing'
/var/www/oddb.org/src/plugin/bsv_xml.rb:152:in `block in initialize'
/var/www/oddb.org/src/model/sequence.rb:183:in `each'
/var/www/oddb.org/src/model/sequence.rb:183:in `each_package'
/usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing'
/var/www/oddb.org/src/model/registration.rb:155:in `block in each_package'
/var/www/oddb.org/src/model/registration.rb:154:in `each_value'
/var/www/oddb.org/src/model/registration.rb:154:in `each_package'
/usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing'
/var/www/oddb.org/src/util/oddbapp.rb:713:in `block in each_package'
/usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `each_value'
/usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing'
/var/www/oddb.org/src/util/oddbapp.rb:712:in `each_package'
/var/www/oddb.org/src/plugin/bsv_xml.rb:151:in `initialize'
/var/www/oddb.org/src/plugin/bsv_xml.rb:914:in `new'
/var/www/oddb.org/src/plugin/bsv_xml.rb:914:in `update_preparations'
/var/www/oddb.org/src/plugin/bsv_xml.rb:602:in `block (2 levels) in _update'
/var/www/.gem/ruby/1.9.1/gems/rubyzip-1.1.7/lib/zip/entry.rb:502:in `get_input_stream'
/var/www/oddb.org/src/plugin/bsv_xml.rb:602:in `block in _update'
/var/www/.gem/ruby/1.9.1/gems/rubyzip-1.1.7/lib/zip/entry_set.rb:42:in `call'
/var/www/.gem/ruby/1.9.1/gems/rubyzip-1.1.7/lib/zip/entry_set.rb:42:in `block in each'
/var/www/.gem/ruby/1.9.1/gems/rubyzip-1.1.7/lib/zip/entry_set.rb:41:in `each'
/var/www/.gem/ruby/1.9.1/gems/rubyzip-1.1.7/lib/zip/entry_set.rb:41:in `each'
/var/www/.gem/ruby/1.9.1/gems/rubyzip-1.1.7/lib/zip/central_directory.rb:182:in `each'
/var/www/.gem/ruby/1.9.1/gems/rubyzip-1.1.7/lib/zip/file.rb:146:in `block in foreach'
/var/www/.gem/ruby/1.9.1/gems/rubyzip-1.1.7/lib/zip/file.rb:99:in `open'
/var/www/.gem/ruby/1.9.1/gems/rubyzip-1.1.7/lib/zip/file.rb:145:in `foreach'
/var/www/oddb.org/src/plugin/bsv_xml.rb:597:in `_update'
/var/www/oddb.org/src/plugin/bsv_xml.rb:592:in `update'
/var/www/oddb.org/src/util/updater.rb:284:in `block in update_bsv'
/var/www/oddb.org/src/util/updater.rb:536:in `call'
/var/www/oddb.org/src/util/updater.rb:536:in `wrap_update'
/var/www/oddb.org/src/util/updater.rb:282:in `update_bsv'

Looking at it, too.

Fixed with commit Avoid nil in update_bsv

Pulled patches to thinpower. Moved XMLPublications from march to XMLPublications-latest. Started jobs/import_bsv in screen import_daily.

Fixed some errors in unit-test. See commit Fix unit test errors

oddb2cml: NBR_RECORD does not match nb PRD in oddb_product.xml

First adding version of oddb2xml which generated the XML files in the attribute GENERATED_BY.

Adding a spec test to catch the failure. Done. Must correct *.xsd files and change various spec tests to handle the change nbr_records.

Fixed with commits:

evidentia: adapt legend text

Must change the text in for the legend of evidentia from "Rot = Original" -> "Blau = Original" to match the color of their CSS.

Fixed with Fix explain color for evidentia

After running the last import this package is not correct, as shown by these bin/admin lines

ch.oddb> registration('55828').sequence('03').packages
-> {"888"=>#<ODBA::Stub:56180680#29541067 @odba_class=ODDB::Package @odba_container=56046800#29552080>}
ch.oddb> registration('55828').sequence('03').package('888')
-> #<ODDB::Package:0x00000006b343f8>
ch.oddb> registration('55828').sequence('03').package('888').sequence
-> 
ch.oddb> registration('55828').sequence('03').package('888').sequence.class
-> NilClass
ch.oddb> registration('55828').sequence('03').package('888').registration.class
-> NilClass

Checking whether my fix works. But I must wait a long time till I run into the my pry debug statement. Fix did not work as expected. Found and tested a work-around with pry. Reimporting DB to test.

Pushed commit Fix checking packages

view · edit · sidebar · attach · print · history
Page last modified on April 05, 2016, at 12:52 AM