- OpenDrugDatabase for Germany

Below notes go by timeline. The most uptodate is on top.

11:15 - 26.10.2010

If you want to import a PDF directly, do

$ jobs/import_gkv pdf=

15:21 - 02.09.2010

Granting PowerUser and Admin privileges:

yus_grant login


yus_grant login

14.34 - 01.09.2010

For exporting the chde.xls the


has to run at on localhost:10013. Also the currencyd has to run on localhost:10999

I also had to change the require path for


from 'oddb/util/multilingual'


/ 'src/remote/multilingual'

10.14 - 01.09.2010



should not be overwritten with the

sequence.rb (68 lines of code)

file from the pure ODDB (64 lines of code)

Library, or the Painfo.yaml and Fachinfo.yaml will fail with a

undefined method `cascading_name' for #<ODDB::Drugs::Sequence:0xb5080fec>


16.36 - 30.08.2010

Always execute the the jobs of from ../jobs otherwise the scripts will create a var directory in the jobs directory. And you don't want that!

I also noted that if you do not use the plain ODDB Library from the scm but only the files from

then you will have to add some files from the pure ODDB-Library. Follow the errors you get when you start-up


08.30 - 30.08.2010


sudo ./export_fachinfos

results in

/usr/lib/ruby/1.8/net/smtp.rb:562:in `check_auth_args': both user and secret are required (ArgumentError)

from /home/zeno/.software/ `do_start'
from /usr/lib/ruby/1.8/net/smtp.rb:377:in `start'
from /usr/lib/ruby/1.8/net/smtp.rb:315:in `start'
from /usr/lib/ruby/site_ruby/1.8/oddb/util/mail.rb:77:in `sendmail'
from /usr/lib/ruby/site_ruby/1.8/oddb/util/mail.rb:27:in `notify_admins'
from /home/zeno/.software/ `safe_export'
from /home/zeno/.software/ `export_fachinfo_yaml'
from ./export_fachinfo_yaml:17
from /usr/lib/ruby/site_ruby/1.8/oddb/util/job.rb:16:in `call'
from /usr/lib/ruby/site_ruby/1.8/oddb/util/job.rb:16:in `run'
from ./export_fachinfo_yaml:16

There must be a configuration somewhere that sets the Mail-sending method. Looking into this now.

08.15 - 30.08.2010

This commit made the difference to start-up;a=commit;h=d59aaecbf23461cf5c677e3c49d492600909af74

The plain ODDB Library was only setup to work with the new version of So all the files from

/var/www/ where linked to


But the goal is to install the ODDB-Library seperatly for and The config.rb file has also been replaced by the config.rb from /var/www/ as the .config.rb was setup for - see this commit:;a=blobdiff;f=lib/oddb/config.rb;h=280cedcb751c467a58178d5c2eb24efaa2541ab2;hp=35b9efca3430ba8a6e5f83068bba117d40cc381a;hb=8e9cbd2848bd20e18ef158ea520476a183053a34;hpb=70d736e9325049dcb565f995081d65fb6298af3a

11.02 - 26.08.2010


# logger.error('fatal') { error } p error



and getting the following output

#<NameError: uninitialized constant ODDB::Util::Server> bin/oddbd:18: uninitialized constant ODDB::Util::Server (NameError)

after running

sudo bin/oddbd

08.06 - 26.08.2010


seems to run just fine once I installed


The version online is 1.4.0. My local version of fastercsv is 1.5.3. My


crashes right after

FEHLER: Relation ?target_id_oddb_drugs_atc_code? existiert bereits FEHLER: Relation ?target_id_oddb_drugs_sequence_atc? existiert bereits

this is shortly before this message should come (as it does with bin/exportd)

I, [2010-08-26T08:03:37.025071 #26182] INFO -- start: starting export-server on druby://localhost:11001

16.23 - 25.08.2010

This file


also needs a

require 'rubygems'

to get rid of the "Internal Server Error" of Apache.

I also commened out the following lines

# server = #'start') { # sprintf("starting oddb-server on %s", url) } # logger.error('fatal') { error }



that makes startup but I can not yet search. Apache still delivers some strange errors.

15:30 - 25.08.2010

I am getting on after importing the DB with zcat (same like with I run

sudo bin/oddbd

It results in

FEHLER: Relation ?target_id_oddb_drugs_package_code? existiert bereits

FEHLER: Relation ?target_id_oddb_drugs_package_substance? existiert bereits

FEHLER: Relation ?target_id_oddb_drugs_atc_code? existiert bereits

FEHLER: Relation ?target_id_oddb_drugs_sequence_atc? existiert bereits

.software/ undefined method `error' for nil:NilClass (NoMethodError)

This looks like is waiting for a service but I do not know what kind of service it could be. It may also be just another strange error.

13:52 - 25.08.2010

I added

require 'rubygems'

to the following files on my local machine


In the following file


I changed

require 'facets/module/basename'


require 'facet/module/basename'

this made the following error go away:

/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- facets/module/basename (LoadError)

from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/lib/ruby/site_ruby/1.8/oddb/model.rb:6
from /usr/lib/ruby/site_ruby/1.8/oddb/drugs/active_agent.rb:4:in `require'
from /usr/lib/ruby/site_ruby/1.8/oddb/drugs/active_agent.rb:4
from /usr/lib/ruby/site_ruby/1.8/oddb/drugs.rb:1:in `require'
from /usr/lib/ruby/site_ruby/1.8/oddb/drugs.rb:1
from bin/oddbd:9:in `require'
from bin/oddbd:9

Now I am getting

/usr/lib/ruby/site_ruby/1.8/DBD/Pg/Pg.rb:118:in `initialize': FATAL: Datenbank >>oddb<< existiert nicht (DBI::OperationalError)

