view · edit · sidebar · attach · print · history

Index>

20140121-interaction-url

Summary

  • interaction-url should include barcode when adding manually a new drug

Commits

Index

---

Packungen/Präparate should not be compared twice

Pushed commit Debug cp/compare of downloaded files. Closer to version of december.

The log file, e.g. log/swissmedic.rb/2014/01.log, now tells us now when the latest files get copied and which size they have. It contains, e.g.

2014-01-21 21:08:58 +0100: /var/www/oddb.org/src/plugin/swissmedic.rb: 85 update target "/var/www/oddb.org/data/xls/Packungen-2014.01.21.xlsx" latest "/var/www/oddb.org/data/xls/Packungen-latest.xlsx"
2014-01-21 21:09:27 +0100: /var/www/oddb.org/src/plugin/swissmedic.rb: 90 calling diff /var/www/oddb.org/data/xls/Packungen-2014.01.21.xlsx /var/www/oddb.org/data/xls/Packungen-latest.xlsx
2014-01-21 21:14:31 +0100: /var/www/oddb.org/src/plugin/swissmedic.rb: 54 update target "/var/www/oddb.org/data/xls/Packungen-2014.01.21.xlsx" latest "/var/www/oddb.org/data/xls/Packungen-latest.xlsx"
2014-01-21 21:16:55 +0100: /var/www/oddb.org/src/plugin/swissmedic.rb: 54 update target /var/www/oddb.org/data/xls/Packungen-2014.01.21.xlsx  2676058 bytes. Latest /var/www/oddb.org/data/xls/Packungen-latest.xlsx 2683892 bytes
2014-01-21 22:00:10 +0100: /var/www/oddb.org/src/plugin/swissmedic.rb: 53 update target /var/www/oddb.org/data/xls/Packungen-2014.01.21.xlsx  2676058 bytes. Latest /var/www/oddb.org/data/xls/Packungen-latest.xlsx 2683892 bytes
2014-01-21 22:00:12 +0100: cp /var/www/oddb.org/data/xls/Präparateliste-2014.01.21.xlsx /var/www/oddb.org/data/xls/Präparateliste-latest.xlsx

iinteraction-url should include barcode when adding manually a new drug

see also task interaction link

It was easy to extend the search using not only atc, but also iksnr and ean13. Therefore locally the following links work:

  1. http://oddb-ci2.dyndns.org/de/gcc/interaction_search/atc/C07AA05,N02BA01
  2. http://oddb-ci2.dyndns.org/de/gcc/interaction_search/iksnr/39053,58392,51795
  3. http://oddb-ci2.dyndns.org/de/gcc/interaction_search/ean13/7680317061142,7680583920112

Now I must fix the problem, that manually adding more items does not update the link. As after selecting one sees the barcode in the value to add, I think it should be obvious for newcomers, when we use afterwards always links for the third form ean13/ean_1,ean_2,ean_3

The problem lies that the ajax script in src/view/searchbar.rb returns only a /ean13/id value and does not take into account the existing search_path. Therefore changing the displayed URL to reflect the state of all selected items, will be quite time consuming and means digging even deeper.

After a discussion with Zeno I decided to simply the URL. Instead of specifying the type (atc,iksnr,ean13) I will just accept any of the three and depending on the length of the passed parameter use the correct kind. Therefore the URL will change to:

It proves to be a real problem finding the correct way to redirect the first result of a drug to the corresponding interaction_search. As we have now just one single interaction_search I removed all interactions_home and replaced them by interation_search. But now I get the following error whne starting up.

/var/www/oddb.org/vendor/bundle/ruby/1.9.1/gems/dbd-pg-0.3.9/lib/dbd/pg/statement.rb:62:in `rescue in execute': FEHLER:  wrong number of index expressions (DBI::ProgrammingError)
        from /var/www/oddb.org/vendor/bundle/ruby/1.9.1/gems/dbd-pg-0.3.9/lib/dbd/pg/statement.rb:37:in `execute'
        from /var/www/oddb.org/vendor/bundle/ruby/1.9.1/bundler/gems/ruby-dbi-dcd6239fd5f8/lib/dbi/base_classes/database.rb:96:in `execute'
        from /var/www/oddb.org/vendor/bundle/ruby/1.9.1/bundler/gems/ruby-dbi-dcd6239fd5f8/lib/dbi/handles/database.rb:81:in `execute'
        from /var/www/oddb.org/vendor/bundle/ruby/1.9.1/bundler/gems/ruby-dbi-dcd6239fd5f8/lib/dbi/handles/database.rb:128:in `select_all'
        from /var/www/oddb.org/vendor/bundle/ruby/1.9.1/gems/dbd-pg-0.3.9/lib/dbd/pg/database.rb:169:in `columns'
        from /var/www/oddb.org/vendor/bundle/ruby/1.9.1/bundler/gems/ruby-dbi-dcd6239fd5f8/lib/dbi/handles/database.rb:161:in `columns'
        from /var/www/oddb.org/vendor/bundle/ruby/1.9.1/gems/odba-1.1.0/lib/odba/connection_pool.rb:39:in `block in method_missing'
        from /var/www/oddb.org/vendor/bundle/ruby/1.9.1/gems/odba-1.1.0/lib/odba/connection_pool.rb:29:in `next_connection'
        from /var/www/oddb.org/vendor/bundle/ruby/1.9.1/gems/odba-1.1.0/lib/odba/connection_pool.rb:38:in `method_missing'
        from /var/www/oddb.org/vendor/bundle/ruby/1.9.1/gems/odba-1.1.0/lib/odba/storage.rb:526:in `setup'
        from /var/www/oddb.org/vendor/bundle/ruby/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:473:in `setup'
        from bin/oddbd:25:in `<main>'

This error did not go away even after reverting to a clean state of the git checkout. Therefore reimporting the database.

Reason turned out that a few days ago a did an word upgrade which installed postgres 9.4, but did not restart the server. Loading the dump did fail. Returned to postgresl 8.4. Had to reinstall aspell-de, aspell-fr and run emerge --config =dev-db/postgresql-server-8.4.17 && emerge =dev-db/postgresql-server-8.4.17

After that bundle exec bin/oddbd complained with

/var/www/oddb.org/vendor/bundle/ruby/1.9.1/gems/pg-0.17.0/lib/pg.rb:4:in `require': /var/www/oddb.org/vendor/bundle/ruby/1.9.1/gems/pg-0.17.0/lib/pg_ext.so: undefined symbol: PQescapeLiteral - /var/www/oddb.org/vendor/bundle/ruby/1.9.1/gems/pg-0.17.0/lib/pg_ext.so (LoadError)
        from /var/www/oddb.org/vendor/bundle/ruby/1.9.1/gems/pg-0.17.0/lib/pg.rb:4:in `<top (required)>'
        from /var/www/oddb.org/etc/db_connection.rb:3:in `require'
        from /var/www/oddb.org/etc/db_connection.rb:3:in `<top (required)>'
        from bin/oddbd:10:in `require'
        from bin/oddbd:10:in `<main>'
n

The following commands fixed this problem

cd /var/www/oddbd.org
sudo rm -rf vendor
sudo -u apache bundle install
view · edit · sidebar · attach · print · history
Page last modified on January 22, 2014, at 09:53 AM