view · edit · sidebar · attach · print · history

Index>

20140321-add-interactions-to-prescriptions

Summary

  • Show automatically interactions in a prescription

Commits

Index

Keep in Mind
  • 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

---

Show automatically interactions in a prescription

We must show the interactions when creating a prescription.

I think it might be

  • a good idea not to show anything when the interactions of EPHA return "Keine bekannte Interaktion"
  • if no (known) interaction for all medicals we should display at the bottom an information "Checked for interactions using the database from epha.ch. Did not find any relevant interaction." Is this wording legally binding/critical?

Removing link to epha-interactions done in a separate commit. This was very easy.

Interactions begin to show up, but are all at the bottom and not after each medical.

Remarked that deleting does not work, as URL does not get updated! States like http://oddb-ci2.dyndns.org/de/gcc/ajax_delete_drug/state_id/70058044234220/ean/7680390530399 don't get interpreted correctly!

Interactions show up now correctly, but don't get correctly reset when changing prescription. Must rework handling drugs/ean13s between interaction_chooser and prescription.

I wonder whether the ajax-code is integrated correctly. If we want to follow the MVC paradigm, I would expect that calling http://oddb-ci2.dyndns.org/de/gcc/ajax_delete_drug/state_id/70045092509920/ean/7680390530474 will execute code under src/state and redisplay a correct URL.

Added in 10 minutes a Watir-Test to check for correct URL after deleting. Created in another 30 minutes a WatirTest for the prescription (adding two medis, deleting one). No test whether interactions appears or not. Remarked that a prescription can be created even when not logged in and maximum free tries have expired.

Replaced in interaction_chooser.rb link.onclick = "replace_element('drugs_#{model.barcode}', '#{url}');" by link.onclick = "window.top.location.replace('#{url}');" with url from home_interactions/ + all drugs. This works fine. The watir-tests for home_interactions pass now. But I had forgotten to test, that after deleting all items no medicament should show up, but there is an error, that it is still displayed, even when the URL does not show it.

No adding/deleting a medicament is reflected via the ean13 in the URL. But only the last ean is displayed inside the view. Must fix this tomorrow.

Problems to fix for tomorrow are:

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

See

view · edit · sidebar · attach · print · history
Page last modified on March 18, 2014, at 04:21 PM