Ran the jobs/ and got
ODDB::SwissmedicPlugin - Report 20.03.2015 Total time to update: 225.00 [m] Updated compositions: 23769 Updated agents: 12905 New agents: 7504
Running it a second time with
@ODDB::SwissmedicPlugin - Report 20.03.2015 Total time to update: 86.00 [m] Updated compositions: 20039 Updated agents: 15183 New agents: 5226
This is not exactly what I expected. In the second run the number of updated/new agents should be 0.
Must fix all remeining errors when running the unit tests for plugin/swissmedic. Unit tests fail because of parameters to @app.update. The following trick allows to see nicely the calls to flexmock objects. Eg.
$calls = [] @app.should_receive(:update).and_return {|pointer, args, what| $calls << "#{__LINE__} #{pointer} args #{args} what #{what}" } <.. more actions and tests> puts "#{__LINE__} update got called with \n #{$calls.join("\n")}"
Took me several hours to fix the unit-tests. Some problems were more precises definition of like "Dose.new(50.0, 'mg/g)
Now I must resolve the problems shown via
fluticasoni-17 propionas 100 µg, lactosum monohydricum q.s. ad pulverem pro 25 mg.
I think it was okay to fix some problems like
- :dose => %w'50 mg/g', + :dose => Dose.new(50.0, 'mg/g'),
It proves to be quite tricky to match this stuff with regular expressions. Adding unit tests in oddb2xml spec/calc_spec.rb
Looks like IKSNR 613
I) DTPa-IPV-Komponente (Suspension): toxoidum diphtheriae 30 U.I., toxoidum tetani 40 U.I., toxoidum pertussis 25 µg et haemagglutininum filamentosum 25 µg, virus poliomyelitis typus 1 inactivatum (D-Antigen) 40 U., virus poliomyelitis typus 2 inactivatum (D-Antigen) 8 U., virus poliomyelitis typus 3 inactivatum (D-Antigen) 32 U., aluminium ut aluminii hydroxidum hydricum ad adsorptionem, formaldehydum 10 µg, conserv.: phenoxyethanolum 2.5 µl, residui: neomycinum, streptomycinum, polymyxini B sulfas, medium199, aqua q.s. ad suspensionem pro 0.5 ml. II) Hib-Komponente (Lyophilisat): haemophilus influenzae Typ B polysaccharida T-conjugatum 10 µg, trometamolum, saccharum, pro praeparatione.
does not get parsed correctly.