view · edit · sidebar · attach · print · history

Index>

20140729-print-prescription-with-zsr

Summary

  • add ZSR for prescription and print info of medical doctor

Commits

on branch qrcode

Index

Keep in Mind
  • Fix dojo error http://www.sitepen.com/blog/2012/10/31/debugging-dojo-common-error-messages/#forgot-dom-ready
  • I removed on May-27 tests for ix_registrationss, fix_sequences, fix_compositions, fix_packages from test/test_plugin/swissmedic.rb,as he could not find any references for them in the src code. Did I erroneously remove stuff when cleaning up the swissmedic import earlier?
  • The whole test for older/newer Packages must be adapted to xlsx. One must compare the rows (e.g. by creating csv files) and do the same stuff in xlsx!
  • One unit-test for searchbar fails and might be a clue why searching does not work correctly.
  • Added two skip in test/test_plugin/rss.rb. Why does the mocking not work there anymore?
  • Make ext/swissindex/test/test_swissindex.rb and skipping tests in migel-gem pass.

---

fix failing watir tests

Must fix the three failing watir test. Sometime I get only one error and


  1) ch.oddb.org should not loose existing comment after adding a new prescription
     Failure/Error: @browser.text_field(:name => "prescription_comment_#{idx}").value.should == genComment(Four_Medis[idx])
       expected: "Kommentar 20140730080858 Losartan"
            got: "Kommentar 20140730080842 Losartan" (using ==)
     # ./spec/rezept_and_instantsearch_spec.rb:115:in `block in checkGeneralInfo'
     # ./spec/rezept_and_instantsearch_spec.rb:113:in `upto'
     # ./spec/rezept_and_instantsearch_spec.rb:113:in `checkGeneralInfo'
     # ./spec/rezept_and_instantsearch_spec.rb:201:in `block (2 levels) in <top (required)>'

and sometimes I get 3 errors like

  1) ch.oddb.org should be possible to print a presciption
     Failure/Error: inhalt.index(what).class.should_not == NilClass
       expected not: == NilClass
                got:    NilClass
       Diff:
     # ./spec/rezept_and_instantsearch_spec.rb:95:in `block in checkGeneralInfo'
     # ./spec/rezept_and_instantsearch_spec.rb:89:in `each'
     # ./spec/rezept_and_instantsearch_spec.rb:89:in `checkGeneralInfo'
     # ./spec/rezept_and_instantsearch_spec.rb:128:in `block (2 levels) in <top (required)>'

  2) ch.oddb.org should not contain remarks or interaction header only when present
     Failure/Error: inhalt.index(what).class.should_not == NilClass
       expected not: == NilClass
                got:    NilClass
       Diff:
     # ./spec/rezept_and_instantsearch_spec.rb:95:in `block in checkGeneralInfo'
     # ./spec/rezept_and_instantsearch_spec.rb:89:in `each'
     # ./spec/rezept_and_instantsearch_spec.rb:89:in `checkGeneralInfo'
     # ./spec/rezept_and_instantsearch_spec.rb:156:in `block (2 levels) in <top (required)>'

  3) ch.oddb.org should not loose existing comment after adding a new prescription
     Failure/Error: @browser.text_field(:name => 'prescription_first_name').value.should == FirstName
       expected: "Max"
            got: "" (using ==)
     # ./spec/rezept_and_instantsearch_spec.rb:108:in `checkGeneralInfo'
     # ./spec/rezept_and_instantsearch_spec.rb:201:in `block (2 levels) in <top (required)>'

Also found that printing the QRcode fails, when no first_name, etc is given. Also found a way (concating all files into a test.js) to really run the javascript tests.

Now I suddenly get the error "Error: code length overflow. (1740>1056)" (reported in the javascript console). Looked at http://www.qrcode.com/en/about/version.html. This happened when I tried to add two drugs. Must look whether I can change the mode of the generated QRcode.

Also found that we do not check in which format the birthday is entered. E.g you may enter 31.12.2000 or 2000.31.12 or 2000/31/12.

Adding a watir tests for up to 9 medicaments. Changed code to show an error like Error generating QRCode: Error: code length overflow. (1740>1056) if qrcode has problems. But the bug seems not be directly related to the number of items, as it is not triggered when printing two drugs with comments.

The watir test with 10 drugs shows that we need about 2,5 minutes to find all drugs and their interactions. I think this a bit too long and during this time it loads one CPU core at almost 100%.

Pushed commit Allow empty values in info fiels when printing prescription. Add tests for 10 drugs.

I get bizarre errors as loading the third drugs does not work and a URL like http://oddb-ci2.dyndns.org/de/gcc/rezept/ean/7680576730049,7680317061142? does only display an empty page where the page source is also empty!

Found in /var/log/apache2/error.log the entry

