view · edit · sidebar · attach · print · history


<< | Index | >>


  • tried to fix bind(2) error of Apache to DRbServer
    • suspend
  • learned
    • Model validation in
    • How to use values of testenviconment.rb
    • When(from Where) send E-mail updater job.
    • How to access object via bin/admin
    • Checked drug data structure of oddb.rg


bind(2) Error

I tried @sessions force clear by myself in loop of followings session cleaner.
But, Nothing happend.




Updating ATC-Klassierung at Admin form is faild

We can validate user input via check_accessor_list at model (This case, sequence.rb)
check is_a? in ODDB::AccessorCherkMethod::define_check_class_methods (src/util/perisitence.rb)


We can not search drugs that do not have an atc-code.
(search with keyword atcless to list all atcless products)


Old pointer link


testenviornment.rb changed to 2 files.

  • src/test/testenvironment1.rb
  • src/test/testenvironment2.rb

paths of these files are in etc/oddb.yml, are loaded in config.rb.

How to use

      mail =
      mail.content_type('text/plain; charset=UTF-8')
      if File.exist?(ODDB.config.testenvironment1) = ODDB::State::Admin::Sequence::RECIPIENTS
      else = [addr]

Email from Import job

import_bsv > Updater#update_bsv_followers run followings tasks.


each updater are executed in these private metods

  • log_notify_bsv
  • notify_error
  • update_immediate (use wrap_update)
  • update_notify_simple (use wrap_update)
  • update_simple (use wrap_update)

All updaters can send result emails via ODDB::Log#notify

  • Log#notify
  • Log#notify_attachment

(Don't use Log#send_mail, directly)

each update methods send update_method (at Updater#wrap_update)to each plugin.
Finaly, Plugin save updated values with ODBA#odba_isolated_store via ODDB::App

After updating, Updater send E-mail.

Learn bin/admin and odba

test target (zytinga)

  • specify drug wint registration Nr. and Sequence Nr.
ch.oddb> registration('62084').sequences["01"]
-> Zytiga, Tabletten
  • update value (cache)
ch.oddb> registration('62084').company
-> Janssen-Cilag AG
ch.oddb> registration('62084').company = 'yasaka AG'
-> yasaka AG
ch.oddb> registration('62084').company
-> yasaka AG

Then Browser outputs error NoMethodError undefined method `name' for "yasaka AG":String
This is just to update cache of ODBA. (After oddbd restart, can get previous correct value "")

  • check influence of relations
ch.oddb> registration('62084').sequences["01"].name
-> Zytiga, Tabletten
ch.oddb> registration('62084').sequences["01"]
-> Zytiga, Tabletten
ch.oddb> registration('62084').sequences["01"].name = 'Yasaka, Mann'
-> Yasaka, Mann
ch.oddb> registration('62084').sequences["01"].name
-> Yasaka, Mann
ch.oddb> registration('62084').sequences["01"]
-> Yasaka, Mann
  • access cache, directry with ODBA.cache
ch.oddb> registration('62084').odba_id
-> 27423387
ch.oddb> ODBA.cache.fetch("27423387")
-> #<ODDB::Registration:0xecaa130>
ch.oddb> ODBA.cache.fetch("27423387").sequences["01"].name
-> Yasaka, Mann

This is also storing to cache.

-> #<ODDB::Registration:0xff88b6c>

ODBA.cache.clear (not ODBA.cache.clean)

ch.oddb> ODBA.cache.clear
-> {}
ch.oddb> ODBA.cache.fetch("27423387").sequences["01"] #=> call :to_s as alias :name
-> Zytiga, Tabletten

see updated method in src/util/oddbapp.rb
We can update object of following class with update' method via bin/admin, directly.

  • ODDB::Registration
  • ODDB::Sequence,
  • ODDB::Package
  • ODDB::AtcClass
  • ODDB::LimitationText
  • ODDB::AtcClass::DDD
  • ODDB::Substance

In ODDB::App, these object are store with odba_isolated_store

In ODBA, ODBA::Storage class has SQL.

  --> ODBA::Cache#store (
    --> ODBA::Storage#store (
       --> UPDATE or INSERT with SQL

Package and Sequence

ch.oddb> registration('49742').packages
-> Array
ch.oddb> registration('49742').sequences
-> Hash

test target (zocor)

structure of drug data.

  • Registration --- 49742 Zocor (reg, :iksnr)
    • Sequence --- 02 20mg (seq, :seqnr)
      • Package --- 037 98 Tabletten (pack, :ikscd)
      • Package --- 045 28 Tabletten (pack, :ikscd)
    • Sequence --- 03 40mg (seq, :seqnr)
      • Package --- 053 28 Tabletten (pack, :ikscd)
      • Package --- 061 98 Tabletten (pack, :ikscd)
    • Sequence --- 04 80mg (seq, :seqnr)
      • Package --- 088 28 Tabletten (pack, :ikscd)
      • Package --- 096 98 Tabletten (pack, :iskcd)

We can access package value via bin/admin like this.

ch.oddb> registration('49742').sequences["02"].package("045").price_public
-> 44.10
ch.oddb> registration('49742').sequences["02"].package("037").price_public
-> 112.80

bin/admin can disconnect/reconnect to oddbd application, automatic, after restart oddbd.

ch.oddb> <ctrl-c> is used to kill admin-threads.
Type <quit> or <exit> to exit.

-> # => Enter
view · edit · sidebar · attach · print · history
Page last modified on February 29, 2012, at 06:55 PM