view · edit · sidebar · attach · print · history

Index>

20171129-oddb-redesign

Summary

  • Fix some design details
  • i.ch.oddb.org has no top border on safari
  • Migel daemon should return correct dates
  • Use refdata to import doctors
  • Keep in Mind

Commits

Index

Fix some design details

Running the watir tests I remarked that after changing a preference, the user does not get redirected to home.

The watir specs have now (after correcting some errors with commit Fix watir tests for evidentia and download (ignore ssl error)) much less error, namely

rspec ./spec/download_spec.rb:55 # ch.oddb.org should be possible to download Zulassungsinhaber Desitin as admin user
rspec ./spec/evidentia_spec.rb:213 # ch.oddb.org should work all the time for Cellcept when evidenita LNF is not enabled
rspec ./spec/home_2_list_spec.rb:82 # ch.oddb.org admin in home_companies we should see all companies when logged in as admin
rspec ./spec/home_2_list_spec.rb:87 # ch.oddb.org admin in home_companies we should have the link active_companies if logged in as admin
rspec ./spec/paypal_spec.rb:113 # ch.oddb.org should show the poweruser dialog with the top left logo
rspec ./spec/preferences_spec.rb[1:1] # ch.oddb.org should save the color prefence as user 
rspec ./spec/preferences_spec.rb[1:2] # ch.oddb.org should save the color prefence as user ngiger@ywesee.com
rspec ./spec/preferences_spec.rb[1:3] # ch.oddb.org should save the color prefence as user info@desitin.ch
rspec ./spec/searchbar_spec.rb:271 # ch.oddb.org should show no drugs for Fortex via unwanted effects search
rspec ./spec/searchbar_spec.rb:325 # ch.oddb.org should set best_result when searching Rivoleve via search_type

The error in the preferences was not visible when running the watir test on october 31.

Will adapt watir tests. Will fix javascript errors cause by missing dojReady. Will remove ZSR_ID from preferences.

Without adapting the spec test preferences spec work again once I removed everything for ZSR and prescription.

Pushed commits

Must remove link "Neue Registration" and move "MediupdateXML" after "Stammdaten download" (separated). Done with commit Added searchbar in preferences and recentdrugs

i.ch.oddb.org has no top border on safari

The logo displayed with a nice border on chromium and firefox. Same on MacOSX 10.9.5 Maverick with Safari 9.1.3.

Migel daemon should return correct dates

Testing via bin/admin in /var/www/migel

