<< | Index | >>
I tried @sessions force clear by myself in loop of followings session cleaner.
But, Nothing happend.
suspend
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)
http://mobile.oddb.org/de/mobile/resolve/pointer/%3A%21registration%2C62084%21sequence%2C01.
testenviornment.rb changed to 2 files.
paths of these files are in etc/oddb.yml, are loaded in config.rb.
How to use
... mail = Mail.new mail.content_type('text/plain; charset=UTF-8') if File.exist?(ODDB.config.testenvironment1) mail.to = ODDB::State::Admin::Sequence::RECIPIENTS else mail.to = [addr] end ...
import_bsv > Updater#update_bsv_followers run followings tasks.
update_package_trade_status_by_swissindex update_lppv update_price_feeds export_oddb_csv export_oddb2_csv export_ouwerkerk export_generics_xls export_competition_xlss
each updater are executed in these private metods
All updaters can send result emails via ODDB::Log#notify
(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.
test target
http://oddb.yasuhiro.org/de/gcc/drug/reg/62084
(zytinga)
ch.oddb> registration('62084').sequences["01"] -> Zytiga, Tabletten
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 "")
ch.oddb> registration('62084').sequences["01"].name -> Zytiga, Tabletten ch.oddb> registration('62084').sequences["01"].active_packages.first.name -> 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"].active_packages.first.name -> Yasaka, Mann
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 ch.oddb>
This is also storing to cache.
ch.oddb> ODBA.cache.store(ODBA.cache.fetch("27423387")) -> #<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.
In ODDB::App, these object are store with odba_isolated_store
In ODBA, ODBA::Storage class has SQL.
ODBA.odba_isolated_store --> ODBA::Cache#store (ODBA.cache.store --> ODBA::Storage#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
http://oddb.yasuhiro.org/de/gcc/drug/reg/49742
(zocor)
structure of drug data.
49742
Zocor (reg, :iksnr)
02
20mg (seq, :seqnr)
037
98 Tabletten (pack, :ikscd)
045
28 Tabletten (pack, :ikscd)
03
40mg (seq, :seqnr)
053
28 Tabletten (pack, :ikscd)
061
98 Tabletten (pack, :ikscd)
04
80mg (seq, :seqnr)
088
28 Tabletten (pack, :ikscd)
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 ch.oddb>