After removing the unused spagyric_dose and spagyric_type from active_agent and a cleanup, things work better, but Price comparision for nutriflex now now shows several lines for a composition, where the composition consists of several parts. But it show the correct number of active agents and never a count of 0, except for cases like "OLIMEL" where this is correct, as it is not correctly parsed at this moment. Sett
For "Nutriflex Lipid special ohne Elektrolyte, Infusionsemulsion 1875ml", the first ("Infusionsemulsion: Glucosum Anhydricum 180g / 500ml"= and the third line ("Infusionsemulsion: 20 Wirkstoffe") look okay but the second one should read "Infusionsemulsion: 3 Wirkstoffe" instead of "Infusionsemulsion: 20 Wirkstoffe). Using bin/admin to check, whether the database is okay
ch.oddb> registration('56091').sequence('01').compositions[0] -> I: Infusionsemulsion: Glucosum Anhydricum 180g / 500ml, Acidum Citricum Anhydricum 0 ch.oddb> registration('56091').sequence('01').compositions[1] -> II: Infusionsemulsion: Sojae Oleum 25g / 250ml, Triglycerida Saturata Media 25g / 250ml, Lecithinum Ex Ovo 3g / 250ml, Glycerolum 0 , Natrii Oleas 0 ch.oddb> registration('56091').sequence('01').compositions[2].to_s[0..150] -> III: Infusionsemulsion: Isoleucinum 4.11g / 500ml, Leucinum 5.48g / 500ml, Lysinum Anhydricum 3.98g / 500ml, Methioninum 3.42g / 500ml, Phenylalaninum ch.oddb> registration('56091').sequence('01').compositions[0].active_agents.size -> 1 ch.oddb> registration('56091').sequence('01').compositions[1].active_agents.size -> 3 ch.oddb> registration('56091').sequence('01').compositions[2].active_agents.size -> 16
Okay. Lines 2 and 3 show wrong count, which should be 3 and 16 instead of 20 each. Found the error. Changed in part src/view/additional_information.rb
@lookandfeel.lookup(:active_agents, model.active_agents.size)
to part << @lookandfeel.lookup(:active_agents, comp.active_agents.size)
Forcing the conversion of @active_agents => @agents in compositions by running in bin/admin the statement (which tooks several minutes to complete)
ch.oddb> sequences.size -> 17284 $all = 0; $inactives=0; sequences.each{ |seq| seq.compositions.each{ |comp| $all += comp.active_agents.size; $inactives += comp.inactive_agents.size } }; [$all,$inactives]
While executing this statement and accessing oddb-ci2 via browser oddbd crashed.
When logged in links http://ch.oddb.org/de/gcc/drug/reg/65346/seq/03 still and http://oddb-ci2.dyndns.org/de/gcc/drug/reg/56091/seq/01 have an NoMethod error. http://oddb-ci2.dyndns.org/de/gcc/drug/reg/56091 and http://oddb-ci2.dyndns.org/de/gcc/drug/reg/56091/seq/01/pack/004 are okay. Same for http://oddb-ci2.dyndns.org/de/gcc/show/reg/56091/seq/01/pack/004 and http://oddb-ci2.dyndns.org/de/gcc/drug/reg/56091.
Looking at why I habe so much space when fields like excipiens are missing. No success.
Working on make unit tests for views and models to pass again.
Running cleanup script on fresh copy of Oddb databse. But must cleanup my 10 local commits before being able to push. Executing in bin/admin
ch.oddb> Time.now -> 2015-08-25 16:48:51 +0200 ch.oddb> $all = 0; $inactives=0; sequences.each{ |seq| seq.compositions.each{ |comp| $all += comp.active_agents.size; $inactives += comp.inactive_agents.size}} -> Time.now connection closed ch.oddb> Time.now -> druby://localhost:10000 - #<Errno::ECONNREFUSED: Connection refused - connect(2)>
The cleanup script resulted in the following oddbd-crash
/usr/local/lib/ruby/gems/1.9.1/gems/dbd-pg-0.3.9/lib/dbd/pg/exec.rb:11:in `exec': PG::UnableToSend from /usr/local/lib/ruby/gems/1.9.1/gems/dbd-pg-0.3.9/lib/dbd/pg/exec.rb:11:in `exec' from /usr/local/lib/ruby/gems/1.9.1/gems/dbd-pg-0.3.9/lib/dbd/pg/database.rb:310:in `_exec' from /usr/local/lib/ruby/gems/1.9.1/gems/dbd-pg-0.3.9/lib/dbd/pg/tuples.rb:36:in `block in column_info' from /usr/local/lib/ruby/gems/1.9.1/gems/dbd-pg-0.3.9/lib/dbd/pg/tuples.rb:25:in `upto' from /usr/local/lib/ruby/gems/1.9.1/gems/dbd-pg-0.3.9/lib/dbd/pg/tuples.rb:25:in `column_info' from /usr/local/lib/ruby/gems/1.9.1/gems/dbd-pg-0.3.9/lib/dbd/pg/statement.rb:83:in `column_info' from /usr/local/lib/ruby/gems/1.9.1/gems/dbi-0.4.5/lib/dbi/handles/statement.rb:171:in `column_types' from /usr/local/lib/ruby/gems/1.9.1/gems/dbi-0.4.5/lib/dbi/handles/statement.rb:27:in `initialize' from /usr/local/lib/ruby/gems/1.9.1/gems/dbi-0.4.5/lib/dbi/handles/database.rb:81:in `new' from /usr/local/lib/ruby/gems/1.9.1/gems/dbi-0.4.5/lib/dbi/handles/database.rb:81:in `execute' from /usr/local/lib/ruby/gems/1.9.1/gems/dbi-0.4.5/lib/dbi/handles/database.rb:128:in `select_all' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/connection_pool.rb:39:in `block in method_missing' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/connection_pool.rb:29:in `next_connection' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/connection_pool.rb:38:in `method_missing' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/storage.rb:508:in `restore_collection' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:236:in `fetch_collection' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:632:in `restore' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:318:in `block in fetch_or_restore' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:313:in `call' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:313:in `fetch_or_do' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:317:in `fetch_or_restore' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:65:in `block in bulk_restore' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:62:in `each' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:62:in `bulk_restore' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:56:in `bulk_fetch' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:260:in `fetch_collection' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:632:in `restore' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:318:in `block in fetch_or_restore' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:313:in `call' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:313:in `fetch_or_do' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:317:in `fetch_or_restore' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:640:in `restore_object' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:605:in `load_object' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:226:in `block in fetch' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:313:in `call' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:313:in `fetch_or_do' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:225:in `fetch' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:49:in `odba_receiver' from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing' from /var/www/oddb.org/src/util/oddbapp.rb:228:in `clean_invoices' from /var/www/oddb.org/src/util/oddbapp.rb:1554:in `clean' from /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/drbserver.rb:140:in `block (3 levels) in run_cleaner' from <internal:prelude>:10:in `synchronize' from /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/drbserver.rb:139:in `block (2 levels) in run_cleaner' from /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/drbserver.rb:137:in `loop' from /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/drbserver.rb:137:in `block in run_cleaner'
Creating new class InactiveAgent and pushing separation of active/inactive agents even further. Inactive agents to not contribute to the substance names of a sequence. Added cleanup_active_agents_in_compositions in sr/util/oddb_app.rb. Looks like my new cleanup-functions works better. But I am having now a problem when displaying http://oddb-ci2.dyndns.org/de/gcc/show/reg/56091/seq/02. Will continue tomorrow. The cleanup function took 35 minutes to complete.