view · edit · sidebar · attach · print · history




  • ODDB: Parse Swissmedic nomarketing list
  • ODDB: Problems passing swissmedic_feed
  • Keep in Mind



ODDB: Parse Swissmedic nomarketing list

Starting work on downloading latest. Must create a single plugin which parses both list, creates a CSV file which contains for each concerned package an entry containing ATC-Code, name of package, link to nomarketing,link to drug_shortage. One of the last two fields may be nil. Adapted plugin to use two different updates and reports. Update did not work, as I had an error calculating the nodelivery_since.

Parsing XLSX file was no problem. Unit-Test pass now well. Running jobs/update_drugshortage to see how everything works.

Todo: Create CSV-File for the update. Generating CSV file works. Adding it to the email. Must lookup the name of the columns via lookandfeel.

When running update had another error, because a package had no ATC-Code attached. Looks like we have found package with wrong gtin. How can this happen? For the moment I will just output the missing GTIN and skip it. I think we must iterate inside a registration only over the active_packages and not all packages.

Creating the CSV file works now, but the mail is not yet generated correctly. Must add a date method in the plugin. Added unit tests for sending email with CSV attachement. Unit test pass, does the import pass now finally? Yes. Running it a second time failed, because I recognized correctly that the latest file was the same, but continued anyway. Also had to change src/util/updater.rb in update_drugshortage to return if the returns an empty array. Using reparse is working fine, too.

Pushed commit Added support for Swissmedic NoMarketing with CSV

What is happening with these lines

Skipping non existing package 4030539039857
Skipping non existing package 7612682900023
Skipping non existing package 7612682900030
Skipping non existing package 7640126140018
Skipping non existing package 7640161990210
Skipping non existing package 7680240410420
Skipping non existing package 7680400381751
Skipping non existing package 7680566990095
Skipping non existing package 7680584450014
Skipping non existing package 7680605420019

Pushed commit Fix problem when passing nil to

ODDB: Problems passing swissmedic_feed

With the following patch

iff --git a/src/util/job.rb b/src/util/job.rb
index 7db135c..b4c121a 100644
--- a/src/util/job.rb
+++ b/src/util/job.rb
@@ -39,7 +39,8 @@ module Job
         system.peer_cache ODBA.cache unless opts[:readonly] rescue Errno::ECONNREFUSED => true)
-    rescue Interrupt # C-c
+    rescue Interrupt => error # C-c
+      puts error.backtrace.join("\n")
       puts "Interrupted !!"
       puts "Please check #{PID_FILE}."

I got the following backtrace

2017-04-14 09:45:18 +0200: Latest found /var/www/ and same size as latest 405709 bytes.
(offline mode: enter name=value pairs on standard input)
^C/usr/local/ruby-2.4.0/lib/ruby/2.4.0/cgi/core.rb:618:in `readlines'
/usr/local/ruby-2.4.0/lib/ruby/2.4.0/cgi/core.rb:618:in `readlines'
/usr/local/ruby-2.4.0/lib/ruby/2.4.0/cgi/core.rb:618:in `read_from_cmdline'
/usr/local/ruby-2.4.0/lib/ruby/2.4.0/cgi/core.rb:664:in `initialize_query'
/usr/local/ruby-2.4.0/lib/ruby/2.4.0/cgi/core.rb:852:in `initialize'
/var/www/ `new'
/var/www/ `block (2 levels) in update_rss_feeds'
/var/www/ `open'
/var/www/ `block in update_rss_feeds'
/var/www/ `block in l10n_sessions'
/var/www/ `each_key'
/var/www/ `l10n_sessions'
/var/www/ `update_rss_feeds'
/var/www/ `update_swissmedic_feed'
/var/www/ `update_recall_feed'
/var/www/ `update_immediate_with_error_report'
/var/www/ `update_recall_feed'
/var/www/ `update_swissmedic_feeds'
/var/www/ `run'
jobs/import_daily:13:in `block in <module:Util>'
/var/www/ `run'
jobs/import_daily:12:in `<module:Util>'
jobs/import_daily:11:in `<module:ODDB>'
jobs/import_daily:10:in `<main>'
Interrupted !!
Please check /var/www/

Working on this problem next week.

view · edit · sidebar · attach · print · history
Page last modified on April 14, 2017, at 09:53 AM