view · edit · sidebar · attach · print · history

Index>

20150902-cleanup-composition-view

Summary

  • Correct vertical spaces for Moviprep
  • fix "Error: TypeError" in update_swissmedic
  • changes needed for evidentia

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.

Correct vertical spaces for Moviprep

Generating a unit test for this problem.

fix "Error: TypeError" in update_swissmedic

Got the following error while running import-daily

Plugin: ODDB::SwissmedicPlugin
Error: TypeError
Message: can't dup NilClass
Backtrace:
/var/www/oddb.org/src/plugin/swissmedic.rb:799:in `dup'
/var/www/oddb.org/src/plugin/swissmedic.rb:799:in `block in update_compositions'
/var/www/oddb.org/src/plugin/swissmedic.rb:741:in `each'
/var/www/oddb.org/src/plugin/swissmedic.rb:741:in `each_with_index'
/var/www/oddb.org/src/plugin/swissmedic.rb:741:in `update_compositions'
/var/www/oddb.org/src/plugin/swissmedic.rb:1047:in `update_all_sequence_info'
/var/www/oddb.org/src/plugin/swissmedic.rb:1071:in `block in
update_registrations'
/var/www/oddb.org/src/plugin/swissmedic.rb:1058:in `each'
/var/www/oddb.org/src/plugin/swissmedic.rb:1058:in `update_registrations'
/var/www/oddb.org/src/plugin/swissmedic.rb:170:in `update'
/var/www/oddb.org/src/util/updater.rb:444:in `block in update_swissmedic'
/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:442:in `update_swissmedic'
/var/www/oddb.org/src/util/updater.rb:201:in `run'
jobs/import_daily:13: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_daily:12:in `<module:Util>'
jobs/import_daily:11:in `<module:ODDB>'
jobs/import_daily:10:in `<main>'

This error does not occur while running test/test_plugin/swissmedic.rb. Looking at log/oddb/debug/2015/09.log I find

2015-09-02 07:54:29 +0200: /var/www/oddb.org/src/plugin/swissmedic.rb:613 update_active_agent 46337/02 Pinaverii Bromidum  true dose 50 mg
2015-09-02 07:54:30 +0200: /var/www/oddb.org/src/plugin/swissmedic.rb:1031 46337 02 excipiens ODDB::Substance excipiens.oid 9885145 for Excipiens pro compresso Obducto
2015-09-02 07:54:30 +0200: /var/www/oddb.org/src/plugin/swissmedic.rb:1037 46337 02 update_excipiens_in_composition idx 0: excipiens Excipiens pro Compresso Obducto. from #<ParseSubstance:0x0000010c711c60>
2015-09-02 07:54:30 +0200: /var/www/oddb.org/src/plugin/swissmedic.rb:1065 update iksnr 46351 seqnr 01 true opts {}
2015-09-02 07:54:31 +0200: /var/www/oddb.org/src/plugin/swissmedic.rb:745 update_compositions iksnr 46351 seqnr 01 comp_idx 0 parsed_comp #<ParseComposition:0x00000164e26818>
2015-09-02 07:54:31 +0200: /var/www/oddb.org/src/plugin/swissmedic.rb: 755 46351/01 using oid 9447296 source paracetamolum 80 mg, excipiens pro suppositorio.
2015-09-02 07:54:31 +0200: /var/www/oddb.org/src/plugin/swissmedic.rb:613 update_active_agent 46351/01 Paracetamolum  true dose 80 mg
2015-09-02 07:54:31 CESTlog notify Error: swissmedic: start outgoing process ["log"]. Must attach 0 files and 0 parts.  

Trying to reproduce the problem with sudo -u apache /usr/local/bin/ruby jobs/import_swissmedic_only. Fixed with Avoid nil error in swissmedic

Got a second error on thinpower

