view · edit · sidebar · attach · print · history

< Niklaus.20160229-fi-with-wrong-language | Index | Niklaus.20160222-fix-import-daily >>



  • Fix import-daily to parse correctly new new items



Keep in Mind for work to do
  • Fix dojo error
  • 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, too.
  • Use refdatabase for, 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)

Fix import-daily to parse correctly new new items

Found the following error in my local import_daily

Plugin: ODDB::BsvXmlPlugin
Error: NoMethodError
Message: undefined method `values' for "name":String
@report: {:name_base=>"Bexin", :name_descr=>"Sirup 25 mg/10ml ", :swissmedic_no5_bag=>"39639", :deductible=>:deductible_g, :generic_type=>:unknown, :swissmedic_no5_oddb=>"39639", :swissmedic_no8_bag=>"39639025"}
/var/www/ `block in packages'
/var/www/ `each'
/var/www/ `inject'
/var/www/ `packages'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing'
/var/www/ `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/ `update_preparations'
/var/www/ `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/ `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/ `_update'
/var/www/ `update'
/var/www/ `block in update_bsv'
/var/www/ `call'
/var/www/ `wrap_update'
/var/www/ `update_bsv'
/var/www/ `run'
jobs/import_daily:13:in `block in <module:Util>'
/var/www/ `call'
/var/www/ `run'
jobs/import_daily:12:in `<module:Util>'
jobs/import_daily:11:in `<module:ODDB>'
jobs/import_daily:10:in `<main>'

My problems stemmed from the fact that I naively assumed that the size of the UTF-8 encoded HTML size is equal to the file size.

Having even more code common for analysing FI and PI.

Had the same problem with the UTF-8 size when comparing the xml files in data/details.

Added 56079_pi_de.xml to test/data/xml/Aips_test.xml. Not test/test_plugin/text_info.rb begins to really check what is going on. Updating the statistics does not yet work correctly.

Comparing the content of the XML files seems not to work for some FIs with problematic names. Mail for FI arrives after 20 minutes. PI arrived even faster. Suspecting an error. Removing all files containing Tramal or 43788 in their names under data to force some reparsing.

Needed to improve stubbing to allow creating FI/PIs. Removing the details_dir before each run, allows me to check the statistics.

Now the counters seem to be okay. I am quite satisfied that finally test/test_plugin/text_info.rb does stress plugin/textinfo.rb in a correct way. Must fix some errors in test/test_plugin/text_info_swissmedicinfo.rb

Pushed commit Removed obsolete textinfo_news. Fix import_daily to read newest only

But something is still very slow. Therefore trying to profile the whole import using Added the lines to jobs/import_daily

require 'perftools'

Added gem 'perftools.rb' to the Gemfile. After running bundle install I am able to bundle exec jobs/import_daily. Looking the results is done using sudo -u apache bundle exec pprof.rb --text /tmp/import_daily_profile

view · edit · sidebar · attach · print · history
Page last modified on February 25, 2016, at 08:36 AM