view · edit · sidebar · attach · print · history

Index>

20171204-fi-parse-error

Summary

  • Fix parse-error fachinfo/reg/65447
  • Use refdata to import doctors
  • remove feedback from migel
  • Keep in Mind

Commits

Index

Fix parse-error fachinfo/reg/65447

When visiting https://ch.oddb.org/de/gcc/fachinfo/reg/65447 we get "Fachinformation zu Coop Vitality Grippe & Erkältung" in the title

bin/admin shows

ch.oddb> registration('65447').fachinfo.de.name
-> Coop Vitality Grippe & Erkältung

When visiting the changelog (eg. https://ch.oddb.org/de/gcc/show/fachinfo/65447/diff/02.12.2017) we find that the title is shown correctly as "70 Änderungen an Fachinfo Coop Vitality Grippe & Erkältung"

Looking at the logs and the xxtracted XML /var/www/oddb.org/data/details/65447_fi_de_Coop_Vitality_Grippe__amp__038__Erk_ltung_problem.xml.

I see that the XML-content in the file is already wrong <title>Coop Vitality Grippe &#038; Erkältung</title>

We must also fix the error when visiting https://ch.oddb.org/de/gcc/doctor/ean/7601000159199. This URL displays correctly now, but had the following error on december 1.

NoMethodError: undefined method `name' for "1.9":String
  (drbssl://localhost:9997) /usr/local/ruby-2.4.0/lib/ruby/2.4.0/drb/drb.rb:1624:in `perform_without_block'
  (drbssl://localhost:9997) /usr/local/ruby-2.4.0/lib/ruby/2.4.0/drb/drb.rb:1584:in `perform'
  (drbssl://localhost:9997) /usr/local/ruby-2.4.0/lib/ruby/2.4.0/drb/drb.rb:1668:in `block (2 levels) in main_loop'
  (drbssl://localhost:9997) /usr/local/ruby-2.4.0/lib/ruby/2.4.0/drb/drb.rb:1664:in `loop'
  (drbssl://localhost:9997) /usr/local/ruby-2.4.0/lib/ruby/2.4.0/drb/drb.rb:1664:in `block in main_loop'
  /var/www/oddb.org/src/model/user.rb:121:in `remote_call'
  /var/www/oddb.org/src/model/user.rb:116:in `name'
  /var/www/oddb.org/src/view/personal.rb:45:in `sponsor_or_logo'
  /var/www/oddb.org/src/view/personal.rb:70:in `personal_logo'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:83:in `create'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:284:in `compose_component'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:213:in `block in compose'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `each'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `compose'                                                                                                                              /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:72:in `init'
  /var/www/oddb.org/src/view/logohead.rb:46:in `init'                                                                                                                                                                             /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/component.rb:139:in `initialize'
  /var/www/oddb.org/src/view/publictemplate.rb:124:in `new'
  /var/www/oddb.org/src/view/publictemplate.rb:124:in `head'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:83:in `create'                                                                                                                                /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:284:in `compose_component'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:213:in `block in compose'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `each'                                                                                                                                 /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `compose'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:72:in `init'                                                                                                                                  /var/www/oddb.org/src/view/publictemplate.rb:68:in `init'
  /var/www/oddb.org/src/view/privatetemplate.rb:17:in `init'                                                                                                                                                                      /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/component.rb:139:in `initialize'
  /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.9/lib/sbsm/state.rb:241:in `new'                                                                                                                                              /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.9/lib/sbsm/state.rb:241:in `view'                                                                                                                                             /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.9/lib/sbsm/state.rb:174:in `to_html'                                                                                                                                          /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.9/lib/sbsm/session.rb:547:in `to_html'                                                                                                                                        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.9/lib/sbsm/session.rb:279:in `block in process_rack'                                                                                                                          /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.9/lib/sbsm/session.rb:209:in `synchronize'                                                                                                                                    /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.9/lib/sbsm/session.rb:209:in `process_rack'                                                                                                                                   /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.9/lib/sbsm/app.rb:127:in `call'                                                                                                                                               /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/lint.rb:49:in `_call'                                                                                                                                              /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/lint.rb:37:in `call'                                                                                                                                               /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/show_exceptions.rb:23:in `call'                                                                                                                                    /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/content_length.rb:15:in `call'                                                                                                                                     /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/static.rb:149:in `call'                                                                                                                                            /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/tempfile_reaper.rb:15:in `call'                                                                                                                                    /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/tempfile_reaper.rb:15:in `call'                                                                                                                                    /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/tempfile_reaper.rb:15:in `call'                                                                                                                                    /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/lint.rb:49:in `_call'                                                                                                                                              /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/lint.rb:37:in `call'                                                                                                                                               /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/show_exceptions.rb:23:in `call'                                                                                                                                    /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/chunked.rb:54:in `call'                                                                                                                                            /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/content_length.rb:15:in `call'                                                                                                                                     /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/handler/webrick.rb:86:in `service'                                                                                                                                 /usr/local/ruby-2.4.0/lib/ruby/2.4.0/webrick/httpserver.rb:140:in `service'                                                                                                                                                     /usr/local/ruby-2.4.0/lib/ruby/2.4.0/webrick/httpserver.rb:96:in `run'                                                                                                                                                          /usr/local/ruby-2.4.0/lib/ruby/2.4.0/webrick/server.rb:290:in `block in start_thread'                                                                                                                                           ODDB::View::LogoHead::COMPONENTS[[1, 0]] in create(personal_logo)                                                                                                                                                               ODDB::View::Doctors::RootDoctor::COMPONENTS[[0, 0]] in create(head)                                                                                                                                                           212.51.146.241 - - [01/Dec/2017 08:43:08] "GET https://ch.oddb.org/de/gcc/doctor/ean/7601000159199 HTTP/1.1" 500 148273 46.1762  "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.70 Saf

Use refdata to import doctors

For doctors we must only import the address if there is none or we cannot find the PLZ in one of the addresses of doctor.

Looking for the test data via bin/admin

-> ["Mäderstr. 13", "5400 Baden (Zürich)"]
ch.oddb> doctor_by_gln(7601000159199).addresses.last.lines_without_title
-> ["Winterthurerstr. 52", "8006 Zürich (Zürich)"]
ch.oddb> doctor_by_gln(7601000159199).addresses.size
-> 2

Remarked that we do only display pharmacies via the old methods, and not compyanies which have a business unit pharma. E.g

ch.oddb> (companies.values.find_all{|x| x.is_pharmacy?}.collect{|x| x.ean13} - hospitals.values.collect{|x| x.ean13}).first
-> 7601001401419

Adding also support for parsing the hospitals. Running the import. Removing too verbose output. Place a pry statement when getting the details failed. Corrected an error and running import again.

Once the importer has finished I must check de/gcc/search/zone/pharmacies/search_query/7601001017795 (create) and 7601002022842 (update) and check whether my comparision for addresses is good or whether it will create new addresses each time.

Reworked comparing two different addresss, to return a human readable diff.

Pushed commits

Skipping getting the details https://www.medreg.admin.ch.

remove feedback from migel

This should not be too difficult.

view · edit · sidebar · attach · print · history
Page last modified on December 04, 2017, at 05:34 PM