view · edit · sidebar · attach · print · history

20120407-update-swissindex-updater-job

<< | Index | >>


summary

  • updated swissindex_pharma updater
    • use not :get_by_gtin action, but :download_all (only 1 soap request(1 get, 1 post))
    • saved response as xml
    • updated swissindex_pharmad

commit

index


Update swissindex updater job

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> 
Note

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|
...
Result
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
view · edit · sidebar · attach · print · history
Page last modified on April 07, 2012, at 04:18 PM