view · edit · sidebar · attach · print · history

< Niklaus.20141215-fix-hospital | 2014 | Niklaus.20141209-import-atc-code >>

20141210-fix-recall

Summary

  • recalls do not correctly update the rss feed on ch.oddb.org
  • create separate gem for medical persons and companies

Commits

Index

Keep in Mind
  • 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!

---

create separate gem for medical persons and companies

Pushed commits

Started importers in two different screens on oddb-ci2 with bin/medreg company and bin/medreg persons.

recalls do not correctly update the rss feed on ch.oddb.org

I think I found the culprit. For HPC the first link matching the text '1' is '1', whereas for reccalls it is 'Archive 2003-2012'. Trying to find a better way.

Now I find in the log/oddb/debug/2014/12.log the following entries

2014-12-10 08:31:52 UTC rss adding current issue: 2014-12-03 Chargenrückruf / Meropenem-Teva 500 mg und 1 g, Pulver zur Herstellung einer Injektions- oder Infusionslösung
2014-12-10 08:31:52 UTC rss adding new entry: 2014-12-03 Chargenrückruf / Meropenem-Teva 500 mg und 1 g, Pulver zur Herstellung einer Injektions- oder Infusionslösung
2014-12-10 08:31:52 UTC rss adding new entry: 2014-11-28 Chargenrückruf / Feniallerg, Injektionslösung
2014-12-10 08:31:52 UTC rss adding new entry: 2014-11-27 Chargenrückruf / Sanalepsi N, Tropfen
2014-12-10 08:31:52 UTC rss adding new entry: 2014-11-21 Chargenrückruf / Prolutex, Injektionslösung
2014-12-10 08:31:53 UTC rss adding new entry: 2014-11-19 Chargenrückruf / Omeprazol Sandoz eco 20mg, Filmtabletten
2014-12-10 08:31:53 UTC rss adding new entry: 2014-10-24 Chargenrückruf / Zovirax Augensalbe
2014-12-10 08:31:53 UTC rss adding new entry: 2014-10-15 Chargenrückruf / Epaxal, Injektionssuspension
2014-12-10 08:31:53 UTC rss adding new entry: 2014-10-13 Chargenrückruf / Torisel, Konzentrat zur Herstellung einer Infusionslösung
2014-12-10 08:31:54 UTC rss adding new entry: 2014-10-09 Chargenrückruf / Donepezil-Mepha 5 mg / 10 mg, Lactab
2014-12-10 08:31:54 UTC rss adding new entry: 2014-10-06 Chargenrückruf / Kiovig, Infusionslösung

but accessing http://oddb-ci2.dyndns.org/de/gcc/rss/channel/recall.rss returns a resources/errors/appdown.html

Looking at log/oddb/error_log I find

[Wed Dec 10 10:06:38 2014] [error] access to /de/gcc/rss/channel/recall.rss failed for (null), reason: Wed Dec 10 10:06:38 +0100 2014 - 70318592335080 - Errno::ENOENT - No such file or directory - /var/www/oddb.org/data/rss/de/recall.rss
[Wed Dec 10 10:06:38 2014] [error] access to /de/gcc/rss/channel/recall.rss failed for (null), reason: /usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.5/lib/sbsm/request.rb:180:in `size'
[Wed Dec 10 10:06:38 2014] [error] access to /de/gcc/rss/channel/recall.rss failed for (null), reason: /usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.5/lib/sbsm/request.rb:180:in `drb_process'
[Wed Dec 10 10:06:38 2014] [error] access to /de/gcc/rss/channel/recall.rss failed for (null), reason: /usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.5/lib/sbsm/request.rb:66:in `process'
[Wed Dec 10 10:06:38 2014] [error] access to /de/gcc/rss/channel/recall.rss failed for (null), reason: /var/www/oddb.org/doc/index.rbx:21
[Wed Dec 10 10:06:38 2014] [error] access to /de/gcc/rss/channel/recall.rss failed for (null), reason: /usr/lib64/ruby/1.8/apache/ruby-run.rb:53:in `load'
[Wed Dec 10 10:06:38 2014] [error] access to /de/gcc/rss/channel/recall.rss failed for (null), reason: /usr/lib64/ruby/1.8/apache/ruby-run.rb:53:in `handler'

Copied maually from thinpower /var/www/oddb.org/data/rss/de/recall.rss to oddb-ci2. Now at least I see the feeds as before.

But I must rework the nested loops to get the content in a reliable way. Found a solution. Making the unit tests work require more work than expected. My final solution was:

  • Use flexmock to divert open-uri(open) tot read a text file. Eg. flexmock(@plugin) do |plug| plug.should_receive(:open).with(filename).and_return(content)) end
  • Make the Mechanize agent writable and mock with the following pattern
  mechanize = flexmock("mechanize")
  mechanize.should_receive(:get).with(url).and_return(content)
  @plugin.agent= mechanize

See test/test_plugin/rss.rb. Pushed commit Fix recall

Zeno remarked that various recalls were added several times. Pushed commit Don't add recall/hpc entries twice

view · edit · sidebar · attach · print · history
Page last modified on September 02, 2015, at 11:25 AM