See also http://dev.ywesee.com/Niklaus/20170116-oddb-org-ruby-240#search-sandoz. Failure is present on ch.oddb.org. Doubling RESULT_SIZE_LIMIT to 500 in src/util/oddb_app.rb. NOw it works. Preparing a commit for it. Pushed commit Updated RESULT_SIZE_LIMIT for search by company Sandoz
Must show why the ATC-dd can be different for different route of administration. I probable have to fix importing the ATC. No. bin/admin shows
ch.oddb> atc_class('N02BE01').ddds.collect{|ddd| ddd.last.administration_route} -> ["O", "P", "R"] ch.oddb> atc_class('N02BE01').ddds.values.last.dose -> 1 ch.oddb> atc_class('N02BE01').ddds.values[0].dose -> 1
Looking closer at the IKSNR 36830 sequence 01 Nitroglycerin Streuli
ch.oddb> registration('36830').packages.size -> 1 ch.oddb> registration('36830').packages.first.atc_class -> Glyceroltrinitrat ch.oddb> registration('36830').packages.first.atc_class.code -> C01DA02 ch.oddb> registration('36830').packages.first.ddd.dose.to_s -> 5 mg ch.oddb> registration('36830').packages.first.sequence.route_of_administration.class -> NilClass ch.oddb> registration('36830').packages.first.sequence.galenic_forms.size -> 1 ch.oddb> registration('36830').packages.first.sequence.galenic_forms.first.route_of_administration.class -> NilClass ch.oddb> registration('36830').packages.first.sequence.galenic_group.route_of_administration.class -> NilClass ch.oddb> atc_class('C01DA02').ddds.values.collect{|x| [x.administration_route, x.dose.to_s]} -> [["O", "5 mg"], ["SL", "2.5 mg"], ["TD", "5 mg"], ["oral aerosol", "2.5 mg"]] ch.oddb> atc_class('C01DA02').ddds.values.collect{|x| [x.administration_route, x.dose]} -> [["O", Quanty(5,'mg')], ["SL", Quanty(2.5,'mg')], ["TD", Quanty(5,'mg')], ["oral aerosol", Quanty(2.5,'mg')]] ] When displaying the calculation for the DDD we should also present the ATC-code and the route of administration. Maybe the route to the WHO would be nice, too. We see from the previous bin/admin statement that no route_of_administration is defined for the galenic_group and galenic_forms. Therefore we are unable to determine the correct form. I think in this case we should not calculate a DDD_price. Also we must look which ATC-Classes do not have a valid route_of_administration. When looking at the WHO page https://www.whocc.no/atc_ddd_index/?code=C01DA&showdescription=no we see that there codes of length 6 like 'C01DA54' which have no route_of_administration. Also I find a few wrong atc_code with [@ ch.oddb> atc_classes.values.find_all{|x| x.code.size > 7}.collect{|y|y.code}.size -> 18 ch.oddb> atc_classes.values.find_all{|x| x.code.size > 7}.collect{|y|y.code}[0..9] -> ["B02BD06 ", "J07A E01", "B05BA03,", "C09AA05.", "J05AE010", "L01XC21,", "L01XX52 ", "N05AX17 ", "P01AB01,", "R03AL07 "] ch.oddb> atc_classes.values.find_all{|x| x.code.size > 7}.collect{|y|y.code}[10..17] -> ["V03AE09 ", "A04AA055,", "J05AX69 1)", " H01CB02", "L04AX06 ", "N06DX01 ", "medical product", "C03CA01Mécanisme"] ch.oddb> atc_class('medical product').packages.size -> 9 ch.oddb> atc_classes.values.find_all{|x| x.code.size > 7}.collect{|y|y.packages.size}.uniq -> [0, 9]
While the value '"medical product' might make sense, the other are clearyl wrong.
ch.oddb> active_packages.find_all{|p| p.sequence.galenic_group != nil && p.sequence.galenic_group.route_of_administration ==nil}.size -> 4096 ch.oddb> active_packages.find_all{|p| p.sequence.galenic_group != nil && p.sequence.galenic_group.route_of_administration ==nil && p.atc_class && p.atc_class.ddds.size > 0}.size -> 1209
We have 1209 active packages where the galenic_group.route_of_administration is nil, but where we find DDDs with a administration_route.
Looking for examples
-> 65625 ch.oddb> active_packages.find{|p| p.sequence.galenic_group != nil && p.sequence.galenic_group.route_of_administration ==nil && p.atc_class && p.atc_class.ddds.size >0}.seqnr -> 01 ch.oddb> active_packages.find{|p| p.sequence.galenic_group != nil && p.sequence.galenic_group.route_of_administration ==nil && p.atc_class && p.atc_class.ddds.size >0}.galenic_group -> unbekannt ch.oddb> active_packages.find_all{|p| p.sequence.galenic_group != nil && p.sequence.galenic_group.to_s != 'unbekannt' && p.sequence.galenic_group.route_of_administration ==nil && p.atc_class && p.atc_class.ddds.size >0}.size -> 317 -> 42045 ch.oddb> active_packages.find_all{|p| p.sequence.galenic_group != nil && p.sequence.galenic_group.to_s != 'unbekannt' && p.sequence.galenic_group.route_of_administration ==nil && p.atc_class && p.atc_class.ddds.size >0}.first.seqnr -> 04 ch.oddb> active_packages.find_all{|p| p.sequence.galenic_group != nil && p.sequence.galenic_group.to_s != 'unbekannt' && p.sequence.galenic_group.route_of_administration ==nil && p.atc_class && p.atc_class.ddds.size >0}.first.composition_text -> simeticonum 41.2 mg, natrii cyclamas, saccharinum natricum, arom.: vanillinum et alia, conserv.: E 200, E 202, excipiens ad solutionem pro 1 ml, corresp. doses 2. ch.oddb> active_packages.find_all{|p| p.sequence.galenic_group != nil && p.sequence.galenic_group.to_s != 'unbekannt' && p.sequence.galenic_group.route_of_administration ==nil && p.atc_class && p.atc_class.ddds.size >0}.first.galenic_forms.first.route_of_administration.class -> NilClass ch.oddb> galenic_groups.values.find_all{|x| x.route_of_administration == nil}.size -> 16 ch.oddb> galenic_groups.values.find_all{|x| x.route_of_administration == nil}.collect{|x| x.to_s}[0..9] -> ["Kaugummi", "Dialyse", "Tropfen", "Klebstoff", "Tests", "Lösungsmittel", "Tupfer/Gaze", "Tinkturen/Desinfektion", "Seifen und Shampoos", "unbekannt"] ch.oddb> galenic_groups.values.find_all{|x| x.route_of_administration == nil}.collect{|x| x.to_s}[10..19] -> ["Augenmittel", "Inhalation", "Badezusatz", "Essbare", "Zubehör", "Nasenmittel"]
I think we must manually fix the ROA for these galenic_groups, wherever it makes sense (e.g. for Badezusatz, unbekannt this will be difficult).
But corresponds the DDD a chewing gum for C01DA02 to 5 mg O (aka oral, aka by the mouth) or 2.5 mg SL (aka Sub-Lingual, aka under the tongue)? And in the FI of IKNSR 36830 the galenic form is defined as "Kaukapsel" and not "Kaugummi".