migel> products.size
-> 30825
migel> products.first
-> ["1008386", #<ODBA::Stub:70226658163320#29743 @odba_class=Migel::Model::Product @odba_container=70226584088820#32287>]
migel> products.values.first
-> 3M TEGADERM Transparentverband 6x7cm
migel> products.values.first.stdate
-> 1999-12-28T00:00:00+00:00
migel> products.values.first.migel_code
-> 34.15.01.01.1
migel> products.values.first.factor
-> 100
migel> products.values.first.pzr
-> 
migel> products.values.first.qty
-> 1
migel> products.values.first.unit
-> Stück
migel> products.values.first.price
-> 130
migel> products.values.first.datetime
-> 2010-11-27T00:00:00+00:00

and via ch.oddb /bin/admin

ch.oddb> search_migel_products('34.15.01.01.1','de').class
-> DRb::DRbObject
ch.oddb> search_migel_products('34.15.01.01.1','de').first.qty
-> 1
ch.oddb> search_migel_products('34.15.01.01.1','de').first.unit
-> Stück
ch.oddb> search_migel_products('34.15.01.01.1','de').first.qty
-> 1
ch.oddb> search_migel_products('34.15.01.01.1','de').first.price
-> 130
ch.oddb> search_migel_products('34.15.01.01.1','de').first.date
-> -4712-01-01

Checking accessing via http://localhost:8012/de/gcc/search/zone/migel/search_query/Kr%C3%BCcke?, returns also a -4712 date. Adding a pry breakpoint in lib/migel/model/migel_id.rb.

Looks like that we really have bad dates in the migel database.

From: /var/www/migel/lib/migel/model/migelid.rb @ line 46 Migel::Model::Migelid#date:

    43: def date
    44:   puts "Returning #{@date}"
    45:   require 'pry'; binding.pry
 => 46:   @date
    47: end

[1] pry(#<Migel::Model::Migelid>)> @date.class
=> Date
[2] pry(#<Migel::Model::Migelid>)> @date
=> #<Date: -4712-01-01 ((0j,43200s,(57600000000000/1634363)n),+0s,2299161j)>
[3] pry(#<Migel::Model::Migelid>)> @date.year
=> -4712

Trying to run sudo -u apache bundle-240 exec ruby-240 jobs/update_migel_products_with_report results in

ttention: monkey-patching CSV::Cell
The PGconn, PGresult, and PGError constants are deprecated, and will be
removed as of version 1.0.

You should use PG::Connection, PG::Result, and PG::Error instead, respectively.

Called from /var/www/migel/vendor/sandoz/gems/ydbd-pg-0.5.3/lib/dbd/Pg.rb:157:in `new'
FEHLER:  Relation »object« existiert bereits
FEHLER:  Relation »prefetchable_index« existiert bereits
FEHLER:  Relation »extent_index« existiert bereits
FEHLER:  Relation »object_connection« existiert bereits
FEHLER:  Relation »target_id_index« existiert bereits
FEHLER:  Relation »collection« existiert bereits
FEHLER:  Relation »target_id_migel_model_group_code« existiert bereits
FEHLER:  Relation »target_id_migel_model_migelid_code« existiert bereits
FEHLER:  Relation »target_id_migel_model_group_name_de« existiert bereits
FEHLER:  Relation »target_id_migel_model_group_name_fr« existiert bereits
FEHLER:  Relation »target_id_migel_model_subgroup_code« existiert bereits
FEHLER:  Relation »target_id_migel_model_migelid_name_de« existiert bereits
FEHLER:  Relation »target_id_migel_model_migelid_name_fr« existiert bereits
FEHLER:  Relation »target_id_migel_model_group_migel_code« existiert bereits
FEHLER:  Relation »target_id_migel_model_product_ean_code« existiert bereits
FEHLER:  Relation »target_id_migel_model_subgroup_name_de« existiert bereits
FEHLER:  Relation »target_id_migel_model_subgroup_name_fr« existiert bereits
FEHLER:  Relation »target_id_migel_model_migelid_migel_code« existiert bereits
FEHLER:  Relation »target_id_migel_model_product_pharmacode« existiert bereits
FEHLER:  Relation »target_id_migel_model_subgroup_migel_code« existiert bereits
FEHLER:  Relation »target_id_migel_model_product_article_name_de« existiert bereits
FEHLER:  Relation »target_id_migel_model_product_article_name_fr« existiert bereits
FEHLER:  Relation »target_id_migel_model_product_company_name_de« existiert bereits
FEHLER:  Relation »target_id_migel_model_product_company_name_fr« existiert bereits
FEHLER:  Relation »target_id_migel_fulltext_index_de« existiert bereits
FEHLER:  Relation »target_id_migel_fulltext_index_fr« existiert bereits
FEHLER:  Relation »target_id_migel_product_fulltext_index_de« existiert bereits
FEHLER:  Relation »target_id_migel_product_fulltext_index_fr« existiert bereits
FEHLER:  Relation »object« existiert bereits
FEHLER:  Relation »prefetchable_index« existiert bereits
FEHLER:  Relation »extent_index« existiert bereits
FEHLER:  Relation »object_connection« existiert bereits
FEHLER:  Relation »target_id_index« existiert bereits
FEHLER:  Relation »collection« existiert bereits
FEHLER:  Relation »target_id_migel_model_group_code« existiert bereits
FEHLER:  Relation »target_id_migel_model_migelid_code« existiert bereits
FEHLER:  Relation »target_id_migel_model_group_name_de« existiert bereits
FEHLER:  Relation »target_id_migel_model_group_name_fr« existiert bereits
FEHLER:  Relation »target_id_migel_model_subgroup_code« existiert bereits
FEHLER:  Relation »target_id_migel_model_migelid_name_de« existiert bereits
FEHLER:  Relation »target_id_migel_model_migelid_name_fr« existiert bereits
FEHLER:  Relation »target_id_migel_model_group_migel_code« existiert bereits
FEHLER:  Relation »target_id_migel_model_product_ean_code« existiert bereits
FEHLER:  Relation »target_id_migel_model_subgroup_name_de« existiert bereits
FEHLER:  Relation »target_id_migel_model_subgroup_name_fr« existiert bereits
FEHLER:  Relation »target_id_migel_model_migelid_migel_code« existiert bereits
FEHLER:  Relation »target_id_migel_model_product_pharmacode« existiert bereits
FEHLER:  Relation »target_id_migel_model_subgroup_migel_code« existiert bereits
FEHLER:  Relation »target_id_migel_model_product_article_name_de« existiert bereits
FEHLER:  Relation »target_id_migel_model_product_article_name_fr« existiert bereits
FEHLER:  Relation »target_id_migel_model_product_company_name_de« existiert bereits
FEHLER:  Relation »target_id_migel_model_product_company_name_fr« existiert bereits
FEHLER:  Relation »target_id_migel_fulltext_index_de« existiert bereits
FEHLER:  Relation »target_id_migel_fulltext_index_fr« existiert bereits
FEHLER:  Relation »target_id_migel_product_fulltext_index_de« existiert bereits
FEHLER:  Relation »target_id_migel_product_fulltext_index_fr« existiert bereits
/var/www/migel/vendor/sandoz/gems/sbsm-1.5.2/lib/sbsm/app.rb:40:in `initialize': wrong number of arguments (given 1, expected 0) (ArgumentError)
        from /var/www/migel/lib/migel/util/job.rb:22:in `new'
        from /var/www/migel/lib/migel/util/job.rb:22:in `run'
        from jobs/update_migel_products_with_report:12:in `<module:Util>'
        from jobs/update_migel_products_with_report:11:in `<module:Migel>'
        from jobs/update_migel_products_with_report:10:in `<main>'

Updating sbsm/pg/dbd-pg to the same versions as used in oddb.org and ajusting lib/migel/util/jobs.rb to match changed expectations. Now the import continues, but will take about 2.5h to finish.

After running the migel the year is still 4712. Adding a pry debug statement in the importer.

The spreadsheet gem returns weird values eg. "35065.0" for 01.01.1996 and "42200.0" for 15.07.2015. Why?

Looks like writing the CSV file introduces errors!

CSV-generation was fixed by adding row[20] = row[20].strftime('m.%d') if row[20].to_s.to_i > 0. Parsing the date is now done with date = Date.parse(row.at(20)) instead of date = date_object(row.at(20))

The format of the XLS file has changed. Added a new xls file to the spec tests and added a new test for the date with commit Fix importer problem with new date format in xls

Running sudo -u apache bundle-240 exec ruby-240 jobs/update_migel takes much less time and fixes the problem, too.

Pulled the changes on thinpower, ran bundle-240 install, restarted the migeld. Now https://ch.oddb.org/de/gcc/search/zone/migel/search_query/Milchpumpe? displays the correct dates.

Runnning the import on thinpower highlighted a problem, when a nil date had to be imported. Which was fixed iwith commit Avoid importer problem if nil date

Pushed Fix spec tests

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.

view · edit · sidebar · attach · print · history
Page last modified on November 30, 2017, at 09:27 AM