view · edit · sidebar · attach · print · history

20110524-update-zubef-flag-de_oddb

<< | Index | >>


  1. Check log and result
  2. Trace the updating process
  3. Change all the zuzahlungsbefreit flags to be true

Goal/Estimate/Evaluation
  • Debug zubef flag / 70% / 60%
Milestones
  • Check log 8:00
Summary
Commits

Check log and result

Note

  • failed
  • Error email

Email

Mon May 23 16:28:56 2011: de.oddb.org ODDB::Import::Gkv#import
NoMethodError
undefined method `value' for nil:NilClass
./lib/oddb/import/gkv.rb:360:in `postprocess'
./lib/oddb/import/gkv.rb:357:in `each'
./lib/oddb/import/gkv.rb:357:in `postprocess'
./lib/oddb/import/gkv.rb:102:in `import'
/usr/lib64/ruby/site_ruby/1.8/oddb/util/updater.rb:96:in `reported_import'
/usr/lib64/ruby/site_ruby/1.8/oddb/util/updater.rb:103:in `call'
/usr/lib64/ruby/site_ruby/1.8/oddb/util/updater.rb:103:in `_reported_import'
/usr/lib64/ruby/site_ruby/1.8/oddb/util/updater.rb:96:in `reported_import'
/usr/lib64/ruby/site_ruby/1.8/oddb/util/updater.rb:58:in `import_gkv'
/usr/lib64/ruby/1.8/open-uri.rb:32:in `open_uri_original_open'
/usr/lib64/ruby/1.8/open-uri.rb:32:in `open'
./lib/oddb/import/gkv.rb:78:in `download_latest'
/usr/lib64/ruby/site_ruby/1.8/oddb/util/updater.rb:57:in `import_gkv'
jobs/import_gkv:16
./lib/oddb/util/job.rb:16:in `call'
./lib/oddb/util/job.rb:16:in `run'
jobs/import_gkv:15
Imported  6850 Zubef-Entries on 23.05.2011:
Visited   6510 existing Zubef-Entries
Visited   6850 existing Companies
Visited   1304 existing Substances
Created    340 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      0 Product(s) without a name (missing product name):

Search result

Note

  • All the links of active agent disappear
  • The zuzahlungsbefreit flag is still checked off

Console log

ERROR:  relation "object" already exists

ERROR:  relation "prefetchable_index" already exists

ERROR:  relation "extent_index" already exists

ERROR:  relation "object_connection" already exists

ERROR:  relation "target_id_index" already exists

ERROR:  relation "collection" already exists

/usr/lib64/ruby/site_ruby/1.8/odba/marshal.rb:15:in `load': undefined class/module ODDB::Business::GrantDownload (ArgumentError)
        from /usr/lib64/ruby/site_ruby/1.8/odba/marshal.rb:15:in `load'
        from /usr/lib64/ruby/site_ruby/1.8/odba/cache.rb:616:in `restore'
        from /usr/lib64/ruby/site_ruby/1.8/odba/cache.rb:336:in `fetch_or_restore'
        from /usr/lib64/ruby/site_ruby/1.8/odba/cache.rb:330:in `call'
        from /usr/lib64/ruby/site_ruby/1.8/odba/cache.rb:330:in `fetch_or_do'
        from /usr/lib64/ruby/site_ruby/1.8/odba/cache.rb:335:in `fetch_or_restore'
        from /usr/lib64/ruby/site_ruby/1.8/odba/cache.rb:64:in `bulk_restore'
        from /usr/lib64/ruby/site_ruby/1.8/odba/cache.rb:61:in `each'
         ... 20 levels...
        from /usr/lib64/ruby/site_ruby/1.8/oddb/util/job.rb:4
        from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /home/masa/ywesee/de.oddb.org/jobs/import_dimdi:7

Trace the updating process

Experiment (lib/oddb/import/gkv.rb#process_page)

  def process_page rows
unless @flag
    rows.each do |row|
p row.to_s
if row.to_s =~ /3867219/
      import_row row
  @flag = true
end
    end
end
  end

Run

  • jobs/import_gkv

Result

Console log

"doubtful"
"ACC 600 TABS0434230HEXAL AGAcetylcystein600mg20StTabletten12,16"
"ACC 600 TABS0434224HEXAL AGAcetylcystein600mg10StTabletten11,00"
"ACC 200 TABS0451145HEXAL AGAcetylcystein200mg100StTabletten15,37"
"ACC 200 TABS0451139HEXAL AGAcetylcystein200mg50StTabletten12,72"
"ACC 200 TABS0451122HEXAL AGAcetylcystein200mg20StTabletten11,00"
"ACC 200 PULVER0253103HEXAL AGAcetylcystein200mg100StPulver15,37"
"ACC 200 PULVER0253095HEXAL AGAcetylcystein200mg50StPulver12,72"
"ACC 200 PULVER0253089HEXAL AGAcetylcystein200mg20StPulver11,00"
"ACC 2004789763HEXAL AGAcetylcystein200mg20StBrausetabletten11,00"
"ACC 2003867225HEXAL AGAcetylcystein200mg100StBrausetabletten15,37"
"doubtful"
"doubtful"
"doubtful"
"doubtful"
"doubtful"
"ACC 2003867219HEXAL AGAcetylcystein200mg50StBrausetabletten12,72"
ODBA::Stub was unable to replace Hash#4285689 from ODDB::Drugs::Package:#137630
ODBA::Stub was unable to replace Array#4285688 from ODDB::Drugs::Package:#137630
ODBA::Stub was unable to replace Array#4285690 from ODDB::Drugs::Package:#137630
masa@masa ~/ywesee/de.oddb.org $ bin/admin
de.oddb> Drugs::Package.find_by_code(:type => 'cid', :value => '3867219', :country => 'DE')
-> Acc 200 Brausetabletten
de.oddb> Drugs::Package.find_by_code(:type => 'cid', :value => '3867219', :country => 'DE').code(:cid)
-> 
de.oddb> Drugs::Package.find_by_code(:type => 'cid', :value => '3867219', :country => 'DE').code(:zuzahlungsbefreit)
-> 
de.oddb> Drugs::Package.find_by_code(:type => 'cid', :value => '3867219', :country => 'DE').code(:zuzahlungsbefreit).value
-> undefined method `value' for nil:NilClass

