Stuff todo:
What and how to add
FSME-Immun CC, Suspension zur intramuskulären Injektion
conserv)
Adding the following new accessors:
Looking via bin/admin into an example of substances.
ch.oddb> registration('00278').sequence('01').compositions.first.substances.first
-> Globulina Equina (Immunisé avec Tissu Intestinal Porcin)
ch.oddb> registration('00278').sequence('01').compositions.first.active_agents.first
-> Globulina Equina (Immunisé avec Tissu Intestinal Porcin) 8 mg
ch.oddb> registration('00278').sequence('01').compositions.first.active_agents.oid
-> undefined method `oid' for #<Array:0x007effb54024a8>
ch.oddb> registration('00278').sequence('01').compositions.first.active_agents.first.oid
-> 30656125
ch.oddb> registration('00278').sequence('01').active_agents.first.oid
-> 30656125
ch.oddb> registration('00278').sequence('01').substances.first.oid
-> 30542253
ch.oddb> registration('00278').sequence('01').substances.size
-> 1
ch.oddb> registration('00278').sequence('01').substances.first
-> Globulina Equina (Immunisé avec Tissu Intestinal Porcin)
ch.oddb> registration('00278').sequence('01').active_agents.first.dose
-> 8 mg
ch.oddb> registration('00278').sequence('01').substances.first.dose
-> undefined method `dose' for Globulina Equina (Immunisé avec Tissu Intestinal Porcin):ODDB::Substance
We see that in oddb.org a substance dose not have a dose, whereas the active_agent has one. But we are interested in the non-active substances, too. How do we resolve this semantic mis-match? I must think a little bit longer about this question. Therefore I will for the moment ignore all substances marked with IS_ACTIVE_AGENT=false and proceed to make the import and view for the label and more_info fields.
Looking for a substance which has several forms.
$res = sequences.find { |seq| seq.substances.first and seq.substances.first.chemical_forms.size > 1 }
-> Flexbumin 200 g/l, Infusionslösung
ch.oddb> $res.registration.iksnr
-> 00705
ch.oddb> $res.seqnr
-> 01
ch.oddb> $res.substances.first.chemical_forms.size
-> 2
ch.oddb> $res.substances.first.chemical_forms.first
-> Albuminum Humanum Macroaggregatum
ch.oddb> $res.substances.first.chemical_forms.last
-> Albuminum Humanum Colloidal
ch.oddb> $res.substances.first.chemical_forms.last.oid
-> 613
ch.oddb> $res.substances.first.chemical_forms.first.oid
-> 5487
ch.oddb> $res.substances.first.chemical_forms.first.class
-> ODDB::Substance
Reactivated my old branch (as of April) for wirkstoffe and pushed the commits
I have problems creating for the unit-test a cell with a correct Date format. Fixed it using a row from the existing row from workbook instead of mocking a RubyXL::Row.
Pushed commits Fix unittest for plugin/atc_less and Fix unit tests for swissmedic