view · edit · sidebar · attach · print · history

Index>

20160202-fi-parser-use-refdata-names

Summary

  • Adapt FI-parser to use refdata names for packages
  • Fix missing check_item in refdata

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)

Adapt FI-parser to use refdata names for packages

We must adapt the FI-Parser to get the concerned sequences via the names from refdata. Eg. Tramal (IKSNR 43788) has different patinfos for "Tramal® Tropfen, Lösung zum Einnehmen" and "Tramal® Tropfen, Lösung zum Einnehmen mit Dosierpumpe)" in its packages 078 (50 ml) and 086 (30 ml). In Packungen.xlsx we find both times "Tramal, Tropfen".

Added some preliminary code and debugging info. Running sudo -u apache jobs/update_textinfo_swissmedicinfo --no-download --reparse --target=pi 43788

Collecting the information about all GTINs (packages) references by a IKSNR via refdata works. Will continue tomorrow.

  • Must adapt the methods update_patinfo and update_fachinfo in src/plugin/textinfo to verify the names
  • Must fix TextInfoPlugin::replace_textinfo not to update all packages of a given sequence
  • Must rethink method pdf_patinfo of sequence
  • Must match names for :de and :fr!

Adding a test case with all FI/PI for Tramal IKSNR 43788.

Fix missing check_item in refdata

Got the following error import-bsv

