view · edit · sidebar · attach · print · history

< Niklaus.20140304-add-medical-products-6 | 2014 | Niklaus.20140226-add-medical-products-4 >>

20140303-add-medical-products-5

Summary

  • Add medical products
  • fix error
  • Make graphical interface work
  • Error Export: Fachinfo Chapter Export

Commits

Index

Keep in Mind
  • Search nach Anwendung (indications), z.B. Konjunktivitis, does not report all occurrences in the section "Anwendung" of Fachinfo. Probably index is corrupted or not set up correctly.
  • Error: Patents with could not connect to www.swissreg.ch: #<Net::HTTPInternalServerError:0x007f8a7d69bb58>
  • vagrant-oddb.org: cleanup installation for yus with ruby 1.8, logrotate.conf and local vhosts for tests
  • Fix index with patch in oddbapp.rb?
-  def search_by_indication(key)
+  def search_by_indication(key, lang='de')
+    # indication_index_atc_de
+    pattern = key.gsub(/[^A-z0-9]/, '.')
+    return ODBA.cache.retrieve_from_index("indication_index_atc_#{lang}", pattern)
     pattern = key.gsub(/[^A-z0-9]/, '.')
     atcs = []
     indications.map do |indication|

---

Error Export: Fachinfo Chapter Export

On thinpower I get the following error when running sudo -u apache jobs/export_fachinfo_chapter intravenös usage

Error: NoMethodError
Message: undefined method `filename' for
#<Mail::UnstructuredField:0x0000001aa6f990>
Backtrace:
/usr/local/lib/ruby/gems/1.9.1/gems/mail-2.2.7/lib/mail/field.rb:122:in
`method_missing'
/usr/local/lib/ruby/gems/1.9.1/gems/mail-2.2.7/lib/mail/message.rb:1910:in
`find_attachment'
/usr/local/lib/ruby/gems/1.9.1/gems/mail-2.2.7/lib/mail/message.rb:1705:in
`attachment?'
/usr/local/lib/ruby/gems/1.9.1/gems/mail-2.2.7/lib/mail/message.rb:1339:in
`add_charset'
/usr/local/lib/ruby/gems/1.9.1/gems/mail-2.2.7/lib/mail/message.rb:1841:in
`add_required_fields'
/usr/local/lib/ruby/gems/1.9.1/gems/mail-2.2.7/lib/mail/part.rb:42:in
`add_required_fields'
/usr/local/lib/ruby/gems/1.9.1/gems/mail-2.2.7/lib/mail/message.rb:1652:in
`ready_to_send!'
/usr/local/lib/ruby/gems/1.9.1/gems/mail-2.2.7/lib/mail/message.rb:1650:in
`block in ready_to_send!'
/usr/local/lib/ruby/gems/1.9.1/gems/mail-2.2.7/lib/mail/message.rb:1648:in
`each'
/usr/local/lib/ruby/gems/1.9.1/gems/mail-2.2.7/lib/mail/message.rb:1648:in
`ready_to_send!'
/usr/local/lib/ruby/gems/1.9.1/gems/mail-2.2.7/lib/mail/message.rb:1664:in
`encoded'
/var/www/oddb.org/src/util/log.rb:127:in `block (2 levels) in send_mail'
/var/www/oddb.org/src/util/log.rb:124:in `each'
/var/www/oddb.org/src/util/log.rb:124:in `block in send_mail'
/usr/local/lib/ruby/1.9.1/net/smtp.rb:520:in `start'
/usr/local/lib/ruby/1.9.1/net/smtp.rb:457:in `start'
/var/www/oddb.org/src/util/log.rb:119:in `send_mail'
/var/www/oddb.org/src/util/log.rb:84:in `notify'
/var/www/oddb.org/src/util/exporter.rb:136:in `block in export_fachinfo_chapter'
/var/www/oddb.org/src/util/exporter.rb:425:in `call'
/var/www/oddb.org/src/util/exporter.rb:425:in `safe_export'
/var/www/oddb.org/src/util/exporter.rb:121:in `export_fachinfo_chapter'
jobs/export_fachinfo_chapter:44: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/export_fachinfo_chapter:13:in `<module:Util>'
jobs/export_fachinfo_chapter:12:in `<module:ODDB>'
jobs/export_fachinfo_chapter:11:in `<main>'

Why? Checking whether the error can be reproduced on oddb-ci2.

Grepping grep -n safe_export /var/www/oddb.org/log/oddb/debug/2014/03.log returns

105:2014-03-01 10:47:02 CET safe_export Fachinfo Chapter Export starting
253:2014-03-01 13:44:58 CET safe_export Fachinfo Chapter Export failed

2014-03-01 13:44:48 CET @files={"/var/www/oddb.org/data/downloads/fachinfo_chapter_usage_intravenös.2014-03-01.csv.zip"=>["application/zip"]}
2014-03-01 13:44:49 CET start outgoing process
2014-03-01 13:44:50 CET @recipients=[]
2014-03-01 13:44:50 CET self::class::MAIL_TO=["zdavatz@ywesee.com", "yasaka@ywesee.com"]
2014-03-01 13:44:50 CET self::class=ODDB::Log
2014-03-01 13:44:51 CET before send_mail(outgoing)
2014-03-01 13:44:51 CET getin send_mail
2014-03-01 13:44:51 CET config.mail_to=["zdavatz@ywesee.com", "ngiger@ywesee.com", "yasaka@ywesee.com"]

