view · edit · sidebar · attach · print · history

< Niklaus.20200603-ruby-271 | Index | Niklaus.20180228-gtin >>

20190528-upgrades-fixes

Summary

  • Must upgrade ch.oddb.org to use newer pg for yus 1.0.5
  • Fixes for various issues
  • Remsima schmeisst einen Error wenn man eingeloggt ist
  • Keep in Mind

Commits

Index

Fix various small issues

  • Fix handling wrong UTF-8 error when calling jobs/update_atc_dosing_link
  • Update rack gem to a new version

Must upgrade ch.oddb.org to use newer pg for yus 1.0.5

I have problems making calls from the oddb.org app to the currency.

Also upgrading the pg gem to 1.0.0 needs converting PGresult --> PG::Result in src/util/persistence.rb

Corrected various spec tests. Still having some errors

Remsima schmeisst einen Error wenn man eingeloggt ist

Therefore postponing it for the moment.

  2] pry(#<HtmlGrid::Value>)> puts error
       invalid byte sequence in US-ASCII
     => nil
  [3] pry(#<HtmlGrid::Value>)> value
     => "iQone Healthcare switzerland S\xC3\xA0rl"

Folgende bin/admin zeigt all 108 Probleme patinfos.values.find_all do |x| if x.company_name && x.company_name.match(/xüx/); false; end; rescue => error; cleaned = x.company_name.encode('utf-8', :invalid => :replace, :undef => :replace, :replace => '?'); puts "error #{error} in #{x.pointer} cleaned: <#{cleaned}"; true; end.size

Aber wir können hier den company_name nicht korrigieren. Fand folgende UTF-8 Fehler in Company.name companies.values.find_all do |x| if x.name && x.name.match(/xüx/); false; end; rescue => error; cleaned = x.name.encode('utf-8', :invalid => :replace, :undef => :replace, :replace => '?'); puts "error #{error} in ptr #{x.pointer} id #{x.odba_id} cleaned: <#{cleaned}";true; end.size

Versuch zu Updaten zeigt Fehler, dass das Feld name in company manchmal ein Hash. Umgang wie folgt:

companies.values.find_all do |x| if x.name && x.name.match(/xüx/); false; end; rescue => error; puts x.name; cleaned = x.name.encode('utf-8', :invalid => :replace, :undef => :replace, :replace => '?'); puts "error #{error} in ptr #{x.pointer} id #{x.odba_id} cleaned: <#{cleaned}"; x.name = clean; odba_store; rescue; true; end.size

Jetzt kann /de/gcc/show/reg/65373/seq/01/pack/001 ohne Probleme angezeigt werden, aber der Registartionsinhabe bleibt leer. Erstelle alle Indices neu und mache am nächsten Montag weiter.

Weitere Erkenntnisse sind:

  • In src/util/oddbapp.rb fehlt für create_company eine Zeile analog zu create_doctor
    doctor.pointer = ODDB::Persistence::Pointer.new([:doctor, doctor.oid])

Um dies nachzuholen, kann folgender bin/admin Befehl verwendet werden: companies.values.find_all { |x| !x.pointer}.each{ |company| company.pointer = ODDB::Persistence::Pointer.new([:company, company.oid]); company.odba_store}

  • In company.rb sollte in der Funktion search_terms der Name auf UTF-8 forciert werden wie folgt:
    def search_terms
      begin
        terms = @name.split(/[\s\-()]+/u).select { |str| str.size >= 3 }
      rescue => error
        # corrected = @name.encode('utf-8', :invalid => :replace, :undef => :replace, :replace => '?')
        corrected = @name.force_encoding(Encoding::UTF_8)
        $stdout.puts "search_terms: #{error} #{pointer} in #{@name} storing correctd #{corrected}"
        @name = corrected
        self.odba_store;
        terms = @name.split(/[\s\-()]+/u).select { |str| str.size >= 3 }
      end
      <...>

Danach würde folgender Aufruf in bin/admin das Problem lösen: companies.values.each{ |x| x.search_terms}

view · edit · sidebar · attach · print · history
Page last modified on May 29, 2019, at 07:51 PM