Working on saving the changed information in the database via odba.
Remarking that in oddb2xml I never was able to identify in the regular expression things like chemical_substance and chemical_dose.
Also I think I must change the return values of update_compositions to return an array of compositions (correpsonding to one line in the columen Wirkstoffe), which is itself an array of agents.
Looking via bin/admin on how nutriflex (IKSRN 5594) is shown:
ch.oddb> registration('55594').compositions.first -> Infusionsemulsion: Glucosum Anhydricum 150g / 500ml, Natrii Dihydrogenophosphas Dihydricus 2.34g / 500ml, Zinci Acetas Dihydricus 6.58mg / 500ml ch.oddb> registration('55594').sequence('01').compositions.first.source -> I) Glucoselösung: glucosum anhydricum 150 g ut glucosum monohydricum, natrii dihydrogenophosphas dihydricus 2.34 g, zinci acetas dihydricus 6.58 mg, aqua ad iniectabilia q.s. ad solutionem pro 500 ml. ch.oddb> registration('55594').sequence('01').compositions[1].source -> II) Fettemulsion: sojae oleum 25 g, triglycerida saturata media 25 g, lecithinum ex ovo, glycerolum, natrii oleas, aqua ad iniectabilia q.s. ad emulsionem pro 250 ml. ch.oddb> registration('55594').sequence('01').compositions[2].source[0..150] -> III) Aminosäurenlösung: isoleucinum 2.82 g, leucinum 3.76 g, lysinum anhydricum 2.73 g ut lysinum monohydricum, methioninum 2.35 g, phenylalaninum 4.21 ch.oddb> registration('55594').compositions[2].active_agents[2] -> Lysinum Anhydricum 2.73g / 500ml ch.oddb> registration('55594').compositions[2].active_agents[2].chemical_substance -> Lysinum Monohydricum ch.oddb> registration('55594').compositions[2].active_agents[2].chemical_dose -> ch.oddb> registration('55594').compositions[2].active_agents[2].chemical_dose.class -> NilClass ch.oddb> registration('55594').sequence('01').compositions[2].substances.size -> 22 ch.oddb> registration('55594').sequence('01').compositions[2].active_agents.size -> 22 ch.oddb> registration('55594').sequence('01').compositions[2].active_agents.first -> Isoleucinum 2.82g / 500ml ch.oddb> registration('55594').sequence('01').compositions[2].substances.first -> Isoleucinum ch.oddb> registration('55594').sequence('01').compositions[2].active_agents.first.substance -> Isoleucinum ch.oddb> registration('55594').sequence('01').compositions[2].substances.first.oid -> 1943 ch.oddb> registration('55594').sequence('01').compositions[2].active_agents.first.substance.oid -> 1943 ch.oddb> registration('55594').sequence('01').compositions.first.label -> I
Okay. Now I now better how oddb2xml must be improved for Nutriflex registration('55594').sequence('01')
Another differences is, that oddb.org uses the Quanty class.
I must also avoid adding solutions, emulusions, etc as a substance. E.g http://ch.oddb.org/de/gcc/drug/reg/44625/seq/02 which has Solvens: aqua ad iniectabilia 5 ml.
. Here the galenic form of Lyophilisat und Lösungsmittel
is also different from the description in column C Präparatebezeichnung, where we have Trockenampullen + Solvens
Finding in bin/admin a registration with a chemical_dose
ch.oddb> $reg = registrations.values.find{ |x| x.compositions.first and x.compositions.first.active_agents and x.compositions.first.active_agents.first.chemical_dose != nil } -> #<ODDB::Registration:0x000000075cd558> ch.oddb> $reg.iksnr -> 55491 ch.oddb> $reg.compositions.first.active_agents.first.chemical_dose -> 12.5 mg ch.oddb> $reg.compositions.first.active_agents.first.chemical_substance -> Sennosidum B
Oddb2xml does not handle correctly quantities like min. 10^9 CFU
. Neither does oddb.org e.g. http://ch.oddb.org/de/gcc/drug/reg/00679/seq/02
Pushed commits to oddb2xml:
As Zeno liked the description for the labels I readded them via a separate field. See commit Readded description for label
Unittests für oddb.org plugin swissmedic seem to work better. But somehow the active_agents names does not appear in the log. Will test tomorrow once on oddb-ci2 with a real database.