The export of bsv, SL-Update, bsv-follower completed. Now looking at the csv /var/www/oddb.org/data/downloads/fachinfo_chapter_usage_intravenös.2014-03-01.csv.zip.

Add medical products

Starting refactoring by adding PseudoFachinfo via

  1. new class PseudoFachinfoDokument in src/model/fachinfo.rb
  2. a parser TextinfoPseudoFachinfo (similar to TextinfoHpricot) in ext/fiparse
  3. a new writer FachinfoHpricotWriter (similar to FachinfoHpricot) in ext/fiparse
  4. rewrite plugin/medical_products to use the parse/writer etc above
  5. add test_case and rework unit tests to allow an easy test of each of the aspects mentioned above
  6. may be a few changes in src/view/fachinfo (not sure about this)
  7. may be rework ydocx gem to allow plugging in a new parser (but I think this is not necessary)
  8. And last but not least. Document these decision somewhere under http://dev.ywesee.com/Choddb/Index
  9. Do we want to use the fiparsed daemon to parse the docx-files? Only when serving via http? Not when running an importer or minitest? Will try using fiparsed by default and not running in the other two cases, if requested.

Pushed commit Added PseudoFachinfoDocument. Now working on adding TextinfoPseudoFachinfo in ext/fiparse.

Added support for parsing docx files. Sinovial_DE works except for the following fields

  1. iksnrs
  2. indications
  3. unwanted_effects

Now parsing Sinovial_DE.docs works. Pushed commit Parsing Pseudo_FI works for german. French has problem. Running bundle exec ruby ext/fiparse/test/test_pseudo_fachinfo.rb produced ext/fiparse/test/data/docx/Sinovial_FR.xml (see Attach:Sinovial_FR.txt) and ext/fiparse/test/data/docx/Sinovial_DE.xml (see Attach:Sinovial_DE.txt)

Leaving the error with french till I have finished my refactoring. Will probably have to interate simply over all paragraphs and adding a new chapter each time the paragraph has style italic and bold. (Estimated time 2 to 3 h).

Fixed with Fixed parsing docx files for FR. Had to add a call to xmlformat or nokogiri would not have parsed the xml correctly! The language is recognized automatically.

Pushed Adapted parser to PseudoFachinfo. As we detect the language from the *.docx file, there is no need to have language-specific sub-directories under data/medical_products/.

Running jobs/import_medical_products on oddb_ci2. They fail because the method descriptions does not work for a PseudoFachinfoDocument. The stack was

Plugin: ODDB::MedicalProductPlugin
Error: NoMethodError
Message: undefined method `descriptions' for #<ODDB::PseudoFachinfoDocument:0x007fdb90680650>
Backtrace:
/var/www/oddb.org/src/plugin/text_info.rb:121:in `block in replace_textinfo'
/var/www/oddb.org/src/plugin/text_info.rb:120:in `each'
/var/www/oddb.org/src/plugin/text_info.rb:120:in `replace_textinfo'
/var/www/oddb.org/src/plugin/medical_products.rb:72:in `block (2 levels) in update'
/var/www/oddb.org/src/plugin/medical_products.rb:44:in `each'
/var/www/oddb.org/src/plugin/medical_products.rb:44:in `block in update'
/var/www/oddb.org/src/plugin/medical_products.rb:41:in `each'
/var/www/oddb.org/src/plugin/medical_products.rb:41:in `update'
/var/www/oddb.org/src/util/updater.rb:525:in `block in update_notify_simple'
/var/www/oddb.org/src/util/updater.rb:501:in `call'
/var/www/oddb.org/src/util/updater.rb:501:in `wrap_update'
/var/www/oddb.org/src/util/updater.rb:519:in `update_notify_simple'
/var/www/oddb.org/src/util/updater.rb:340:in `update_medical_products'
jobs/import_medical_products:27: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_medical_products:26:in `<module:Util>'
jobs/import_medical_products:12:in `<module:ODDB>'
jobs/import_medical_products:11:in `<main>

Fixed with commit Fix problem with TextInfo descriptions

Now all chapters show up (in German and French). But we have the following error

  1. distributor has no entry on top for the moment
  2. paragraphs have not the correct CSS-class attached.
  3. commercial_form is missing

These errors will be fixed tomorrow. Merged branch redesign_medical_products into my master and pushed it.

See german

See french

Make graphical interface work

Added setxkmap ch to get swiss german keyboard. firefox starts with error sys_page_size == 0 failed. Emerging chromium. Chromium starts but presents only a grid of its window. Still unusable. Must still edit this log on my Debian system.

view · edit · sidebar · attach · print · history
Page last modified on October 21, 2015, at 10:43 AM