view · edit · sidebar · attach · print · history

Index>

0170207-fix-ddd-calculation

Summary

  • Fix DDD prices
  • Ajax MouseOver wrong preload problem
  • Keep in Mind
  • The field division (Teilbarkeit) is no longer shown e.g. Inderal
  • Cibacen as 5 times nr of tablets

Commits

Index

Fix DDD prices

My changes of yesterday to reimport the WHO did not work as expected. The changed ATCs did not have any DDDs. Reworking the change.

Struggling on howto use test/stub for odba and oddbapp for updating correctly the pointer of the DDDs.

Added a workaround for the NoMethodError seen yesterday and today. Running jobs/import_whocc. This seems to work, as I have now

ch.oddb> atc_class('N05AX08').ddds.keys                                                                                                                                 -> ["O", "Pdepot"]
ch.oddb> atc_class('N05AX08').ddds.values.first.dose
-> 5 mg
ch.oddb> atc_class('N05AX08').ddds.values.last.dose
-> 2.7 mg
ch.oddb> atc_class('N05AX08').ddds.values.first.odba_id
-> 82382

The odba_id is the same before and after the export, which is great. Now running jobs/export_ddd_csv.

After pushing the commit

Calling import_whocc on thinpower.

Now looking at Coversum. Here the FI has a complex galenic form

Galenische Form und Wirkstoffmenge pro Einheit
Trennbare, hellgrüne, oblonge Filmtablette zu 5 mg, auf deren einen Seite

eingraviert ist, mit Bruchrille zu beiden Seiten. Perindopril Arginin 5 mg entsprechend 3,395 mg Perindoprilum. Die Menge Basis-Perindopril bleibt äquivalent zu der in Coversum 4 mg (Tertiärbutylamin-Salz) enthaltenen Menge.
Grüne, runde, bikonvexe Filmtablette zu 10 mg, auf deren einen Seite

und auf der anderen Seite

eingraviert ist. Perindopril Arginin 10 mg entsprechend 6,790 mg Perindoprilum. Die Menge Basis-Perindopril bleibt äquivalent zu der in Coversum 8 mg (Tertiärbutylamin-Salz) enthaltenen Menge.

Till now our calculation assumed that you you would take a whole tablet each day. Therefore we arrived at a DDD cost of 1.19 instead of 0.60.

Ajax MouseOver wrong preload problem

There are some error that dojo does not preload correctly the SL categories. Sometimes it displays the homepage.

On thinpower the Javascript consoled reports console.log(dojo.version.toString()); 1.9.3 (fd52c96). Updating it to Version 1.12. On thin power with

cd /var/www/oddb.org/doc/resources
wget http://download.dojotoolkit.org/release-1.12.1/dojo-release-1.12.1.tar.gz
sudo -u apache tar -zxvf dojo-release-1.12.1.tar.gz
mv dojo dojo-1.9.3
mv dojo-release-1.12.1 dojo

Now the javascript console reports the dojo version 1.12.1 (a1e2d9d)

Added a console.log about the references URL in tooltip.rb and setting preventCache to true. All URL look fine, but I see a curious error in the console.log

st_oddb:2990 Defining deductible_58 for href 
st_oddb:3016 Defining ikscat_58 for href http://oddb-ci2.dyndns.org/de/gcc/ajax_swissmedic_cat/reg/57348/seq/02/pack/011
parser.js.uncompressed.js:900 dojo/parser::parse() error Error: Unable to resolve constructor for: 'dijit.ProgressBar'
    at Object.<anonymous> (parser.js.uncompressed.js:188)
    at Object.map (dojo.js:4662)
    at Object._instantiate (parser.js.uncompressed.js:184)
    at parser.js.uncompressed.js:893
    at signalListener (dojo.js:7538)
    at Promise.Deferred.then.promise.then (dojo.js:7759)
    at Object.parse (parser.js.uncompressed.js:890)
    at Object._parse (html.js.uncompressed.js:301)
    at Object.onEnd (html.js.uncompressed.js:245)
    at Object.set (html.js.uncompressed.js:144)
(anonymous) @ parser.js.uncompressed.js:900
signalListener @ dojo.js:7538
Deferred.then.promise.then @ dojo.js:7759
otherwise @ dojo.js:7999
parse @ parser.js.uncompressed.js:890
_parse @ html.js.uncompressed.js:301
onEnd @ html.js.uncompressed.js:245
set @ html.js.uncompressed.js:144
_setContent @ ContentPane.js.uncompressed.js:555
(anonymous) @ ContentPane.js.uncompressed.js:413
notify @ dojo.js:7302
complete @ dojo.js:7283
resolve.callback @ dojo.js:7363
notify @ dojo.js:7319
complete @ dojo.js:7283
resolve.callback @ dojo.js:7363
notify @ dojo.js:7311
complete @ dojo.js:7283
resolve.callback @ dojo.js:7363
(anonymous) @ dojo.js:6323
signalListener @ dojo.js:7538
signalWaiting @ dojo.js:7529
Deferred.resolve @ dojo.js:7693
signalDeferred @ dojo.js:7582
signalListener @ dojo.js:7553
signalWaiting @ dojo.js:7529
Deferred.resolve @ dojo.js:7693
signalDeferred @ dojo.js:7582
signalListener @ dojo.js:7559
signalWaiting @ dojo.js:7529
Deferred.resolve @ dojo.js:7693
signalDeferred @ dojo.js:7582
signalListener @ dojo.js:7553
signalWaiting @ dojo.js:7529
Deferred.resolve @ dojo.js:7693
handleResponse @ dojo.js:9645
onLoad @ dojo.js:9680

Tried to catch the error with

    on(dom.byId('#{element.css_id}'), 'onContentError', function(myError){
        console.log('#{element.css_id} onContentError ' + myError);
        this.set("label", myError);
    });

but this did not help.

It looks for me like a bug how dojo loads (asynchronously) the content from the various URL. Eg. if I set preload: false, preventCache: false the page loading take a long time, the pop-up sometimes are place to the right, but never a home page is shown. When using other combination, loading is faster but sometime the HomePage instead of the correct URL is returned. The console logs look like this

st_oddb:73 mouseover ikscat_1_dialog for href http://oddb-ci2.dyndns.org/de/gcc/ajax_swissmedic_cat/reg/56209/seq/04/pack/002.isLoaded true
st_oddb:137 mouseover ikscat_2_dialog for href http://oddb-ci2.dyndns.org/de/gcc/ajax_swissmedic_cat/reg/56209/seq/01/pack/004.isLoaded true
st_oddb:201 mouseover ikscat_3_dialog for href http://oddb-ci2.dyndns.org/de/gcc/ajax_swissmedic_cat/reg/56209/seq/02/pack/016.isLoaded true
st_oddb:265 mouseover ikscat_4_dialog for href http://oddb-ci2.dyndns.org/de/gcc/ajax_swissmedic_cat/reg/56209/seq/03/pack/024.isLoaded true
st_oddb:329 mouseover ikscat_5_dialog for href http://oddb-ci2.dyndns.org/de/gcc/ajax_swissmedic_cat/reg/65478/seq/02/pack/001.isLoaded true

and the href is never only the home page. This can be verified by looking at /var/www/oddb.org/log/oddb/access_log. And I see no activity in the apache error_log neither nor in the services log.

Used open-uri to fetch the contents. Now the loading of the page takes longer (as all references must be fetched). But the tooltip is now rendered correctly.

Pushed commits Fix typo in plugin/swissmedic and Debug tooltip. Use OpenURI

view · edit · sidebar · attach · print · history
Page last modified on February 08, 2017, at 04:54 PM