could not connect to www.swissreg.ch: #<Net::HTTPInternalServerError:0x007f8a7d69bb58>
---
Yesterday came to the conclusion, that only the following convention will work for pseudo-fi without a major refactoring
To remove all sinovial we can use the following bin/admin script
@all_sinovial = registrations.find_all{|k,v| v.name_base.match(/sinovial/i) if v.name_base } @all_ids = @all_sinovial.collect{|item| item[0]} @all_ids.each{|reg_id| reg = registration(reg_id); next unless reg.fachinfo; delete reg.fachinfo.pointer; update reg.pointer, :fachinfo => nil } @all_ids.each{|reg_id| registration(reg_id).each_sequence{ |seq| seq.each_package{ | pack| seq.delete_package(pack.ikscd)} } } @all_ids.each{|reg_id| registration(reg_id).each_sequence{ |seq| registration(reg_id).delete_sequence(seq.seqnr)} } @all_ids.each{|reg_id| delete registration(reg_id).pointer if registration(reg_id)}
Now the import works, kind of. Searching by name does not work. Accessing via http://oddb-ci2.dyndns.org/de/gcc/search/zone/drugs/search_query/1229109223/search_type/st_registration#best_result results in
error in SBSM::Session#to_html: /de/gcc/search/zone/drugs/search_query/1229109223/search_type/st_registration NoMethodError undefined method `gsub' for nil:NilClass /var/www/oddb.org/src/view/drugs/package.rb:234:in `name' /usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:68:in `create' /usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:286:in `compose_component' /usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:211:in `block in compose' /usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `each' /usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `compose' /usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:57:in `init' /var/www/oddb.org/src/view/drugs/package.rb:170:in `init' /usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/component.rb:139:in `initialize' /usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:61:in `new' /usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:61:in `create' /usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:286:in `compose_component' /usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:211:in `block in compose' /usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `each' /usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `compose' /usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:57:in `init' /var/www/oddb.org/src/view/drugs/package.rb:301:in `init' /usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/component.rb:139:in `initialize' /var/www/oddb.org/src/view/publictemplate.rb:63:in `new' /var/www/oddb.org/src/view/publictemplate.rb:63:in `content' /usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:68:in `create' /usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:286:in `compose_component' /usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:211:in `block in compose' /usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `each' /usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `compose' /usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:57:in `init' /var/www/oddb.org/src/view/publictemplate.rb:60:in `init' /var/www/oddb.org/src/view/privatetemplate.rb:17:in `init' /usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/component.rb:139:in `initialize' /usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/state.rb:245:in `new' /usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/state.rb:245:in `view' /usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/state.rb:181:in `to_html' /usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/session.rb:447:in `to_html' /usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/session.rb:173:in `block in drb_process' <internal:prelude>:10:in `synchronize' /usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/session.rb:171:in `drb_process' /usr/lib64/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block' /usr/lib64/ruby/1.9.1/drb/drb.rb:1508:in `perform' /usr/lib64/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop' /usr/lib64/ruby/1.9.1/drb/drb.rb:1582:in `loop' /usr/lib64/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop' ODDB::View::Drugs::PackageInnerComposite::COMPONENTS[[0, 1]] in create(name) ODDB::View::Drugs::PackageComposite::COMPONENTS[[0, 1]] in create(ODDB::View::Drugs::PackageInnerComposite) ODDB::View::Drugs::Package::COMPONENTS[[0, 3]] in create(content) error in SBSM::Session#http_headers: /de/gcc/search/zone/drugs/search_query/1229109223/search_type/st_registration NoMethodError undefined method `gsub' for nil:NilClass /var/www/oddb.org/src/view/drugs/package.rb:234:in `name' /usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:68:in `create' /usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:286:in `compose_component' /usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:211:in `block in compose' /usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `each'
Do we run now into problems because we access a package instead of registration? Or what? Checking a few things in bin/admin
@all_sinovial = registrations.find_all{|k,v| v.name_base.match(/sinovial/i) if v.name_base } -> Array @all_sinovial.size -> 5 @all_sinovial[4][1].name_base -> SinovialŪ 0,8% @all_sinovial[4][1].packages.first.name -> @all_sinovial[4][1].packages.first.name.class -> String @all_sinovial[3][1].sequences.first[1].search_terms -> ["SinovialŪ", "Mini", "SinovialŪ Mini 08"] @all_sinovial[4][1].packages.first.barcode -> 7612291092249 package_by_ean13('7612291092249').pointer.class -> NilClass
The search terms seem okay. But something went wrong when updating the packages.
After calling fix_pointer on the sequence and not the package. Most stuff work. I still have an old sequence '00' for each of the registration. Hope that removing them via bin/admin and running the import againg will help.
@all_sinovial = registrations.find_all{|k,v| v.name_base.match(/sinovial/i) if v.name_base } @all_ids = @all_sinovial.collect{|item| item[0]} @all_ids.each{|reg_id| registration(reg_id).delete_sequence('00')}
Worked fine, as it seems. After reimporting I did not find any sequence('00') for sinovial! Cleaning up code for submitting.
Pushed commits
Running delete script on thinpower. After first import had to run the commands to remove the old '00' sequence, too.
Now on oddb-ci2 I see correctly for Sinovial Mini "Fertigspritze ā 1ml", but not on thinpower. Situation on oddb-ci2 is: