view · edit · sidebar · attach · print · history

Index>

20160316-oddb2xml-prodno

Summary

  • Swissmedic import does not create correctly missing packages
  • oddb2xml must always have prodno with 7 digits and sequences with 2 digits
  • Port ydim to Ruby 1.9.3

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)
  • BSV-Plugin does not send mail. Is it sending two mails at once?
  • Ebixa: bin/admin returns nil for registration('55829').sequences.values.first.iksnr.
  • PI/FI update not correct.

Swissmedic import does not create correctly missing packages

Pushed commit Fix import-swissmedic missing reg/seq/pack Stil having a problem with Ebixa Tropflösung IKNSR 55829. bin/admin returns nil for registration('55829').sequences.values.first.iksnr.

Remarked that the log file grows way too much e.g log/oddb/debug/2016/03.log is now over 50 GB. Found the culprit. Reloading thin power database of yesterday and running import locally to check, whether it fixes the problem.

Pushed commit Limit size of debug info

Got a segmentation fault whenn running my import_daily

/var/www/oddb.org/src/model/registration_observer.rb:36: [BUG] Segmentation fault
ruby 1.9.3p545 (2014-02-24 revision 45159) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0041 p:0013 s:0166 b:0165 l:000164 d:000164 METHOD /var/www/oddb.org/src/model/registration_observer.rb:36
c:0040 p:0058 s:0162 b:0162 l:000161 d:000161 METHOD /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112
c:0039 p:---- s:0156 b:0156 l:000155 d:000155 FINISH
c:0038 p:0032 s:0154 b:0154 l:000153 d:000153 METHOD /var/www/oddb.org/src/view/rss/fachinfo.rb:38
c:0037 p:0111 s:0137 b:0137 l:000230 d:000136 BLOCK  /var/www/oddb.org/src/view/rss/fachinfo.rb:89
c:0036 p:---- s:0134 b:0134 l:000133 d:000133 FINISH
c:0035 p:---- s:0132 b:0132 l:000131 d:000131 CFUNC  :each
c:0034 p:0232 s:0129 b:0129 l:000230 d:000128 BLOCK  /var/www/oddb.org/src/view/rss/fachinfo.rb:83
c:0033 p:0008 s:0126 b:0126 l:000125 d:000125 METHOD /usr/lib64/ruby/1.9.1/rss/maker/base.rb:438
c:0032 p:0021 s:0123 b:0123 l:000122 d:000122 METHOD /usr/lib64/ruby/1.9.1/rss/maker/base.rb:402
c:0031 p:0021 s:0118 b:0118 l:000117 d:000117 METHOD /usr/lib64/ruby/1.9.1/rss/maker.rb:9
c:0030 p:0021 s:0113 b:0113 l:000230 d:000230 METHOD /var/www/oddb.org/src/view/rss/fachinfo.rb:74
c:0029 p:0029 s:0109 b:0108 l:001d48 d:000107 BLOCK  /var/www/oddb.org/src/plugin/plugin.rb:91
c:0028 p:---- s:0105 b:0105 l:000104 d:000104 FINISH
c:0027 p:---- s:0103 b:0103 l:000102 d:000102 CFUNC  :open
c:0026 p:0207 s:0098 b:0098 l:001d48 d:000097 BLOCK  /var/www/oddb.org/src/plugin/plugin.rb:90
c:0025 p:---- s:0092 b:0092 l:000091 d:000091 FINISH
c:0024 p:---- s:0090 b:0090 l:000089 d:000089 CFUNC  :call
c:0023 p:0057 s:0086 b:0086 l:000077 d:000085 BLOCK  /var/www/oddb.org/src/plugin/plugin.rb:49
c:0022 p:---- s:0083 b:0083 l:000082 d:000082 FINISH
c:0021 p:---- s:0081 b:0081 l:000080 d:000080 CFUNC  :each_key
c:0020 p:0039 s:0078 b:0078 l:000077 d:000077 METHOD /var/www/oddb.org/src/plugin/plugin.rb:46
c:0019 p:0032 s:0073 b:0073 l:001d48 d:001d48 METHOD /var/www/oddb.org/src/plugin/plugin.rb:82
c:0018 p:0033 s:0066 b:0066 l:000065 d:000065 METHOD /var/www/oddb.org/src/plugin/text_info.rb:123
c:0017 p:0531 s:0063 b:0063 l:000fc0 d:000fc0 METHOD /var/www/oddb.org/src/plugin/text_info.rb:1460
c:0016 p:0065 s:0057 b:0057 l:0000c8 d:000056 BLOCK  /var/www/oddb.org/src/util/updater.rb:554
c:0015 p:---- s:0053 b:0053 l:000052 d:000052 FINISH
c:0014 p:---- s:0051 b:0051 l:000050 d:000050 CFUNC  :call
c:0013 p:0014 s:0048 b:0048 l:000047 d:000047 METHOD /var/www/oddb.org/src/util/updater.rb:530
c:0012 p:0023 s:0041 b:0041 l:0000c8 d:0000c8 METHOD /var/www/oddb.org/src/util/updater.rb:548
c:0011 p:0032 s:0034 b:0034 l:000033 d:000033 METHOD /var/www/oddb.org/src/util/updater.rb:333
c:0010 p:0051 s:0030 b:0030 l:000029 d:000029 METHOD /var/www/oddb.org/src/util/updater.rb:199
c:0009 p:0024 s:0026 b:0026 l:000b78 d:000025 BLOCK  jobs/import_daily:13
c:0008 p:---- s:0023 b:0023 l:000022 d:000022 FINISH
c:0007 p:---- s:0021 b:0021 l:000020 d:000020 CFUNC  :call
c:0006 p:0457 s:0017 b:0017 l:000016 d:000016 METHOD /var/www/oddb.org/src/util/job.rb:40
c:0005 p:0017 s:0010 b:0010 l:000b78 d:000b78 CLASS  jobs/import_daily:12
c:0004 p:0011 s:0008 b:0008 l:000007 d:000007 CLASS  jobs/import_daily:11
c:0003 p:0107 s:0006 b:0006 l:000ae8 d:000878 EVAL   jobs/import_daily:10
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:000ae8 d:000ae8 TOP   