Plugin: ODDB::RefdataPlugin
Error: NoMethodError
Message: undefined method `check_item' for
#<ODDB::Refdata::RefdataArticle:0x00000002fbcc80>
Backtrace:
(druby://localhost:50001) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1548:in
`perform_without_block'
(druby://localhost:50001) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1508:in `perform'
(druby://localhost:50001) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1586:in
`block (2 levels) in main_loop'
(druby://localhost:50001) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in `loop'
(druby://localhost:50001) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in
`block in main_loop'
(druby://thinpower:56106)
/var/www/oddb.org/src/plugin/refdata.rb:99:in `block (2 levels) in
update_package_trade_status'
(druby://thinpower:56106) /var/www/oddb.org/src/model/sequence.rb:183:in `each'
(druby://thinpower:56106)
/var/www/oddb.org/src/model/sequence.rb:183:in `each_package'
(druby://thinpower:56106)
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in
`method_missing'
(druby://thinpower:56106)
/var/www/oddb.org/src/model/registration.rb:155:in `block in
each_package'
(druby://thinpower:56106)
/var/www/oddb.org/src/model/registration.rb:154:in `each_value'
(druby://thinpower:56106)
/var/www/oddb.org/src/model/registration.rb:154:in `each_package'
(druby://thinpower:56106)
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in
`method_missing'
(druby://thinpower:56106) /var/www/oddb.org/src/util/oddbapp.rb:711:in
`block in each_package'
(druby://thinpower:56106) /var/www/oddb.org/src/util/oddbapp.rb:710:in
`each_value'
(druby://thinpower:56106) /var/www/oddb.org/src/util/oddbapp.rb:710:in
`each_package'
(druby://thinpower:56106)
/var/www/oddb.org/src/plugin/refdata.rb:86:in `block in
update_package_trade_status'
(druby://thinpower:56106) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1548:in `call'
(druby://thinpower:56106) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1548:in
`perform_without_block'
(druby://thinpower:56106) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1508:in `perform'
(druby://thinpower:56106) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1586:in
`block (2 levels) in main_loop'
(druby://thinpower:56106) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in `loop'
(druby://thinpower:56106) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in
`block in main_loop'
(druby://localhost:50001)
/usr/local/lib/ruby/1.9.1/drb/invokemethod.rb:10:in `block_yield'
(druby://localhost:50001)
/usr/local/lib/ruby/1.9.1/drb/invokemethod.rb:17:in `block in
perform_with_block'
(druby://localhost:50001)
/var/www/oddb.org/ext/refdata/src/refdata.rb:23:in `session'
(druby://localhost:50001)
/usr/local/lib/ruby/1.9.1/drb/invokemethod.rb:14:in
`perform_with_block'
(druby://localhost:50001) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1506:in `perform'
(druby://localhost:50001) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1586:in
`block (2 levels) in main_loop'
(druby://localhost:50001) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in `loop'
(druby://localhost:50001) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in
`block in main_loop'
/var/www/oddb.org/src/plugin/refdata.rb:85:in `update_package_trade_status'
/var/www/oddb.org/src/util/updater.rb:573:in `block in update_notify_simple'
/var/www/oddb.org/src/util/updater.rb:549:in `call'
/var/www/oddb.org/src/util/updater.rb:549:in `wrap_update'
/var/www/oddb.org/src/util/updater.rb:567:in `update_notify_simple'
/var/www/oddb.org/src/util/updater.rb:484:in
`update_package_trade_status_by_refdata'
/var/www/oddb.org/src/util/updater.rb:298:in `update_bsv_followers'
jobs/import_bsv:15: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_bsv:12:in `<module:Util>'
jobs/import_bsv:11:in `<module:ODDB>'
jobs/import_bsv:10:in `<main>'

Forgot to adapt src/plugin/refdata.rb, as it was never called by the unit tests. Adapted the unit-test where check_item was mocked. Replaced them with mocks for get_refdata_info. Running import_bsv_followers to see whether everything is okay.

When running jobs/import_bsv I see about 20 lines like

Could not create: :!registration,48299!sequence,02!016!part., reason: :!registration,48299!sequence,02!016!part. -> ODDB::Sequence::package(016) returned nil
Could not create: :!registration,57570!sequence,01!001!part., reason: :!registration,57570!sequence,01!001!part. -> ODDB::Sequence::package(001) returned nil

These errors should be investigated.

Got another error when running import_bsv_followers

Error: NoMethodError
Message: undefined method `cleanup_items' for #<ODDB::Refdata::RefdataArticle:0x0000000166be20>
Backtrace:
(druby://localhost:50001) /usr/lib64/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block'
(druby://localhost:50001) /usr/lib64/ruby/1.9.1/drb/drb.rb:1508:in `perform'
(druby://localhost:50001) /usr/lib64/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop'
(druby://localhost:50001) /usr/lib64/ruby/1.9.1/drb/drb.rb:1582:in `loop'
(druby://localhost:50001) /usr/lib64/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop'
(druby://oddb-ci2.ngiger.dyndns.org:50987) /var/www/oddb.org/src/plugin/refdata.rb:137:in `block in update_package_trade_status'
<..>

Must fix it, too.

Now got another error

Plugin: ODDB::RefdataPlugin
Error: DRb::DRbConnError
Message: too large packet 54337903
Backtrace:
(druby://localhost:50001) /usr/lib64/ruby/1.9.1/drb/drb.rb:573:in `load'
(druby://localhost:50001) /usr/lib64/ruby/1.9.1/drb/drb.rb:633:in `recv_reply'
(druby://localhost:50001) /usr/lib64/ruby/1.9.1/drb/drb.rb:918:in `recv_reply'
(druby://localhost:50001) /usr/lib64/ruby/1.9.1/drb/drb.rb:1197:in `send_message'
(druby://localhost:50001) /usr/lib64/ruby/1.9.1/drb/drb.rb:1088:in `block (2 levels) in method_missing'
(druby://localhost:50001) /usr/lib64/ruby/1.9.1/drb/drb.rb:1172:in `open'
(druby://localhost:50001) /usr/lib64/ruby/1.9.1/drb/drb.rb:1087:in `block in method_missing'
(druby://localhost:50001) /usr/lib64/ruby/1.9.1/drb/drb.rb:1105:in `with_friend'
(druby://localhost:50001) /usr/lib64/ruby/1.9.1/drb/drb.rb:1086:in `method_missing'
(druby://localhost:50001) /usr/lib64/ruby/1.9.1/drb/invokemethod.rb:10:in `block_yield'
(druby://localhost:50001) /usr/lib64/ruby/1.9.1/drb/invokemethod.rb:17:in `block in perform_with_block'
(druby://localhost:50001) /var/www/oddb.org/ext/refdata/src/refdata.rb:23:in `session'
(druby://localhost:50001) /usr/lib64/ruby/1.9.1/drb/invokemethod.rb:14:in `perform_with_block'
(druby://localhost:50001) /usr/lib64/ruby/1.9.1/drb/drb.rb:1506:in `perform'
(druby://localhost:50001) /usr/lib64/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop'
(druby://localhost:50001) /usr/lib64/ruby/1.9.1/drb/drb.rb:1582:in `loop'
(druby://localhost:50001) /usr/lib64/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop'
/var/www/oddb.org/src/plugin/refdata.rb:85:in `update_package_trade_status'
/var/www/oddb.org/src/util/updater.rb:573:in `block in update_notify_simple'
/var/www/oddb.org/src/util/updater.rb:549:in `call'
/var/www/oddb.org/src/util/updater.rb:549:in `wrap_update'
/var/www/oddb.org/src/util/updater.rb:567:in `update_notify_simple'
/var/www/oddb.org/src/util/updater.rb:484:in `update_package_trade_status_by_refdata'
/var/www/oddb.org/src/util/updater.rb:298:in `update_bsv_followers'
jobs/import_bsv_followers: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_bsv_followers:12:in `<module:Util>'
jobs/import_bsv_followers:11:in `<module:ODDB>'
jobs/import_bsv_followers:10:in `<main>'
view · edit · sidebar · attach · print · history
Page last modified on February 03, 2016, at 07:36 AM