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.
Adding a test case with all FI/PI for Tramal IKSNR 43788.
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>'