view · edit · sidebar · attach · print · history

Index>

20140319-add-interactions-to-prescriptions-2

Summary

  • Show automatically interactions in a prescription

Commits

Index

Keep in Mind
  • Fix dojo error http://www.sitepen.com/blog/2012/10/31/debugging-dojo-common-error-messages/#forgot-dom-ready
  • Search nach Anwendung (indications), z.B. Konjunktivitis, does not report all occurrences in the section "Anwendung" of Fachinfo. Probably index is corrupted or not set up correctly.
  • Error: Patents with could not connect to www.swissreg.ch: #<Net::HTTPInternalServerError:0x007f8a7d69bb58>
  • vagrant-oddb.org: cleanup installation for yus with ruby 1.8, logrotate.conf and local vhosts for tests

---

Test whether an upgrade of dojo fixes the rezept on chrome

First commite an improved test Added test with 4 medicament in rezept.

On oddb-ci2 we installed dojo-1.7.2. Same as on thinpower. The newest dojo version is 1.9.3 (Thu Feb 20 11:33:50 2014 -0800). (As seen on http://dojotoolkit.org/download/). A version 1.7.5 (of Fri Jun 14 18:18:44 2013 -0700) is available.

Dojo-Version on ch.oddb.org verified by openening a java script console with the following dialog

console.log(window.location);
Location {replace: function, assign: function, ancestorOrigins: DOMStringList, origin: "http://ch.oddb.org", hash: ""…}
 VM648:2
undefined
console.log(dojo.version.toString());
1.7.2 (27913) 

Installed dojo 1.7.5, stopped all services, stopped apache and brought the system up again. Now I get the following output

console.log(window.location);
Location {replace: function, assign: function, ancestorOrigins: DOMStringList, origin: "http://oddb-ci2.dyndns.org", hash: ""…}
 VM421:2
console.log(dojo.version.toString());
1.7.5 (4) 

With dojo 1.7.5 I get the following results with

  1. chromium
    1. rspec ./spec/interactions_spec.rb:107 # ch.oddb.org should show be able to use the delete_all
    2. rspec ./spec/interactions_spec.rb:128 # ch.oddb.org should show the correct url after deleting a medicament
    3. rspec ./spec/interactions_spec.rb:169 # ch.oddb.org should show interactions in the correct order just below the triggering drug
    4. rspec ./spec/interactions_spec.rb:216 # ch.oddb.org should show interactions for epha example medicaments added manually
    5. rspec ./spec/medical_product_spec.rb:26 # ch.oddb.org should work as show/reg for sinovial
    6. rspec ./spec/rezept_and_instantsearch_spec.rb:47 # ch.oddb.org should with four medicaments
    7. rspec ./spec/rezept_and_instantsearch_spec.rb:74 # ch.oddb.org should show the correct url after deleting a medicament
    8. rspec ./spec/smoketest_spec.rb:60 # ch.oddb.org should trigger the limitation after maximal 5 queries
  2. firefox has the following errors:
    1. rspec ./spec/medical_product_spec.rb:26 # ch.oddb.org should work as show/reg for sinovial

Now the same stuff with 1.9.3.

console.log(dojo.version.toString());
1.9.3 (fd52c96)
console.log(window.location);
Location {replace: function, assign: function, ancestorOrigins: DOMStringList, origin: "http://oddb-ci2.dyndns.org", hash: ""…}
  • It was VERY important to verify in the JavaScript console the Dojo-Version as in Version 1.7.5 as well as for 1.9.3 I had to

restart various stuff twice, till the version showed up!

With dojo 1.9.3 I get the following results with

  1. chromium
    1. rspec ./spec/interactions_spec.rb:107 # ch.oddb.org should show be able to use the delete_all
    2. rspec ./spec/interactions_spec.rb:128 # ch.oddb.org should show the correct url after deleting a medicament
    3. rspec ./spec/interactions_spec.rb:169 # ch.oddb.org should show interactions in the correct order just below the triggering drug
    4. rspec ./spec/interactions_spec.rb:216 # ch.oddb.org should show interactions for epha example medicaments added manually
    5. rspec ./spec/medical_product_spec.rb:26 # ch.oddb.org should work as show/reg for sinovial
    6. rspec ./spec/rezept_and_instantsearch_spec.rb:47 # ch.oddb.org should with four medicaments
    7. rspec ./spec/rezept_and_instantsearch_spec.rb:74 # ch.oddb.org should show the correct url after deleting a medicament
    8. rspec ./spec/rezept_and_instantsearch_spec.rb:104 # ch.oddb.org should have a working instant search
    9. rspec ./spec/smoketest_spec.rb:60 # ch.oddb.org should trigger the limitation after maximal 5 queries
  2. firefox
    1. rspec ./spec/medical_product_spec.rb:26 # ch.oddb.org should work as show/reg for sinovial

There is no change between the results with 1.7.5 and 1.9.3. They perform both like 1.7.2.

Show automatically interactions in a prescription

Problems to fix for today are:

  • only the last medicament is displayed inside the view
  • header of interaction must be hidden

Header of interaction is no longer visible.

All medicaments get displayed.

But I have now the problem that I always see all interaction.

Fixed. Looks good now.

Now the rezept_spec works too. Adding another watir test for the instant search. Done.

The watirtests have sometimes error, because of a timeout when reading http://pagead2.googlesyndication.com/pagead/show_ads.js or

     Watir::Exception::UnknownObjectException:
       unable to locate element, using {:name=>"search", :tag_name=>"button"}
     # ./spec/smoketest_spec.rb:69:in `block (3 levels) in <top (required)>'

Niklaus remarked a day later, that http://www.sitepen.com/blog/2012/10/31/debugging-dojo-common-error-messages/#forgot-dom-ready might give you a clue.

Pushed commits

Problem is that I ran my tests only with firefox where as on chromium somehow the URL got extended by a '?', which made them fail.

Had to install the newest version of the chromedriver to make tests running with chromium. Now I am even able to run the tests for chromium and firefox in parallel on my desktop. Tests take about 3 minutes (+time for initial loading of oddb-ci2) to complete.

There are still the following regressions with the chromium.

  • rspec ./spec/interactions_spec.rb:105 # ch.oddb.org should show be able to use the delete_all
  • rspec ./spec/interactions_spec.rb:126 # ch.oddb.org should show the correct url after deleting a medicament
  • rspec ./spec/interactions_spec.rb:167 # ch.oddb.org should show interactions in the correct order just below the triggering drug
  • rspec ./spec/interactions_spec.rb:214 # ch.oddb.org should show interactions for epha example medicaments added manually

Trying to fix them, too.

When looking at the output of bin/oddbd I see some curious output

error in SBSM::Session#process: /de/gcc/ajax_add_drug/state_id/70235241260880/ean/7680495260320
NoMethodError
undefined method `request_path' for #<Hash:0x007fc1a5593648>
/usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/session.rb:365:in `process'
/var/www/oddb.org/src/util/session.rb:125:in `process'
/usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/session.rb:172: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'
InteractionChooser ean13  req "/de/gcc/home_interactions/7680576730049?"
error in SBSM::Session#process: /de/gcc/ajax_add_drug/state_id/70234794930000/ean/7680390530474
NoMethodError
undefined method `request_path' for #<Hash:0x007fc1a5593648>
/usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/session.rb:365:in `process'
/var/www/oddb.org/src/util/session.rb:125:in `process'
/usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/session.rb:172: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'
InteractionChooser ean13  req "/de/gcc/home_interactions/7680576730049?"

This error show up, when adding a second medicament to the interaction. It does not show up, when doing the same stuff with firefox.

When looking at the AJAX-console output for the browser I see the error msg

Uncaught TypeError: Cannot call method 'focus' of null;

There I find the code

function(ready, parser) {ready(function() {document.getElementById('interaction_searchbar').focus();

This error has gone with my patching src/view/interaction_chooser.rb. But I still see in the console the error Uncaught TypeError: Cannot read property 'has' of undefined inside the dojo.js. I suppose that chrome is running a newer version of ajax and our version of the dojo-toolkit does produce this error.

I will push the current state, as it is better for Rezept and at least using the direct URL like example work.

Pushed:

Pushed the changes to thinpower. Restarted ch.oddb and when doing some manual tests with chromium, found out that I could add two medicals to a rezept, but not three.

Pushed commit Remove unnessary interaction heading. Fix alignment of comment.

view · edit · sidebar · attach · print · history
Page last modified on March 20, 2014, at 08:23 AM