Yesterday commit made appear a '-' before the limitation text, in oddb.ci, e.g. sevikar.
Looks like @lookandfeel.enabled?(:prepend_limitation_text)
returns true, even if I enabled it only for Evidentia. But I forgot to specify as default_value false! Some problem with show_legend_by_default.
Fixed with commit Fix problem with '- L'
We have 254 packages where the complementary_type is set to :complementary. First one is IKSRN 26251 Isochinol. We set these values to nil
ch.oddb> $nr=1; packages.values.each{|x| $nr += 1 if x.complementary_type == :complementary}; $nr -> 254 ch.oddb> packages.values.find{|x| $nr += 1 if x.complementary_type == :complementary}.name_base -> Isochinol packages.values.each{|x| if x.complementary_type == :complementary; x.complementary_type = nil; x.odba_store; end} ch.oddb> $nr=1; packages.values.each{|x| $nr += 1 if x.complementary_type == :complementary}; $nr
When looking in packages.xlsx I find that swissmedic classified this now as "Synthetika human".
To remove all complementary registrations we must also update the companies which are flagged as :complementary. This can be done using the following bin/admin statements
companies.values.each{|x| next unless x.complementary_type == :complementary; update(x.pointer, {:complementary_type => nil}, :manual_update); x.odba_store } packages.values.each {|x| next unless x.complementary_type == :complementary; update(x.pointer, {:complementary_type => nil}; :manual_update); x.odba_store}
After theses changes Isadoe in http://oddb-ci2.dyndns.org/de/gcc/search/zone/drugs/search_query/iscador/search_type/st_oddb?#best_result is still using the wrong background color.
Removing now complementary from the legend, the validator and the lnf-values. Done. But still having the same problems.
I think it has a weird interaction with my commit about the limitation links. When searching for sevikar (where we find limitation text) no css-class containing complementary is found. However searching for iscador finds no product with a limitation and the first occurrence of the css class="list complementary">
is found at the beginning of the first display result row.
Okay looking longer at the code I found via bin/admin that the packages of iscador contain the :complentary as :complementary_type, too.
ch.oddb> registration('56832').name_base -> Iscador U c. Hg 0,01 mg ch.oddb> registration('56832').packages.values.collect{|x| x.sl_generic_type} -> [:complementary, :complementary, :complementary, :complementary, :complementary, :complementary, :complementary, :complementary] ch.oddb> registration('56832').packages.values.collect{|x| x.complementary_type} -> [:anthroposophy, :anthroposophy, :anthroposophy, :anthroposophy, :anthroposophy, :anthroposophy, :anthroposophy, :anthroposophy]
Therefore must cleanup these values too. No. I must fix the definition of sl_generic_type. sl_generic_type is an accessor of the package and used by various elements. Done with bin/admin
ch.oddb> registrations.values.each {|reg| reg.packages.values.each { |x| next unless x.sl_generic_type == :complementary; update(x.pointer, {:sl_generic_type => reg.complementary_type}, :manual_update); x.odba_store} } ch.oddb> registration('56832').packages.values.collect{|x| x.sl_generic_type} -> [:anthroposophy, :anthroposophy, :anthroposophy, :anthroposophy, :anthroposophy, :anthroposophy, :anthroposophy, :anthroposophy]
Now I still have the problem that the color looks right, but that for Iscador I still have many css fiels <td class="list anthroposophy"> </td>
Breaking at line 329 of src/view/drugs/resultlist.rb. With "Sevikar" I return after type next in pry for the line super(packages, offset)
. With "Iscador" however, it displays the whole page and never returns! There are 182 packages in the list be shown.
Looking whether older version of oddb.org have the same problem. E.g. 41094fe1110f1a5928f37d22e8b97f1a74da8920 from August 17, 2015. Yes. When displaying for iscador we have also man css_class "list anthroposophy", respectively "list anthroposophy bg" when using the evidentia-lnf.
On oddb-ci2 reloading the database and reverting to the same commit as on thinpower. To be sure, running the bin/admin commands again to fix companies, registrations and packages.
companies.values.each{|x| next unless x.complementary_type == :complementary; update(x.pointer, {:complementary_type => nil}, :manual_update); x.odba_store } registrations.values.each {|x| next unless x.complementary_type == :complementary; update(x.pointer, {:complementary_type => nil}, :manual_update); x.odba_store} registrations.values.each {|reg| reg.packages.values.each { |x| next unless x.sl_generic_type == :complementary; update(x.pointer, {:sl_generic_type => reg.complementary_type}, :manual_update); x.odba_store}}
Restarting oddbd and looking at iscador and sevikar. Now iscador seems to display correctly, but the HTML is not. For Gencydo the color and the HTML is correct
It is easy to find inconsistencies between the
ch.oddb> $x = registrations.values.find {|reg| reg.packages.values.find { |x| x.sl_generic_type != reg.complementary_type} } -> #<ODDB::Registration:0x00000008469ee0> ch.oddb> [$x.iksnr, $x.name_base, $x.complementary_type] -> ["63051", "Zeel comp.", :homeopathy] ch.oddb> $x.packages.values.collect{|x| x.sl_generic_type} -> [nil, nil] ch.oddb> registrations.values.find_all {|reg| reg.packages.values.find { |x| x.sl_generic_type != reg.complementary_type} }.size -> 2948 # verified that complementary_type in packages works. ch.oddb> registrations.values.find_all {|reg| reg.packages.values.find { |x| x.complementary_type != reg.complementary_type} }.size -> 0
Verifying that my code to remove :complementary, passes the following requirements:
Code does not yet work correctly. Does neither display SO nor SG in Category nor mouseover (Using price search for '3TC'). Why? Using and
instead of &&
fixed the problem.
Added a watir test for SL/SG/SO, too. Pushed the commits:
It looks as if the atc-codes are not completely consistent in our database. May be the swissmedic-follower job atc_less (class Atc_lessPlugin) does not correctly cleanup old items.
The following conditions must be met:
We must also check
We found this problem when looking at Kaletra where the atc_code J05AE06 (Lopinavir) was changed to J05AR10 (Lopinavir and Ritonavir). But we have also ATC-code J05AE03 Ritonavir, which is found, e.g in IKSNR 60090 Norvir. Therefore a price search via lopinavir should not return Kaletra.