from /usr/lib/ruby/site_ruby/1.8/DBD/Pg/Pg.rb:62:in `new'
from /usr/lib/ruby/site_ruby/1.8/DBD/Pg/Pg.rb:62:in `connect'
from /usr/lib/ruby/site_ruby/1.8/dbi.rb:424:in `connect'
from /usr/lib/ruby/site_ruby/1.8/dbi.rb:215:in `connect'
from /usr/lib/ruby/site_ruby/1.8/odba/connection_pool.rb:60:in `_connect'
from /usr/lib/ruby/site_ruby/1.8/odba/connection_pool.rb:59:in `times'
from /usr/lib/ruby/site_ruby/1.8/odba/connection_pool.rb:59:in `_connect'
from /usr/lib/ruby/site_ruby/1.8/odba/connection_pool.rb:56:in `connect'
 ... 7 levels...
from /usr/lib/ruby/site_ruby/1.8/oddb/persistence.rb:4
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from bin/oddbd:10

I guess I need the DB now.

11:00 - 25.08.2010

The following directory also did not exist on my local machine:


instead my local machine has the directory


but above directory is not on thinpower.

10:00 - 25.08.2010

There is a difference in the data structure of


between thinpower and the my local machine _*after*_ I done a git pull. There must be some files missing that where not added with

git add

The files that seem to be missing on my local machine are

business.rb text.rb

09:00 - 25.08.2010

Trying to setup results in the following error:

/usr/lib/ruby/site_ruby/1.8/oddb/fixes/singular.rb:4:in `require': no such file to load -- active_support/inflector (LoadError)

from /usr/lib/ruby/site_ruby/1.8/oddb/fixes/singular.rb:4
from /usr/lib/ruby/site_ruby/1.8/oddb/model.rb:4:in `require'
from /usr/lib/ruby/site_ruby/1.8/oddb/model.rb:4
from /usr/lib/ruby/site_ruby/1.8/oddb/drugs/active_agent.rb:4:in `require'
from /usr/lib/ruby/site_ruby/1.8/oddb/drugs/active_agent.rb:4
from /usr/lib/ruby/site_ruby/1.8/oddb/drugs.rb:1:in `require'
from /usr/lib/ruby/site_ruby/1.8/oddb/drugs.rb:1
from bin/oddbd:9:in `require'
from bin/oddbd:9

Debugging now.

Date: 2008-08-09-11:08

Short Description: is an OpenDrugDatabase that enables the search for Drugs by their ActiveAgent, Name, Producer, ATC-Code and much more. You can do a price comparison between the Original Drug and the Generic by Clicking on the Drug's Name. The database tells you a lot about the officially registerted Drugs in Germany (In Germany any drug on the market needs to be registered at Bfarm - Bundesinstitut f?r Arzneimittel). exports the complete Data in the Format (34117 registred products at the moment).

For for more information about the background see:


* *


* GPLv2.0

Source Code Download with GIT

* URL:


A discussion on

Post by Zeno: In Switzerland we have the problem that there is only one provider of the data. And that provider serves all hospitals, doctors, old age homes, pharmacies etc. As they have the monopoly the could issue a tax on every transaction that is done with there data; Example: The docotor in the hospital prescribes one drug to the patient. That info goes into the system and then gets passed on the specialist (external of hospital) and then gets passed on to the insurance etc. Imagine you must pay 50cent for every transaction of the data...

Post by Tim: This certainly carries some pretty scary scenarios. Are there not laws to prevent abuse? It would seem that a government monoploy has been issued here and there would be protections in place.

Post by Zeno: 1. Yes, that is exactly the problem. The company that has the monopoly also is working for the government and administrating the database of all drugs that are covered by the public health insurance.

2. I have taken the above issues to antitrust department and the 'price governing' department of Switzerland. The first pushed the issue to the second and vice versa. I then contacted the leading consumer representative of Switzerland and she gave the issue some momentum.

3. The result of the above was an independent database for Switzerland. My personal interest is the acceleration of the electronic data interchange in the healthcare industry. This can only take place on open standards.

More here:




1 ruby 1.8, mod_ruby, drbsession, spreadsheet
2 apache, ruby-zlib, rubyzip, tarsimple, madeleine, rockit, tmail
3 rpdf2txt, rwv2, htmlgrid, datastructure, parseexcel, ywesee session-management

Note: For 1 and 2 please search with Google. For 3 please download from *


Just copy everything into a directory of your choice, Configure your favorite Webserver to serve the $ODDBDIR/doc directory and to rewrite urls as follows: your.tld/(w2)/(w+)/(w+)/(w+) => your.tld/index.rbx?language=1&flavor=2&3=4 If you're interested in having the data that we provide online we can send you our ODBA snapshot. Please contact us at

Install Instructions



* Normal Consumer
* Health Insurance (Krankenkasse)
* Pharmacie
* Hospital
* Doctor / Physician
* Pharma Marketing


* ywesee GmbH
* Hannes Wyss <>

Author of this README

* Zeno Davatz <>