view · edit · sidebar · attach · print · history




  • Fix missing substances (eg. shire or Subcuvia)
  • Fix reparsing patinfo
  • Keep in Mind



Fix reparsing patinfo

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>
/var/www/ `diff'
/var/www/ `each'
/var/www/ `to_a'
/var/www/ `text'
/var/www/ `to_s'
/var/www/ `block in add_change_log_item'
/var/www/ `each'
/var/www/ `find'
/var/www/ `add_change_log_item'
/var/www/ `store_patinfo_change_diff'
/var/www/ `store_patinfo_for_one_packages'
/var/www/ `block (2 levels) in update_patinfo_lang'
/var/www/ `each'
/var/www/ `block in update_patinfo_lang'
/var/www/ `each'
/var/www/ `update_patinfo_lang'
/var/www/ `parse_textinfo'
/var/www/ `block in import_swissmedicinfo'
/var/www/ `each'
/var/www/ `import_swissmedicinfo'
/var/www/ `block in update_notify_simple'
/var/www/ `wrap_update'
/var/www/ `update_notify_simple'
/var/www/ `update_textinfo_swissmedicinfo'
jobs/update_textinfo_swissmedicinfo:39:in `block in <module:Util>'
/var/www/ `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 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]
NoMethodError: undefined method `de' for #<ODDB::PatinfoDocument:0x00556d56c5ccb8>
from /var/www/ `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 )

Fix missing substances (eg. shire or Subcuvia)

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)/
/var/www/ `block (3 levels) in parse_compositions'
/var/www/ `each'
/var/www/ `find'
/var/www/ `block (2 levels) in parse_compositions'
/var/www/ `each'
/var/www/ `block in parse_compositions'
/var/www/ `select'
/var/www/ `parse_compositions'
/var/www/ `update_all_sequence_info'
/var/www/ `block in update'
/var/www/ `block in each'
/var/www/ `each'
/var/www/ `each'
/var/www/ `update'
/var/www/ `block in update_swissmedic'
/var/www/ `wrap_update'
/var/www/ `update_swissmedic'
jobs/import_swissmedic_only:30:in `block in <module:Util>'
/var/www/ `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

Excipiens 	Aqua ad Iniectabilia, q.S. ad Solutionem pro 1 Ml

Wirkstoffe	Stärke
Cum Immunoglobulinum Humanum Normale	95 %

Hilfsstoffe	Stärke
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 ( 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

view · edit · sidebar · attach · print · history
Page last modified on October 24, 2017, at 05:12 PM