view · edit · sidebar · attach · print · history

Index>

20140122-swissmedic-import-error

Summary

  • Error running swissmedic-import
  • replacing home_interactions by interaction_search
  • Use Packungen-latest.xlsx for textinfo update

Commits

Index

ToDo NextWeek
  • Finish work for interactions see . Most stuff works but interactions are not displayed as they should. Preliminary patch see Attach:interaction_patch.txt
Keep in Mind
  • HPC-RSS feed seems to update the link every day.
  • Error: Patents with could not connect to www.swissreg.ch: #<Net::HTTPInternalServerError:0x007f8a7d69bb58>
  • Fix problem that there are sequences '00' for products that have other sequences, too.
  • Fix problem missing SL Flag at Xeljanz with correct sequence 01.

---

Use Packungen-latest.xlsx for textinfo update

Discovered that we still used Packungen-latest.xls instead of Packungen-latest.xlsx when looking for FI/PI-updates. Fixes this with commit

Removing the downloaded files if there are no changes to the latest work with the two commit Swissmedic: remove downloaded file if identical to latest and Swissmedic: return latest if no changes.

I think however, that get_latest_file should return nil if nothing was changed (as in bsv_xml.rb). Found that I must return false if no update necessary. See Fix log log location. Return false if no update

Fixed problem with log location Fix log log location. Return false if no update

replacing interaction_home by interaction_search

I want to replace home_interactions by interaction_search to be able to show in the URL the barcodes of each selected drug.

After replacing home_interactions in all src ant ext files. The link in the home still displayed 'home_interactions' as link. Therefore I rebuild the indices.

The problem lies that oddb has a rule that all zones must have a home_<zonename> link. Therefore I reverted to use home_interaction. No I have the problem that I correctly display all the selected drugs, but not the interactions. Will fix this later.

Error running swissmedic-import

Did see (after importing the thinpower database of yesterday) the following error while running swissmedic-import

Plugin: ODDB::SwissmedicPlugin
Error: TypeError
Message: can't dup NilClass
Backtrace:
(eval):2:in `dup'
(eval):2:in `dup'
/var/www/oddb.org/src/model/package.rb:169:in `checkout'
/var/www/oddb.org/src/model/package.rb:475:in `checkout'
/var/www/oddb.org/src/util/persistence.rb:240:in `issue_delete'
/var/www/oddb.org/src/util/oddbapp.rb:120:in `block in delete'
/var/www/oddb.org/src/util/failsafe.rb:10:in `call'
/var/www/oddb.org/src/util/failsafe.rb:10:in `failsafe'
/var/www/oddb.org/src/util/oddbapp.rb:116:in `delete'
/var/www/oddb.org/src/command/delete.rb:11:in `execute'
/var/www/oddb.org/src/util/oddbapp.rb:694:in `execute_command'
/var/www/oddb.org/src/util/oddbapp.rb:1507:in `delete'
/var/www/oddb.org/src/plugin/swissmedic.rb:164:in `block in delete'
/var/www/oddb.org/src/plugin/swissmedic.rb:159:in `each'
/var/www/oddb.org/src/plugin/swissmedic.rb:159:in `delete'
/var/www/oddb.org/src/plugin/swissmedic.rb:72:in `update'
/var/www/oddb.org/src/util/updater.rb:393:in `block in update_swissmedic'
/var/www/oddb.org/src/util/updater.rb:495:in `call'
/var/www/oddb.org/src/util/updater.rb:495:in `wrap_update'
/var/www/oddb.org/src/util/updater.rb:391: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>'

The code in question is

def checkout
  checkout_helper([@generic_group], :remove_package)
  if @parts
    @parts.dup.each { |part|
      part.checkout
      part.odba_delete
    }
    @parts.odba_delete
  end
  if(@sl_entry.respond_to?(:checkout))
    @sl_entry.checkout
    @sl_entry.odba_delete
  end
  delete_all_mail_order_prices
end

Why can such a construct thow a nil error. The code looks clean for me (at least if you have only one thread running).

problem starting postgresql

Trying to be able start postgresl and bin/oddb failed. See http://forums.gentoo.org/viewtopic-t-895564-start-0.html

ggc-config x86_64-pc-linux-gnu-4.6.4
. .profile
CFLAGS="-march=native -O2 -pipe" sudo emerge =postgresql-base-8.4.17 =postgresql-server-8.4.17
sudo emerge --config dev-db/postgresql-server:8.4
sudo /etc/init.d/postgresql-8.4 start
sudo /usr/local/bin/pg_create_db.sh

Now bin/oddbd starts up again. But I still have the link to home_interactions. Checking whether http://oddb-ci2.dyndns.org/de/gcc/interaction_search/ works. It does. Fixing a problem when calling delete_all. Link to home in "Sie befinden sich in - Home - Interaktionen Suchen" works.

Looking the debugger I find the following entry when looking at http://oddb-ci2.dyndns.org/de/gcc/home/

<a class="tabnavigation" href="http://oddb-ci2.dyndns.org/de/gcc/home_interactions/" name="interactions">Interaktionen</a>

Probably the following code in src/state/global.rb creates the home_interactions link:

http://oddb-ci2.dyndns.org/de/gcc/home/

Maybe the simplest solution is to rename interaction_search to home_interactions. Will try this solution.

view · edit · sidebar · attach · print · history
Page last modified on February 05, 2014, at 02:46 PM