---
This is similar problem Hannes Wyss resolved a long time ago with the galenic forms, etc in oddb.org. Therefore I must have a look at this code to see, whether I can copy parts of it. Parts of it can be found in method _update_galenic_form
of src/plugin/swissmedic.rb
. Galenic-groups and forms were carefully and manually created. A dump can be found under oddb.org as yaml files test/integration/data/galenic_forms.yaml
and test/integration/data/galenic_groups.yaml
Also we have under src/util/oddbapp.rb a method create_commercial_forms
. In total oddb.org knows of 37 galenic_groups and 885 galenidc_forms.
Looking at data/downloads/galenic_groups.yaml and data/downloads/galenic_forms.yaml I see that both files are identical and contain only the galenic_group. This has to be corrected. Also the yaml-files are not UTF-8. Found a way how we could possible convert our database to the new yaml in http://blog.rayapps.com/2013/03/11/7-things-that-can-go-wrong-with-ruby-19-string-encodings/#toc_12. But even for Ruby 2.x there is now a gem syck, which we could use. To convert the yaml files generated use a_string.gsub(/(\\x[0-9A-F]{2})+/){|m| eval "\"#{m}\""}.force_encoding("UTF-8")
Also Zeno started to summarize possible variations. We should probably use them (maybe adding a concrete example for each one) and start creating test cases for a new separate helper class.
Pushed commit Fix exporting galenic_forms
Pulled fix on thinpower and manually started jobs/export_galenic
Will generate a new file oddb_calc.xml containing GTIN, Name (german) and new entities.
But first generating some UnitTests for splitting everything out. In src/model/part.rb I find a definition for commercial_form which attr_reader :count, :multi, :measure, :addition, :scale # s.a. commercial_form in oddb.org/src/model/part.rb
This for my first test http://ch.oddb.org/de/gcc/drug/reg/54015/seq/01/pack/100 returns via bin/admin
ch.oddb> registration('54015').sequence('01').package('100').parts.first.count -> 1 ch.oddb> registration('54015').sequence('01').package('100').parts.first.multi -> 5 ch.oddb> registration('54015').sequence('01').package('100').parts.first.measure -> 100 ml ch.oddb> registration('54015').sequence('01').package('100').parts.first.addition -> 0 ch.oddb> registration('54015').sequence('01').package('100').parts.first.scale -> 1
With commit Builds oddb_calc.xml. Many missing format it parses the whole swissmedic_package.xlsx without any problem, while still producing many wrong formats.
Problem is that after a successfull login we loose the login status when going to a different zone. Why? Login seems to work, when we use a correct username/password, e.g. for desitin.
However we have the problem that the username and or stuff like "Willkommen beim gesponsorten Login von Desitin Pharma" does not appear. Must dig therefore in home views of each zone.
Okay. Found that in the files
we are missing a component [1,0,3] => :welcome,