---
Zeno prefers to use rezept as part of the URL. Therefore reverting (more or less) the Refactoring rezept->prescription
Fixing some watir tests, as some specs fail. Watir spec show that setting the zsr_id in Rezept and in Preferences don't work exactly the same way!
Pushed commit Reworked and corrected some watir tests and Revert "Refactoring rezept->prescription"
Must correct appearance of prescription. Last remark must be followed by an empty line, then "Stempel, Unterschrift Arzt (auf Ausdruck)" (bold) atop of "Arzt Adresse.", followed by four empty lines. Resolved with commit Move Stempel before details of zsr/doctor.
Export of the drugs themself works now. Did try saving the comments via persistent_user_input but failed, because at the setup of the view these values are not know. Did not find any trigger/callback. After spending more than one hour decided to leave it like this at the moment
Content looks like
Niklaus Giger 14.10.55 m 25.08.14 7680495260320 Aspirin, 10 Tablette(n) 5.1 Bayer (Schweiz) AG 7680193950301 Marcoumar, 100 Tablette(n) 20.8 MEDA Pharma GmbH
Pushed commit https://github.com/ngiger/oddb.org/commit/c1213b0400080a52fd92de5f409937dfb94373c81Fix export_to_csv
We must try to speed up looking for interaction, as this seems to slow down creating prescriptions with 10 drugs very slow (approx 150 seconds), printing around 30 seconds.
Idea is to parse the CSV-file at startup and too keep everything in memory.
Parsing the CSV add something like 2 seconds to startup time.
After make the changes work all rspec tests pass as before, but speedup is quite good e.g. I have now
Generating a prescription with 10 took 68 seconds Printing a prescription with 10 drugs took 2 seconds
Time for running the watir-spec spec/rezept_and_instantsearch_spec.rb went down from over 9 minutes to less than 5'30" (first run) and about 4'30" for a second run.
With the actual implementation (not much work) each time oddbd is started it downloads the 5,4MB file from epha then moves it from /var/www/oddb.org/data/csv/interactions_de_utf8.csv
to /var/www/oddb.org/data/csv/interactions_de_utf8-latest.csv
. There is no way at the moment to reload the content without stopping oddbd. Would not be a big deal (1 to 2h) to add it again to an updater. All intersting work is now done under src/model/epha_interactions.rb, as we do not yet have coding guide style for this kind of stuff.
I think this shows that for a redesign of oddb.org we could probably assume that we can held the content totally in RAM (4 GB of RAM is cheap these days) which would have been out of question 10 years ago.
Before pushing these changes I want to complete first a import_daily and export_daily, as I might have not yet completly updated the import/export jobs. Cleaned up some test errors. Will continue tomorrow.
Import daily hangs without any output after
2014-08-25 17:19:29 +0200: update_fachinfo Konakion® MM iksnr 48112 store_fachinfo {}
Is using 100% of CPU of two CPU's.