view · edit · sidebar · attach · print · history

Index>

20140715-print-prescription-qrcode

Summary

  • Printing a prescription must display a QRcode
  • Prettify prescription, add interaction, don't loose comments after adding a new drug

Commits

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.

---

Printing a prescription must display a QRcode

Zeno wants to add a possibility to create a QR-code. E.g. display it on the right side, where a patient could scan it. Or add a button "Create QR-Code"

Having a look at gem rqrcode from http://whomwah.github.io/rqrcode/ which has over 250K installations. Adding a src/model/prescription.rb and test/test_model/prescription.rb to add the QRcode and its unit test.

Prettify prescription, add interaction, don't loose comments after adding a new drug

Fixed pretty printing with commit Prettify prescription print.. See

Creating watir test to show problem loosing comment after adding a new drug. This was easy (< 10 minutes). See commit Add watir test to check adding a drug to the prescription

But first I add the interactions to the print view to avoid having to correct this problem twice. Added interactions to the print. Had to introduce @session.persistent_user_input(:printing) to exchange this information between src/view/drugs/prescription.rb and src/view/interactions/interaction_chooser.rb

Also supressing header for interactions and comments if non present. This works now. See

Removed empty lines if now interactions or comments and uploaded a new screenshot.

Now attacking the proble why adding/deleting a drug removes comments, name, birthday, etc. Improved watir test to check for all fields.

I think I must modify set PrescriptionDrug.prescription_comment to use textarea.set_attribute 'onBlur'/'onFocus to save the value in a global variable of the Javascript. What I found out is that

  1. I cannot use an array to store the data but use somethine like this.comment_value_{0|1|2}
  2. After a reload the value of this variable has gone
  3. Same after adding a new drug

I must therefore find a javascript way to preserve values after reloading the window. With a cookie? Or maybe using dojox/storage. Did not work.

Trying https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage. Now I am ready to get value of the comments after deleting/adding a drug in the domReady-function, but I don't know yet how to set the value of the concerned field.

view · edit · sidebar · attach · print · history
Page last modified on July 15, 2014, at 06:46 PM