ODDB-Client-Error: method `to_str' called on hidden T_HASH object (0x000000086a88c8 flags=0x8 klass=0x0)                         
NotImplementedError                                                                                                             
(druby://localhost:10000) /var/www/oddb.org/src/model/part.rb:206:in `join'                                                      
(druby://localhost:10000) /var/www/oddb.org/src/model/part.rb:206:in `size'                                                      
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing'               
(druby://localhost:10000) /var/www/oddb.org/src/model/package.rb:433:in `block in size'                                          
(druby://localhost:10000) /var/www/oddb.org/src/model/package.rb:433:in `collect'                                                
(druby://localhost:10000) /var/www/oddb.org/src/model/package.rb:433:in `size'                                                  
(druby://localhost:10000) /var/www/oddb.org/src/model/package.rb:410:in `name_with_size'                                         
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing'                
(druby://localhost:10000) /var/www/oddb.org/src/view/drugs/prescription.rb:95:in `drug'                                         
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:68:in `create'            
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:286:in `compose_component'
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:211:in `block in compose' 
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `each'             
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `compose'          
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:57:in `init'              
(druby://localhost:10000) /var/www/oddb.org/src/view/drugs/prescription.rb:82:in `init'                                          
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/component.rb:139:in `initialize'       
(druby://localhost:10000) /var/www/oddb.org/src/view/drugs/prescription.rb:183:in `new'                                          
(druby://localhost:10000) /var/www/oddb.org/src/view/drugs/prescription.rb:183:in `drug'                                         
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:68:in `create'            
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:286:in `compose_component'
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:211:in `block in compose' 
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `each'             
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `compose'          
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:57:in `init'              
(druby://localhost:10000) /var/www/oddb.org/src/view/drugs/prescription.rb:167:in `init'                                         
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/component.rb:139:in `initialize'       
(druby://localhost:10000) /var/www/oddb.org/src/view/drugs/prescription.rb:200:in `new'                                          
(druby://localhost:10000) /var/www/oddb.org/src/view/drugs/prescription.rb:200:in `block in init'                                
(druby://localhost:10000) /var/www/oddb.org/src/view/drugs/prescription.rb:199:in `each'                                         
(druby://localhost:10000) /var/www/oddb.org/src/view/drugs/prescription.rb:199:in `init'                                         
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/component.rb:139:in `initialize'       
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:61:in `new'               
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:61:in `create'            
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:286:in `compose_component'
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:211:in `block in compose' 
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `each'             
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `compose'          
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:57:in `init'              
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/form.rb:82:in `init'                   
(druby://localhost:10000) /var/www/oddb.org/src/view/drugs/prescription.rb:348:in `init'                                         
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/component.rb:139:in `initialize'       
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:61:in `new'               
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:61:in `create'            
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:286:in `compose_component'
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:211:in `block in compose' 
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `each'             
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `compose'          
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:57:in `init'              
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/component.rb:139:in `initialize'       
(druby://localhost:10000) /var/www/oddb.org/src/view/publictemplate.rb:63:in `new'                                               
(druby://localhost:10000) /var/www/oddb.org/src/view/publictemplate.rb:63:in `content'                                           
(druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:68:in `create'            

I can reproduce this error in bin/admin with

ch.oddb> package_by_ean13('7680317061142').name_with_size
-> (druby://localhost:10000) /var/www/oddb.org/src/util/oddbapp.rb:1594:in `instance_eval': method `to_str' called on hidden T_HASH object (0x000000086a88c8 flags=0x8 klass=0x0) (NotImplementedError)
        from (druby://localhost:10000) /var/www/oddb.org/src/model/part.rb:206:in `size'
        from (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing'
        from (druby://localhost:10000) /var/www/oddb.org/src/model/package.rb:433:in `block in size'
        from (druby://localhost:10000) /var/www/oddb.org/src/model/package.rb:433:in `collect'
        from (druby://localhost:10000) /var/www/oddb.org/src/model/package.rb:433:in `size'
        from (druby://localhost:10000) /var/www/oddb.org/src/model/package.rb:410:in `name_with_size'
        from (druby://localhost:10000) /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing'
        from (druby://localhost:10000) (eval):1:in `block (2 levels) in _admin'
        from (druby://localhost:10000) /var/www/oddb.org/src/util/oddbapp.rb:1594:in `instance_eval'
        from (druby://localhost:10000) /var/www/oddb.org/src/util/oddbapp.rb:1594:in `block (2 levels) in _admin'
        from (druby://localhost:10000) /var/www/oddb.org/src/util/failsafe.rb:10:in `call'
        from (druby://localhost:10000) /var/www/oddb.org/src/util/failsafe.rb:10:in `failsafe'
        from (druby://localhost:10000) /var/www/oddb.org/src/util/oddbapp.rb:1593:in `block in _admin'
        from bin/admin:97:in `<main>'

I do not get this error on thinpower. Therefore reimporting the database of yesterday.

Comparing some stats of the libraries which we could use:

I will try jquery-qrcode as rescode and bwip-js seem to me an overkill, need more space and I would have to resolve first the issue how to load all the code on the client side in parallel to dojo.

Added a comment to the issue 26 "code length overflow" on data > 191 character https://github.com/davidshimjs/qrcodejs/issues/26. Decided with Zeno to try to debug this bug after adding the ZSR code to the prescription. Tried to debug this problem, but did not yet see the error.

add ZSR for prescription and print info of medical doctor

Added as ZSR TextInput field and some JavaScript code to call soap using the jquery 2.1.1 from http://jquery.com/download/. But I get the following error when posting xml XMLHttpRequest cannot load https://www.pharmedsolutions.ch/ZSRService/wsdl. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://oddb-ci2.dyndns.org' is therefore not allowed access.

Will ask Philipp tomorrow.

view · edit · sidebar · attach · print · history
Page last modified on July 30, 2014, at 05:32 PM