-- Ruby level backtrace information ----------------------------------------
jobs/import_daily:10:in `<main>'
jobs/import_daily:11:in `<module:ODDB>'
jobs/import_daily:12:in `<module:Util>'
/var/www/oddb.org/src/util/job.rb:40:in `run'
/var/www/oddb.org/src/util/job.rb:40:in `call'
jobs/import_daily:13:in `block in <module:Util>'
/var/www/oddb.org/src/util/updater.rb:199:in `run'
/var/www/oddb.org/src/util/updater.rb:333:in `update_textinfo_swissmedicinfo'
/var/www/oddb.org/src/util/updater.rb:548:in `update_notify_simple'
/var/www/oddb.org/src/util/updater.rb:530:in `wrap_update'
/var/www/oddb.org/src/util/updater.rb:530:in `call'
/var/www/oddb.org/src/util/updater.rb:554:in `block in update_notify_simple'
/var/www/oddb.org/src/plugin/text_info.rb:1460:in `import_swissmedicinfo'
/var/www/oddb.org/src/plugin/text_info.rb:123:in `postprocess'
/var/www/oddb.org/src/plugin/plugin.rb:82:in `update_rss_feeds'
/var/www/oddb.org/src/plugin/plugin.rb:46:in `l10n_sessions'
/var/www/oddb.org/src/plugin/plugin.rb:46:in `each_key'
/var/www/oddb.org/src/plugin/plugin.rb:49:in `block in l10n_sessions'
/var/www/oddb.org/src/plugin/plugin.rb:49:in `call'
/var/www/oddb.org/src/plugin/plugin.rb:90:in `block in update_rss_feeds'
/var/www/oddb.org/src/plugin/plugin.rb:90:in `open'
/var/www/oddb.org/src/plugin/plugin.rb:91:in `block (2 levels) in update_rss_feeds'
/var/www/oddb.org/src/view/rss/fachinfo.rb:74:in `to_html'
/usr/lib64/ruby/1.9.1/rss/maker.rb:9:in `make'
/usr/lib64/ruby/1.9.1/rss/maker/base.rb:402:in `make'
/usr/lib64/ruby/1.9.1/rss/maker/base.rb:438:in `make'
/var/www/oddb.org/src/view/rss/fachinfo.rb:83:in `block in to_html'
/var/www/oddb.org/src/view/rss/fachinfo.rb:83:in `each'
/var/www/oddb.org/src/view/rss/fachinfo.rb:89:in `block (2 levels) in to_html'
/var/www/oddb.org/src/view/rss/fachinfo.rb:38:in `item_to_html'
/usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing'
/var/www/oddb.org/src/model/registration_observer.rb:36:in `iksnrs'

oddb2xml must always have prodno with 7 digits and sequences with 2 digits

This proved to be easy. Added an entry into oddb2xml.xsd to accept only prodno with 7 digits. Running xmllint --noout --schema oddb2xml.xsd oddb_article.xml failed with many errors. Same when running bundle exec rspec spec/builder_spec.rb:777. Fixed lib/oddb2xml/extractor to emit always the seqno part with 2 digits fixed the problem. Bumped version to 2.3.6 to prepare for a new release. Had to adapt builder_spec.rb to the new requirement.

Open question: Do I have to emit only uniq prodno in oddb_product.xml? NO.

Pushed commit Prodno are now always 7 digits long

Port ydim to Ruby 1.9.3

ydim needs also pdfinvoice. Copied whole directory from thinpower, as it is not yet on github. PdfInvoice references pdf-writer, an old gem (release 1.1.8 from March) which throws error when running the test e.g.

/opt/src/pdfinvoice/lib/pdfinvoice/invoice.rb:10:in `require': /home/niklaus/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/pdf-writer-1.1.8/lib/pdf/writer.rb:712: invalid multibyte char (US-ASCII) (SyntaxError)
/home/niklaus/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/pdf-writer-1.1.8/lib/pdf/writer.rb:712: invalid multibyte char (US-ASCII)
/home/niklaus/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/pdf-writer-1.1.8/lib/pdf/writer.rb:712: syntax error, unexpected $end, expecting keyword_end
    content = "%PDF-#{@version}\n%âãÏÓ\n"
                                    ^
        from /opt/src/pdfinvoice/lib/pdfinvoice/invoice.rb:10:in `<top (required)>'
        from test/test_invoice.rb:8:in `require'
        from test/test_invoice.rb:8:in `<main>'

Looking whether I can replace it by an another gem. Trying prawn as recommended by http://stackoverflow.com/questions/30590785/what-is-the-best-way-to-generate-pdf-html-docx-in-ruby-rails. Manual is found under http://prawnpdf.org/manual.pdf

Fix pmwiki http://www.pro-zurituutsch.ch

Installed analysite to be able to use http://www.pmwiki.org/wiki/PmWiki/SiteAnalyzer.

There was missing ";" in config.php after $EnableDiag=1.

Tried to follow http://www.pmwiki.org/wiki/PmWiki/Troubleshooting to fix warning about depreciated preg_replace. But it did not work. Via pwmiki devel mail group found the solution under http://www.pmwiki.org/wiki/PmWiki/CustomMarkup#php55.

The following snippet in /var/www/pro-zurituutsch.ch/doc/local/config.php show the changes

include_once("local/ordermail.php");
# Old Markup for PHP versions before 5.5
# Markup('textarea', '>{$var}',
#   '/\\(:textarea\\s*(.*?):\\)(.*?)\\(:textareaend:\\)/esi',
#   "FmtTextArea(\$pagename,PSS('$1'),PSS('$2'))");
# Old Markup for PHP versions >= 5.5. See http://www.pmwiki.org/wiki/PmWiki/CustomMarkup#php55
Markup('textarea', '>{$var}',
  '/\\(:textarea\\s*(.*?):\\)(.*?)\\(:textareaend:\\)/si',
  "FmtTextArea(\$pagename,PSS('$m[1]'),PSS('$m[2]'))");

Page displays now quite nicely, but only if error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED); is inserted at line 2 of local/config.php. Editing seems to work also.

view · edit · sidebar · attach · print · history
Page last modified on March 16, 2016, at 03:34 PM