Question

  • Why (How) is the pzn deleted?
  • in spite of the fact that it can be searched by 'find_by_code' method

Experiment (rpdf2txt/lib/rpdf2txt/parser.rb#extract_text)

    def extract_text(callback_handler = SimpleHandler.new)
      page_tree.each { |node|
        node.text(callback_handler)
        callback_handler.send_page
        break
      }
      callback_handler.send_eof
    end

Note

  • This makes rpdf2txt get only the first page

Run

  • jobs/import_gkv

Result

Tue May 24 11:24:00 2011: de.oddb.org ODDB::Import::Gkv#import
Imported     1 Zubef-Entries on 24.05.2011:
Visited      0 existing Zubef-Entries
Visited      1 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      0 Product(s) without a name (missing product name):

Note

  • This should be 'Visited 1 existing Zubef-Entries', but not 'Created'

Change all the zuzahlungsbefreit flags to be true

Idea

  • First, change all the zuzahlungsbefreit flags to be true
  • Sencond, import_gkv

Experiment (lib/oddb/util/server.rb)

      def set_all_zuzahlungsbefreit_true
        ODDB::Drugs::Package.all.each do |pack|
          if(code = pack.code(:zuzahlungsbefreit))
            code.value = true
          else
            code = ODDB::Util::Code.new(:zuzahlungsbefreit, true, 'DE')
            pack.add_code(code)
          end
          pack.save
        end
      end

Run

 masa@masa ~/ywesee/de.oddb.org $ bin/admin
 de.oddb> set_all_zuzahlungsbefreit_true

Result

  • Failed
  • All the zuzahlungsbefreit flag become false
  • why?

Experiment (test the save method from bin/admin)

1. default

2. save method on bin/admin

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

Console (bin/oddbd)

ODBA::Stub was unable to replace Hash#4285689 from ODDB::Drugs::Package:#137630
ODBA::Stub was unable to replace Array#4285690 from ODDB::Drugs::Package:#137630
ODBA::Stub was unable to replace Array#4285688 from ODDB::Drugs::Package:#137630

3. after the rebooting

Note

  • Package#save method does not work

Experiment (lib/oddb/util/server.rb)

      def test_save
        ODDB::Drugs::Package.all.each_with_index do |pack, i|
          if pack.code(:cid).value.to_s =~ /3867219/
            pack.code(:zuzahlungsbefreit).value = true
            pack.save
            return pack.name
          end
        end
      end

Run

masa@masa ~/ywesee/de.oddb.org $ bin/admin
de.oddb> test_save
-> Acc 200 Brausetabletten

Result

  • Failed
  • The data disappears after the rebooting oddbd

Experiment

1. bin/admin

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').code(:zuzahlungsbefreit).value 
-> true

2. on browser

  • 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:#4285697
ODBA::Stub was unable to replace Hash#4285702 from ODDB::Util::M10lDocument:#4285698
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. Reboot oddbd

Result

  • Success!!
  • The zuzahlungsbefreit flag is checked after the rebooting

Consideration

  • It seems that only the Package#save does not work
  • Something else is necessary to save the zuzahlungsbefreit flag

Refer to

view · edit · sidebar · attach · print · history
Page last modified on May 25, 2011, at 10:06 AM