Reparsing textinfo for a patinfo fails. Eg. given for mutagrip and subcuvia I called sudo -u apache /usr/local/bin/bundle-240 exec ruby-240 jobs/update_textinfo_swissmedicinfo --target=both 47909 58749 --reparse
. Where we have
Error: NoMethodError Message: undefined method `gsub' for #<ODDB::PatinfoDocument:0x007f44300efb48> Backtrace: /var/www/oddb.org/vendor/ruby/2.4.0/gems/ydiffy-0.0.2/lib/diffy/diff.rb:64:in `diff' /var/www/oddb.org/vendor/ruby/2.4.0/gems/ydiffy-0.0.2/lib/diffy/diff.rb:88:in `each' /var/www/oddb.org/vendor/ruby/2.4.0/gems/ydiffy-0.0.2/lib/diffy/format.rb:23:in `to_a' /var/www/oddb.org/vendor/ruby/2.4.0/gems/ydiffy-0.0.2/lib/diffy/format.rb:23:in `text' /var/www/oddb.org/vendor/ruby/2.4.0/gems/ydiffy-0.0.2/lib/diffy/diff.rb:136:in `to_s' /var/www/oddb.org/src/model/patinfo.rb:86:in `block in add_change_log_item' /var/www/oddb.org/src/model/patinfo.rb:86:in `each' /var/www/oddb.org/src/model/patinfo.rb:86:in `find' /var/www/oddb.org/src/model/patinfo.rb:86:in `add_change_log_item' /var/www/oddb.org/src/plugin/text_info.rb:283:in `store_patinfo_change_diff' /var/www/oddb.org/src/plugin/text_info.rb:295:in `store_patinfo_for_one_packages' /var/www/oddb.org/src/plugin/text_info.rb:384:in `block (2 levels) in update_patinfo_lang' /var/www/oddb.org/src/plugin/text_info.rb:376:in `each' /var/www/oddb.org/src/plugin/text_info.rb:376:in `block in update_patinfo_lang' /var/www/oddb.org/src/plugin/text_info.rb:373:in `each' /var/www/oddb.org/src/plugin/text_info.rb:373:in `update_patinfo_lang' /var/www/oddb.org/src/plugin/text_info.rb:1298:in `parse_textinfo' /var/www/oddb.org/src/plugin/text_info.rb:1492:in `block in import_swissmedicinfo' /var/www/oddb.org/src/plugin/text_info.rb:1491:in `each' /var/www/oddb.org/src/plugin/text_info.rb:1491:in `import_swissmedicinfo' /var/www/oddb.org/src/util/updater.rb:586:in `block in update_notify_simple' /var/www/oddb.org/src/util/updater.rb:542:in `wrap_update' /var/www/oddb.org/src/util/updater.rb:580:in `update_notify_simple' /var/www/oddb.org/src/util/updater.rb:350:in `update_textinfo_swissmedicinfo' jobs/update_textinfo_swissmedicinfo:39:in `block in <module:Util>' /var/www/oddb.org/src/util/job.rb:40:in `run' jobs/update_textinfo_swissmedicinfo:12:in `<module:Util>' jobs/update_textinfo_swissmedicinfo:11:in `<module:ODDB>' jobs/update_textinfo_swissmedicinfo:10:in `<main>'
This error happens only because the patinfo-name and the package name do not correspond and we override it via the barcode/GTIN.
Remarked while debugging, that trying to access the patinfo.de changes the patinfo.class from Patinfo to PatinfoDcoument, as seen by this snippet
[1] pry(#<ODDB::TextInfoPlugin>)> reg.packages[0].class => ODDB::Package [2] pry(#<ODDB::TextInfoPlugin>)> reg.packages[0].patinfo.class => ODDB::Patinfo [3] pry(#<ODDB::TextInfoPlugin>)> reg.packages[0].patinfo.de NoMethodError: undefined method `de' for #<ODDB::PatinfoDocument:0x00556d56c5ccb8> from /var/www/oddb.org/vendor/ruby/2.4.0/gems/odba-1.1.2/lib/odba/stub.rb:112:in `method_missing' [4] pry(#<ODDB::TextInfoPlugin>)> reg.packages[0].patinfo.class => ODDB::PatinfoDocument
I think my commit of August 22 "Save patinfo changes" should not have included Persistance for the PatinfoDocument, but only for the PatinfoDocument::ChangeLogItemclass. This did not help.
Checking whether the method patinfo= of the sequence class is called somewhere. No it didn't. Class is still changing.
Running a reparse for a bad and a good PI ( jobs/update_textinfo_swissmedicinfo --target=pi 47909 13358 --reparse )
Running sudo -u apache /usr/local/bin/bundle-240 exec ruby-240 jobs/import_swissmedic_only update_compositions 38133 47909
Reparsing failed with the following error
Plugin: ODDB::SwissmedicPlugin Error: RegexpError Message: end pattern with unmatched parenthesis: /globulina equina (immunisé avec coeur($|\s)/ Backtrace: /var/www/oddb.org/src/plugin/parslet_compositions.rb:78:in `block (3 levels) in parse_compositions' /var/www/oddb.org/src/plugin/parslet_compositions.rb:78:in `each' /var/www/oddb.org/src/plugin/parslet_compositions.rb:78:in `find' /var/www/oddb.org/src/plugin/parslet_compositions.rb:78:in `block (2 levels) in parse_compositions' /var/www/oddb.org/src/plugin/parslet_compositions.rb:75:in `each' /var/www/oddb.org/src/plugin/parslet_compositions.rb:75:in `block in parse_compositions' /var/www/oddb.org/src/plugin/parslet_compositions.rb:71:in `select' /var/www/oddb.org/src/plugin/parslet_compositions.rb:71:in `parse_compositions' /var/www/oddb.org/src/plugin/swissmedic.rb:1260:in `update_all_sequence_info' /var/www/oddb.org/src/plugin/swissmedic.rb:304:in `block in update' /var/www/oddb.org/vendor/ruby/2.4.0/gems/rubyXL-3.3.1/lib/rubyXL/worksheet.rb:23:in `block in each' /var/www/oddb.org/vendor/ruby/2.4.0/gems/rubyXL-3.3.1/lib/rubyXL/worksheet.rb:23:in `each' /var/www/oddb.org/vendor/ruby/2.4.0/gems/rubyXL-3.3.1/lib/rubyXL/worksheet.rb:23:in `each' /var/www/oddb.org/src/plugin/swissmedic.rb:286:in `update' /var/www/oddb.org/src/util/updater.rb:437:in `block in update_swissmedic' /var/www/oddb.org/src/util/updater.rb:542:in `wrap_update' /var/www/oddb.org/src/util/updater.rb:435:in `update_swissmedic' jobs/import_swissmedic_only:30:in `block in <module:Util>' /var/www/oddb.org/src/util/job.rb:40:in `run' jobs/import_swissmedic_only:12:in `<module:Util>' jobs/import_swissmedic_only:11:in `<module:ODDB>' jobs/import_swissmedic_only:10:in `<main>'
Fixed an error in mustcheck, where all iksnr where checked, not only those requested. Now we have the following compsitions in https://oddb-ci2.dyndns.org/de/gcc/show/reg/58749/seq/01
Excipiens Aqua ad Iniectabilia, q.S. ad Solutionem pro 1 Ml Wirkstoffe Stärke Cum Immunoglobulinum Humanum Normale 95 % Hilfsstoffe Stärke Glycin Natrium Chlorid Protein 160 mg
But we still have problems with "Fosrenol 1000 mg", but we did not yet reparse. Calling import_swissmedic_only for 58073, too.
We must correct (or not display the daily cost of 0.0) for https://oddb-ci2.dyndns.org/de/gcc/ddd_price/reg/62556/seq/02/pack/002/search_query/shire/search_type/st_company ( Buccolam 5mg/1mL).
Pushed commits
Running ruby-240 jobs/import_swissmedic_only update_compositions 62556 47909 58749 58073
on thinpower.
Somehow this did not work correctly. Restart ch.oddbd and launching sudo -u apache /usr/local/bin/bundle-240 exec ruby-240 jobs/import_swissmedic_only update_compositions 62556 47909 58749 58073 2>&1 | tee /home/ywesee/fix_shire.log
(in screen fix_expired_packages).
Found the culprit. On oddb-ci2 I used the packages of today, which is not present on thinpower, where it has the date when it changed the last time. Pushed commit Use Packungen-(latest|<today>) for update_compositions. Now the job works nicely on thinpower.
Fixed two unit-test error with commit Fix view/migel/product unittest
Fixed another unit-test with commit Fix running plugin tests