view · edit · sidebar · attach · print · history

Index>

20150708-update-compositions

Summary

  • Adapt oddb.org to new fields for compositions
  • Fix unit tests for plugin/swissmedic

Commits

Index

Keep in Mind for work to do
  • Fix dojo error http://www.sitepen.com/blog/2012/10/31/debugging-dojo-common-error-messages/#forgot-dom-ready
  • I removed on May-27 tests for ix_registrationss, fix_sequences, fix_compositions, fix_packages from test/test_plugin/swissmedic.rb,as he could not find any references for them in the src code. Did I erroneously remove stuff when cleaning up the swissmedic import earlier?
  • The whole test for older/newer Packages must be adapted to xlsx. One must compare the rows (e.g. by creating csv files) and do the same stuff in xlsx!
  • creat gem: task: input=file with ean-codes, standard output show ean-codes + atc-code. Source is Swissmedic Packungen.xlsx or XML.
  • Import via data/medreg_companies.yaml
  • Fix problem with radioactivatum 99m-technetio when parsing Wirkstoffe
  • Fix galenic_forms when parsing swissmedic.xlsx
  • Cleanup generic_type. Replace it everywhere by sl_generic_type and adapt code accordingly.
  • Get updated ATC-codes from EPha for oddb.org, too.
  • Display new fields (LABEL, MORE_INFO, CORRESP) for compositions in oddb.org.
  • Use refdatabase for oddb.org, too.
  • Fix running rspec for new packungen.xlsx in oddb2xml

Adapt oddb.org to new fields for compositions

Stuff todo:

  • Import updated parslet-parser from oddb2xml into oddb.org
    • Add new fields, eg. excipiens to model
    • more or less copy lib/oddb2xml/compositions_syntax.rb and lib/oddb2xml/parslet_compositions.rb
    • rework src/plugin/swissmedic to use the logic from the methods emit_substance and build_calc in lib/oddb2xml/builder.xlm when import info from Packungen.xlsx
  • Add helper import job for compositions
  • Add new fields, eg. excipiens oddb.org HTML views

What and how to add

  • excipiens
    • In oddb2xml each composition has zero or one excipiens which is a substance (often only a name, but can have a dose, e.g 7680004500015, FSME-Immun CC, Suspension zur intramuskulären Injektion
    • in oddb2xml a substance can have a more_info field (like conserv)

Adding the following new accessors:

  • composition: excipiens (must be a substance). Added test-cases, for compostion.label, too.
  • substance: more_info
  • substance: IS_ACTIVE_AGENT, in oddb.org this questions is answered by looking if the substance was added a active_agent to the composition. We have here a semantic clash, but for the viewer there will be no visual difference.

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

Fix unit tests for plugin/swissmedic

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

view · edit · sidebar · attach · print · history
Page last modified on July 08, 2015, at 05:39 PM