view · edit · sidebar · attach · print · history

20110525-update-zubef-flag-de_oddb

<< | Index | >>


  1. Check the 'Speichern' function
  2. Apply the 'Speichern' to all packages

Goal/Estimate/Evaluation
  • Debug zubef flag / 70% / 70%
Milestones
  • BraSt
    • first, test data save on bin/admin
    • second, import_gkv
Summary
Commits

Check the 'Speichern' function

Review

  • Package#save method deletes the package data from the database
  • 'Speichern' button function keeps the data after the Package#save method runs

Confirmation

1. Default

2. Click 'Speichern'

Console log

ODBA::Stub was unable to replace Hash#4285688 from ODDB::Drugs::Package:#137633
ODBA::Stub was unable to replace Array#4285690 from ODDB::Drugs::Package:#137633
ODBA::Stub was unable to replace Array#4285689 from ODDB::Drugs::Package:#137633
ODBA::Stub was unable to replace Hash#4285691 from ODDB::Drugs::Package:#164212
ODBA::Stub was unable to replace Array#4285693 from ODDB::Drugs::Package:#164212
ODBA::Stub was unable to replace Array#4285692 from ODDB::Drugs::Package:#164212
ODBA::Stub was unable to replace Hash#4285695 from ODDB::Drugs::Package:#174513
ODBA::Stub was unable to replace Array#4285696 from ODDB::Drugs::Package:#174513
ODBA::Stub was unable to replace Array#4285694 from ODDB::Drugs::Package:#174513
ODBA::Stub was unable to replace Array#4285699 from ODDB::Drugs::Sequence:#137626
ODBA::Stub was unable to replace Hash#4285700 from ODDB::Util::M10lDocument:#4285698
ODBA::Stub was unable to replace Hash#4285702 from ODDB::Util::M10lDocument:#4285697
ODBA::Stub was unable to replace Hash#4285688 from ODDB::Drugs::Package:#137633
ODBA::Stub was unable to replace Hash#4285691 from ODDB::Drugs::Package:#164212
ODBA::Stub was unable to replace Hash#4285695 from ODDB::Drugs::Package:#174513
ODBA::Stub was unable to replace Hash#4285705 from ODDB::Drugs::Package:#137630
ODBA::Stub was unable to replace Array#4285706 from ODDB::Drugs::Package:#137630
ODBA::Stub was unable to replace Array#4285704 from ODDB::Drugs::Package:#137630
ODBA::Stub was unable to replace Hash#4285709 from ODDB::Util::M10lDocument:#4285708
ODBA::Stub was unable to replace Hash#4285705 from ODDB::Drugs::Package:#137630

3. Zuzahlungsbefreit true on bin/admin, and Package#save

masa@masa ~/ywesee/de.oddb.org $ bin/admin
de.oddb> Drugs::Package.find_by_code(:type => 'cid', :value => '3867219', :country => 'DE').code(:zuzahlungsbefreit).value
-> false
de.oddb> Drugs::Package.find_by_code(:type => 'cid', :value => '3867219', :country => 'DE').code(:zuzahlungsbefreit).value = true
-> true
de.oddb> Drugs::Package.find_by_code(:type => 'cid', :value => '3867219', :country => 'DE').save
-> Acc 200 Brausetabletten

Console log

ODBA::Stub was unable to replace Hash#4285705 from ODDB::Drugs::Package:#137630

4. Reboot oddbd and check the result

Note

  • After the clicking of 'Speichern', the Package#save method works correctly.

Consideration

  • The data structure (link information in ODBA) may be broken.
  • The 'Speichern' button may reconstruct the object linkages.
  • But 'Festbetragsgruppe' value changes

Simple solution

  • Apply the same process of 'Speichern' button to all the package data

Apply the 'Speichern' to all packages

Refer to 'Speichern' button process

Experiment (2 times calling 'save' method)

masa@masa ~/ywesee/de.oddb.org $ bin/admin
de.oddb> Drugs::Package.find_by_code(:type => 'cid', :value => '3867219', :country => 'DE').code(:zuzahlungsbefreit).value = true
-> true
de.oddb> Drugs::Package.find_by_code(:type => 'cid', :value => '3867219', :country => 'DE').save
-> Acc 200 Brausetabletten
de.oddb> Drugs::Package.find_by_code(:type => 'cid', :value => '3867219', :country => 'DE').save
-> Acc 200 Brausetabletten
de.oddb> exit
-> Goodbye

Result

  • Success!!
  • I do not why, but it keeps the data after the rebooting

Experiment (2 times calling 'save' method for all the package data)

      def save_all_package
        total = ODDB::Drugs::Package.all.length
        i = 0
        ODDB::Drugs::Package.all.each do |pack|
          print i, "/", total, "\n"
          pack.save
          pack.save
          i += 1
        end
      end

Run

  • bin/admin
masa@masa ~/ywesee/de.oddb.org $ bin/admin
de.oddb> save_all_package
-rw-r--r--  1 masa masa 1954210197 25. Mai 15:16 oddb_after_save_all_package.sql
-rw-r--r--  1 masa masa 1865495500 25. Mai 08:06 oddb_before_save_all_package.sql

Note

  • the database size changed
  • Confirmation
  • jobs/import_gkv (only the first page)
masa@masa ~/ywesee/de.oddb.org $ ruby -I lib jobs/import_gkv
  • Result
Wed May 25 15:19:14 2011: de.oddb.org ODDB::Import::Gkv#import
Imported    11 Zubef-Entries on 25.05.2011:
Visited     10 existing Zubef-Entries
Visited     11 existing Companies
Visited      0 existing Substances
Created      1 new Zubef-Entries
Created      0 new Products
Created      0 new Sequences
Created      0 new Companies
Created      0 new Substances
Assigned     0 Chemical Equivalences
Assigned     0 Companies
Created      0 Incomplete Packages:
Created      1 Product(s) without a name (missing product name):
http://de.oddb.org/de/drugs/product/uid/3480899
  • After rebooting

Note

  • It seems that
    • Package#save method should be called 2 times
    • Otherwise, the update is not saved in the database

Experiment (After the import_gkv, execute save_all_package)

lib/oddb/import/gkv.rb#save

  def save(obj)
    obj.save
    obj.save
  end

Run

  • save_all_package
  • jobs/import_gkv (only the first page)

Result

view · edit · sidebar · attach · print · history
Page last modified on May 26, 2011, at 07:23 AM