<< | Index | >>
swissindex_pharmad
oddbd
and swissindex_pharmad
checked updating like this.
# create invalid data in oddb.org ch.oddb> update(registration('54931').sequence('01').package('026').pointer, {:out_of_trade => true, :refdata_override => false}, :refdata) -> #<ODDB::Package:0xe216660> ch.oddb> registration('54931').sequence('01').package('026').out_of_trade -> true ch.oddb> registration('54931').sequence('01').package('026').pharmacode -> 2873637 ch.oddb> update(registration('54931').sequence('01').package('026').pointer, {:pharmacode => 999999, :refdata_override => false}, :refdata) -> #<ODDB::Package:0xe216660> ch.oddb> registration('54931').sequence('01').package('026').pharmacode -> 999999 # run updater job here ch.oddb> Updater.new(self).update_package_trade_status_by_swissindex(true) -> ["yasaka@ywesee.com"] # updated correctly ch.oddb> registration('54931').sequence('01').package('026').pharmacode -> 2873637 ch.oddb> registration('54931').sequence('01').package('026').out_of_trade -> false ch.oddb>
check with only some packages.
in src/plugin/swissindex.rb
#@total_packages = ... @total_packages = 3 ... #@app.each_package do |pack| [ @app.registration('54930').sequence('01').package('011'), @app.registration('54931').sequence('01').package('026'), @app.registration('53025').sequence('02').package('056') ].each do |pack| ...
Checked 3 packages Updated in trade (out_of_trade:false): 1 packages Updated out of trade (out_of_trade:true) : 0 packages Updated pharmacode: 1 packages Deleted pharmacode: 0 packages Updated in trade (out_of_trade:false): 1 packages Check swissindex by eancode and then check if the package is out of trade (true) in ch.oddb, if so the package becomes in trade (false) 7680549310261: http://ch.oddb.org/de/gcc/drug/reg/54931/seq/01/pack/026 Updated out of trade (out_of_trade:true) : 0 packages If there is no eancode in swissindex and the package is in trade in ch.oddb, then the package becomes out of trade (true) in ch.oddb Updated pharmacode: 1 packages If the package does not have a pharmacode and there is a pharmacode found in swissindex, then put the pharmacode into ch.oddb 7680549310261: http://ch.oddb.org/de/gcc/drug/reg/54931/seq/01/pack/026 Deleted pharmacode: 0 packages If there is no eancode in swissindex then delete the according pharmacode in ch.oddb