Plugin: ODDB::SwissmedicPlugin
Error: NoMethodError
Message: undefined method `replace' for nil:NilClass
Backtrace:
/var/www/oddb.org/src/plugin/swissmedic.rb:806:in `block in update_compositions'
/var/www/oddb.org/src/plugin/swissmedic.rb:741:in `each'
/var/www/oddb.org/src/plugin/swissmedic.rb:741:in `each_with_index'
/var/www/oddb.org/src/plugin/swissmedic.rb:741:in `update_compositions'
/var/www/oddb.org/src/plugin/swissmedic.rb:1047:in `update_all_sequence_info'
/var/www/oddb.org/src/plugin/swissmedic.rb:1071:in `block in update_registrations'
/var/www/oddb.org/src/plugin/swissmedic.rb:1058:in `each'
/var/www/oddb.org/src/plugin/swissmedic.rb:1058:in `update_registrations'
/var/www/oddb.org/src/plugin/swissmedic.rb:170:in `update'
/var/www/oddb.org/src/util/updater.rb:444:in `block in update_swissmedic'
/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:442:in `update_swissmedic'
jobs/import_swissmedic: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_swissmedic:12:in `<module:Util>'
jobs/import_swissmedic:11:in `<module:ODDB>'
jobs/import_swissmedic:10:in `<main>'

Looks as it comes from the same sequence

2015-09-02 12:15:06 +0200: /var/www/oddb.org/src/plugin/swissmedic.rb:745 update_compositions iksnr 46351 seqnr 01 comp_idx 0 parsed_comp #<ParseComposition:0x0000008c7e59a0>
2015-09-02 12:15:06 +0200: /var/www/oddb.org/src/plugin/swissmedic.rb: 755 46351/01 using oid 9447296 source paracetamolum 80 mg, excipiens pro suppositorio.
2015-09-02 12:15:06 +0200: /var/www/oddb.org/src/plugin/swissmedic.rb:613 update_active_agent 46351/01 Paracetamolum  true dose 80 mg
2015-09-02 12:15:07 CESTlog notify Error: swissmedic: start outgoing process ["log"]. Must attach 0 files and 0 parts.
2015-09-02 12:15:07 CESTUtil.send_mail list_and_recipients ["log"]
2015-09-02 12:15:07 CEST /var/www/oddb.org/src/util/mail.rb: Configured email using /var/www/oddb.org/etc/oddb.yml @cfg is now "smtp.gmail.com" 587 "admin@ywesee.com"

This is an inactive registration as shown by bin/admin

ch.oddb> registration('46351').sequence('01').compositions.first.inactive_agents.class
-> NilClass
ch.oddb> registration('46351').sequence('01').active?
-> false

Why is it inactive when it appears in the Packungen.xlsx? bin/admin find a manual_inactive_date

ch.oddb> registration('46351').manual_inactive_date
-> 2008-08-25
# outputtting all manually outdated registrations
$manual = registrations.find_all{|key, reg| reg.manual_inactive_date != nil}
File.open('manual.txt', 'w+') {|f| $manual.each{|x| f.puts "#{x[1].iksnr} #{x[1].name_base} #{x[1].manual_inactive_date.to_s}"} }

See Attach:manually_outdated.txt

Zeno explained me that the meaning of manual_inactive_date marks the drug in question to not be shown anymore on oddb.org (for non-admin users). This was introduced because some companies do not want these drugs to be displayed anymore.

Did run swissmedic, but could not find any line containing update iksnr 46351 seqnr 01 true opts in log/oddb/debug/2015/09.log. Running jobs/update_active_agents fixed registration 46351. Reloading thinpowers database to run import_swissmedic again.

This problem should be fixed with Fix handling inactive_agents in update and swissmedic

changes needed for evidentia

I am looking at the following needs of evidentia. (eg. when looking on oddb-ci2 at Keppra)

  • Some color changes for original and other (this can be done by modifying the CSS)
  • Display "Fach-info" (two lines) as header above the FI
  • Display "Packungs-grösse (two lines) as header above the FI
  • Move the column "Wirkstoffe" just after "Präparat"
  • Prices should be right aligned (Why aren't they aligned to the right despite having the css style "list right"?). But with the default css of oddb, the prices are correctly right aligned. Therefore I suspect a problem in the CSS used by evidentia.
  • Do not display the link "F" for photos
  • Display the links FI and L (limitations) in bold (add font-weight: bold to the corresponding style for fachinfo, maybe we must add a new class)
  • Display upto 3 Wirkstoffe by name (at the moment only 1), when more display "<nr>Wirkstoffe"
  • Do not generate a link for "Wirkstoffe"
  • Remove completely rows (Receipt, PI, Comarketing, et al) shown as empty columns

I suspect, that evidentia should include a few definitions of our css to fix these problems, eg. entries with name like fachinfo, list, td.bold, span.bold.

Will continue with this task next monday

view · edit · sidebar · attach · print · history
Page last modified on September 02, 2015, at 06:22 PM