view · edit · sidebar · attach · print · history

20130805-sonderzeichen

<< | Index | >>


Summary

  • parse_patinfo has an exception when parsing non-ASCII character
  • Missing chapter about driving in FI and PI
  • Remove superfluos <br> in htmlgrid when displaying tables for fachinfo

Commits

Index


Remove superfluos <br> in htmlgrid when displaying tables for fachinfo

Unit-Test for displaying chapters is in test/test_view/chapter.rb but has 2 failures and 8 errors. In src/view/chapter.rb on line 28 the procedure u is not implemented. Replaced the call call to u like this: text = u paragraph.text --> txt = paragraph.text.encode("UTF-8") in https://github.com/ngiger/oddb.org/commit/471b383252fc5c944336f039e308a5552b0a5434 the unit test was not updated. Therefore dojoType-> data-dojo-type. This brought the unit test down to 2 failures and 2 errors.

Took me far too long to find a good place to enter the unit tests.

As a side effect locally I made all UnitTest of the htmlgrid gem pass.

Also fixed a few errors under test/test_views/.

The easies place to add a test was finally found under ext/fiparse/test/test_fachinfo_hpricot.rb. Question now is: Why is added <span style="padding-bottom: 4px; white-space: normal; line-height: 1.4em;"></span> twice (and than <br>) before the content of the td element?

The style is defined as PAR_STYLE in src/view/chapter.rb.

Removing the else case on line 63 of src/view/chapter.rb made the tables format correctly. Collateral damage was that anything of the text outside the tables is not displayed! This is probably not what we want. Will continue tomorrow.

Continuing after lunch. I found the solution. See

Clean the files up. Pushed commit Fix superfluos <BR> in table data

Looks good after reeimport. Comparing the text copied from the browser shows that oddb.ch now has a lot less line breaks in it compard to swissmedicinfo. E.g our version looks like this:

Arzneimittel in Ko-administration   Dosis/ Verabreichungs-schema des ko-administrierten Arzneimittels Dosis/ Verabreichungs-schema von Raltegravir  Verhältnis (90%-Konfidenzintervall) der pharmakokinetischen Parameter von Raltegravir mit/ohne Koadministration eines anderen Arzneimittels; kein Einfluss = 1,00
n Cmax  AUC Cmin
Atazanavir  400 mg täglich  100 mg Einzeldosis  10  1,53 (1,11; 2,12) 1,72 (1,47; 2,02) 1,95 (1,30; 2,92)
Atazanavir/Ritonavir  300 mg/100 mg täglich 400 mg zweimal täglich  10  1,24 (0,87; 1,77) 1,41 (1,12; 1,78) 1,77 (1,39; 2,25)
Darunavir/Ritonavir 600 mg/100 mg zweimal täglich 400 mg zweimal täglich  6 0,67 (0,33-1,37)  0,71 (0,38-1,33)  1,38 (0,16-12,12)
Efavirenz 600 mg täglich  400 mg Einzeldosis  9 0,64 (0,41; 0,98)   0,64 (0,52; 0,80)   0,79 (0,49; 1,28)
Etravirin 200 mg zweimal täglich  400 mg zweimal täglich  19  0,89 (0,68, 1,15)   0,90 (0,68, 1,18)   0,66 (0,34, 1,26)
Omeprazole  20 mg täglich 400 mg Einzeldosis  14 (10 für AUC)   4,15 (2,82, 6,10)   3,12 (2,13, 4,56)   1,46 (1,10, 1,93)
Rifampicin  600 mg täglich  400 mg Einzeldosis  9 0,62 (0,37; 1,04)   0,60 (0,39; 0,91)   0,39 (0,30; 0,51)
Rifampicin  600 mg täglich  800 mg zweimal täglich  14  1,62* (1,12, 2,33)  1,27* (0,94, 1,71)  0,47* (0,36, 0,61)
Ritonavir 100 mg zweimal täglich  400 mg Einzeldosis  10  0,76 (0,55; 1,04)   0,84 (0,70; 1,01) 0,99 (0,70; 1,40)
Tenofovir 300 mg täglich  400 mg zweimal täglich  9 1,64 (1,16; 2,32)   1,49 (1,15; 1,94)   1,03 (0,73; 1,45)
Tipranavir/Ritonavir  500 mg/200 mg zweimal täglich 400 mg zweimal täglich  15 (14 für Cmin)  0,82 (0,46; 1,46) 0,76 (0,49; 1,19) 0,45 (0,31; 0,66)

whereas it is spread over many, many lines on swissmedicinfo. But I think ours is more readable!

That's all for today!

Missing chapter about driving in FI and PI

When importing Isentress we did not parse correctly @Wirkung auf die Fahrtüchtigkeit und auf das Bedienen von Maschinen@

Therefore we must update the parser to handle this chapter (section 10) as well. Will write first a unit test for it. It fails now.

Found the error. In fachinfo_hpricot.rb the regular expression for driving_inabilites is wrong. Unittest passes now. Running import for 58267 for Isentress.

Verifiying whether we display now the driving inability section. Okay. Committing changes. Pushed Fix wrong recognition of driving inablity

parse_patinfo has an exception when parsing non-ASCII character

Investigating the following backtrace

