view · edit · sidebar · attach · print · history


<< Masa.20120216-update-interaction-algorithm-fix-float-domain-err-add-migel-interactions-mobile-check-threads-oddb_org | Index | Masa.20120214-create-interaction-fix-utf8-errors-oddb_org-update-just_medical-decorators-ebps >>

  1. Debug keppra daily cost missing
  2. Fix Snapback link interaction
  3. Update oddb2tdat
  4. Move interaction key to oddb.yml file
  5. Continue to check grid.c

  1. Updated bsv_xml.rb to save attached files to doc/sl_errors directory and to log the saving process. And it included swissmedic_no5_oddb number in Unknown_Package file. (
  2. Updated just_medical decorators to search drugs with iksnr (ebps)
  3. Updated ddd_price calculation algorithm in the other case than Tabletten, for example, Package#dose unit becomes mg/ml (concentration) (
  4. Fix ddd_price and ddd_chart for the other galenic form than Tablette(n), for example, Package#dose unit is mg/ml (
  5. Updated snapback string to have substance name and atc-code in interaction_detail view (
  6. RECA becomes always 11, added CMWS with 2 at the end of line, and output file is saved with iso-8859-1. (oddb2tdat)
  7. Removed double quataion mark from output file (oddb2tdat)
  8. Moved interaction key to etc/oddb.yml (
  9. Fix error: undefined method pointer for nil in limitation_analysis view (

Debug daily cost missing



ch.oddb> registration('57489').package('006').ddd_price.class
-> NilClass


  • The reason is that Package@@ddd_galforms is not matched with Package#galenic_group
  • always Package@@ddd_galforms = /tabletten?/iu
  • the calculation part of ddd_price Package#ddd_price
      if(!@disable_ddd_price && (ddd = self.ddd) \
        && (grp = galenic_group) && grp.match(@@ddd_galforms)\
        && (price = price_public) && (ddose = ddd.dose) && (mdose = dose) \
        && size = comparable_size)
        if(mdose > (ddose * factor))
          (price / size.to_f) / factor
          (price / size.to_f) * (ddose.to_f * factor / mdose.want(ddose.unit).to_f) / factor
  • why it does not work in the case of keppra
 Basically, the calculation skips in the other case from tabletten 
 And the other problem is as follows:
 ddd.dose  (ddose): the amount of active_agent required for one day
 self.dose (mdose): (usually) the amount of active_agent included in one unit of package
 but in the case of mg/ml, mdose means not 'amount' but 'concentration'




Fix Snapback link interaction


  • It should include Wirkstoff and ATC-Code like
 Sie befinden sich in - Interaktionskorb - Interaktionen - Interaktion Detail C07AB02 (Ciclosporinum) und G04BE03 (Sildenafilum)


Update oddb2tdat


oddb2tdat has to be extended with

  11 (Recordart)

at the beginning of line and

  2 (Mwst-Code)

is added at the end of line.


How to use

 oddb2tdat oddb.csv oddb.dat
 oddb2tdat oddb.csv oddb.dat transfer.dat

Move interaction key to yml file



  • The interaction key is used to search interactions.
  • The key should be written in etc/oddb.yml as
 interaction_key: 'XXX'
  • If there is no interaction key in etc/oddb.yml, the default key, which is hard-coded, is used but it will be expired after searching some times in a day

Continue to check grid.c

Last time

Refer to$PageName//ch.oddb_crash_13.2.2012_15.47.txt

Segmentaion fault test

  • /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.4/ext/htmlgrid/grid.c (L406)
 VALUE grid_to_html(self, cgi)
      attrs = rb_hash_new();
      if(cf->attributes != Qnil)
        rb_hsh_update(Qnil, cf->attributes);
        //rb_hsh_update(attrs, cf->attributes);
      if(cf->colspan > 1)


 sudo rm grid.o; sudo rm htmlgrid.o; sudo make


 masa@masa ~/ywesee/ $ bin/oddbd > segfault_log.20120215.txt 2>&1




  • The error log is a little bit different from online crash log$PageName//ch.oddb_crash_13.2.2012_15.47.txt
  • 'attrs' must be a Hash
  • 'cf->attributes' also must be a Hash
  • HtmlGrid::Componsite has @grid and this will be an instance of Grid class
  • HtmlGrid::Composite becomes a super class of the other HtmlGrid class
  • That means every HtmlGrid instance has @grid (Grid instance)
  • @grid gets data from oddb database in most of view classes
view · edit · sidebar · attach · print · history
Page last modified on February 15, 2012, at 05:47 PM