20120215-save-attachment-bsv_xml-fix-ddd_price-interaction-snapback-interaction-key-oddb_org-update-just_medical-decorators-ebps-updated-oddb2tdat-check-grid_c-htmlgrid
<< 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 >>
- Debug keppra daily cost missing
- Fix Snapback link interaction oddb.org
- Update oddb2tdat
- Move interaction key to oddb.yml file oddb.org
- Continue to check grid.c
- Commits
-
- 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. (oddb.org)
- Updated just_medical decorators to search drugs with iksnr (ebps)
- Updated ddd_price calculation algorithm in the other case than Tabletten, for example, Package#dose unit becomes mg/ml (concentration) (oddb.org)
- Fix ddd_price and ddd_chart for the other galenic form than Tablette(n), for example, Package#dose unit is mg/ml (oddb.org)
- Updated snapback string to have substance name and atc-code in interaction_detail view (oddb.org)
- RECA becomes always 11, added CMWS with 2 at the end of line, and output file is saved with iso-8859-1. (oddb2tdat)
- Removed double quataion mark from output file (oddb2tdat)
- Moved interaction key to etc/oddb.yml (oddb.org)
- Fix error: undefined method pointer for nil in limitation_analysis view (oddb.org)
Debug daily cost missing
Problem
Check
ch.oddb> registration('57489').package('006').ddd_price.class
-> NilClass
Note
- 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
else
(price / size.to_f) * (ddose.to_f * factor / mdose.want(ddose.unit).to_f) / factor
end
- 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'
Commit
Next
Commit
Fix Snapback link interaction oddb.org
Task
- It should include Wirkstoff and ATC-Code like
Sie befinden sich in - Interaktionskorb - Interaktionen - Interaktion Detail C07AB02 (Ciclosporinum) und G04BE03 (Sildenafilum)
Commit
Update oddb2tdat
Task
oddb2tdat has to be extended with
11 (Recordart)
at the beginning of line and
2 (Mwst-Code)
is added at the end of line.
Commit
How to use
oddb2tdat oddb.csv oddb.dat
oddb2tdat oddb.csv oddb.dat transfer.dat
Move interaction key to yml file oddb.org
Commit
Note
- 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 http://dev.ywesee.com/wiki.php/Masa/20120131-fix-errors-oddbOrg-recycled-object-error-migel-check-gridC#CheckGridC
Refer to http://dev.ywesee.com/uploads/$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)
Recompile
sudo rm grid.o; sudo rm htmlgrid.o; sudo make
Run
masa@masa ~/ywesee/oddb.org $ bin/oddbd > segfault_log.20120215.txt 2>&1
Access
Result
Note
- The error log is a little bit different from online crash log http://dev.ywesee.com/uploads/$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