Plugin: ODDB::TextInfoPlugin
Error: ArgumentError
Message: invalid byte sequence in US-ASCII
Backtrace:
(druby://localhost:10002)
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/tag.rb:22:in `gsub'
(druby://localhost:10002)
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/tag.rb:22:in `html_quote'
(druby://localhost:10002) 
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/tag.rb:114:in `block in attributes_as_html'
(druby://localhost:10002)
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/tag.rb:112:in `each'
(druby://localhost:10002)
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/tag.rb:112:in `map'
(druby://localhost:10002)
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/tag.rb:112:in `attributes_as_html'
(druby://localhost:10002)
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/tag.rb:96:in `block in output'
(druby://localhost:10002)
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/tag.rb:29:in `if_output'
(druby://localhost:10002)
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/tag.rb:95:in `output'
(druby://localhost:10002)
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/tag.rb:101:in `block in output'
(druby://localhost:10002)
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/tag.rb:101:in `each'
(druby://localhost:10002)
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/tag.rb:101:in `output'
(druby://localhost:10002)
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/tag.rb:101:in `block in output'
(druby://localhost:10002)
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/tag.rb:101:in `each'
(druby://localhost:10002)
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/tag.rb:101:in `output'
(druby://localhost:10002)
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/tag.rb:101:in `block in output'
(druby://localhost:10002)
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/tag.rb:101:in `each'
(druby://localhost:10002)
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/tag.rb:101:in `output'
(druby://localhost:10002)
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/tag.rb:101:in `block in output'
(druby://localhost:10002)
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/tag.rb:101:in `each'
(druby://localhost:10002)
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/tag.rb:101:in `output'
(druby://localhost:10002)
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/tag.rb:101:in `block in output'
(druby://localhost:10002)
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/tag.rb:101:in `each'
(druby://localhost:10002)
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/tag.rb:101:in `output'
(druby://localhost:10002)
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/tag.rb:7:in `block in output'
(druby://localhost:10002)
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/tag.rb:6:in `each'
(druby://localhost:10002)
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/tag.rb:6:in `output'
(druby://localhost:10002)
/usr/local/lib/ruby/gems/1.9.1/gems/hpricot-0.8.4/lib/hpricot/traverse.rb:37:in `to_html'
(druby://localhost:10002)
/var/www/oddb.org/ext/fiparse/src/textinfo_hpricot.rb:70:in `extract'
(druby://localhost:10002)
/var/www/oddb.org/ext/fiparse/src/fiparse.rb:233:in `parse_patinfo_html'
(druby://localhost:10002) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block'
(druby://localhost:10002) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1508:in `perform'
(druby://localhost:10002) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop'
(druby://localhost:10002) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in `loop'
(druby://localhost:10002) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop'
/var/www/oddb.org/src/plugin/text_info.rb:87:in `parse_patinfo'
/var/www/oddb.org/src/plugin/text_info.rb:1108:in `block in parse_and_update'
/var/www/oddb.org/src/plugin/text_info.rb:1076:in `each'
/var/www/oddb.org/src/plugin/text_info.rb:1076:in `parse_and_update'
/var/www/oddb.org/src/plugin/text_info.rb:1134:in `block (3 levels) in import_info'
/var/www/oddb.org/src/plugin/text_info.rb:1133:in `each'
/var/www/oddb.org/src/plugin/text_info.rb:1133:in `block (2 levels) in import_info'
/var/www/oddb.org/src/plugin/text_info.rb:1132:in `each_pair'
/var/www/oddb.org/src/plugin/text_info.rb:1132:in `block in import_info'
/var/www/oddb.org/src/plugin/text_info.rb:1129:in `each_pair'
/var/www/oddb.org/src/plugin/text_info.rb:1129:in `import_info'
/var/www/oddb.org/src/plugin/text_info.rb:1190:in `block in import_swissmedicinfo_by_index'
/var/www/oddb.org/src/plugin/text_info.rb:1189:in `each_pair'
/var/www/oddb.org/src/plugin/text_info.rb:1189:in `import_swissmedicinfo_by_index'
/var/www/oddb.org/src/plugin/text_info.rb:1238:in `import_swissmedicinfo'
/var/www/oddb.org/src/util/updater.rb:500:in `block in update_notify_simple'
/var/www/oddb.org/src/util/updater.rb:476:in `call'
/var/www/oddb.org/src/util/updater.rb:476:in `wrap_update'
/var/www/oddb.org/src/util/updater.rb:494:in `update_notify_simple'
/var/www/oddb.org/src/util/updater.rb:303:in `update_textinfo_swissmedicinfo'
/var/www/oddb.org/src/util/updater.rb:192:in `run'
jobs/import_daily:13:in `block in <module:Util>'
/var/www/oddb.org/src/util/job.rb:40:in `call'
/var/www/oddb.org/src/util/job.rb:40:in `run'
jobs/import_daily:12:in `<module:Util>'
jobs/import_daily:11:in `<module:ODDB>'
jobs/import_daily:10:in `<main>'

Running import with all new patinfo between 30.07 and 5.08.2013 to check whether we can reproduce the problem.

The import did not finish as I got the error @Message: ERROR: prepared statement "ruby-dbi:Pg:3523878801375684797.5612526" already exists@. But it had already imported 60 PI. It seems to have a problem at the end when calling @clean_invoices@.

view · edit · sidebar · attach · print · history
Page last modified on August 05, 2013, at 09:38 PM