view · edit · sidebar · attach · print · history

Index>

20151202-cleanup-url

Summary

  • undefined method `update' for #<ODDB::LimitationText
  • When entering a query with an empty result, the old result is shown
  • Search by interaction does not a correct result

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.
  • Use refdatabase for oddb.org, too.
  • Check whether we should revert the part which touche src/plugin/text_info.rb of commit 17af82ba4d76a5838683411b260de265531f9e74. We should improve test/stub/oddbapp.rb to work similar for update/pointer as the real oddbapp. In this case we would have a good Stub for plugins. May we need a different stub when working with plugins (which create/modify/destroy ODDB-Objects), when in most other cases a very simple stub is sufficient.
  • When a logged in admin user changes an atc_code of a product, the corresponding atc_class must update its sequences, too.
  • Order of entering search type and value should not matter. Both should show long URL with search
  • Limit RSS feedback to year or so. Allow accessing RSS feeds of past years.

Search by interaction does not a correct result

Looking whether _search_exact_classified_result works for chapter interaction. Testing via bin/admin

$seqs = [registration('60106').sequence('01')]; $res =  _search_exact_classified_result($seqs, :substance); $res.atc_classes
-> [Clopidogrel]

# Testing index of substance
ch.oddb> retrieve_from_index('substance_index_sequence', 'Clopidogrel').first
-> Clopidogrel Medis 75 mg, Filmtabletten, Filmtabletten
ch.oddb> retrieve_from_index('substance_index_sequence', 'Clopidogrel').first.iksnr
-> 60108
ch.oddb> retrieve_from_index('substance_index_sequence', 'Clopidogrel').first.seqnr
-> 01

When entering a query with an empty result, the old result is shown

We expect the following behaviour.

  1. Home: search for Keppra via Price comparision
  2. Enter: NON_EXISTING_DRUG_NAME in search-field (top right) and press enter
  3. Should fall backk to home as nothing found

Currently it returns the old search result (e.g. keppra). I suspect that yesterday commit "Replace in all URL swissmedicnr by reg" broke it. Added a watir test to catch this situation. Reverted oddb-ci2 to commit before the suspected and running watir-test again.

Watir-test still fails, but with a weird result. It went to http://oddb-ci2.dyndns.org/de/gcc/search/zone/drugs/search_query/Xadago/search_type/st_oddb?#best_result and displayed the help text for the category. But when entering a second time Xadago the URL switched to http://oddb-ci2.dyndns.org/de/gcc/search/zone/drugs/search_query/Xadago/search_type/st_oddb?#best_result but displayed still the Keppra result. Therefore it was not yesterdays commit which broke the expected behaviour. Therefore I will try to fix the problem with the current code base.

However the interaction search seems to be broken, eg. trying viagra, aspirin all emit in the log of ch.oddb

KeyError
key not found: "interactions_index_de"
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:457:in `fetch'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:457:in `retrieve_from_index'
/var/www/oddb.org/src/util/oddbapp.rb:109:in `retrieve_from_index'
/var/www/oddb.org/src/util/oddbapp.rb:1055:in `search_by_interaction'
/var/www/oddb.org/src/state/global.rb:882:in `_search_drugs'

Calling in bin/admin ch.oddb> search_by_interaction('Warfarin', 'de') returns key not found: "interactions_index_de", which is not handled by the caller.

Calling jobs/rebuild_indices interactions_index_de interactions_index_fr to see whether this fixes the problem. After restarting bin/oddbd I got a valid result for earch_by_interaction('Warfarin', 'de') namelx #<ODDB::SearchResult:0x00000001e7a788>.

I always get an empty result for search_by_interaction('Viagra', 'de').empty? on oddb_ci2 when searching for 'Asiprin', 'Warfarin' or 'Herzinsuffizienz'. But the oddb log shows HINWEIS: Textsucheanfrage enthält nur Stoppwörter oder enthält keine Lexeme, ignoriert. This is an old problem, that somehow the postgreSQL is not correctly configured on oddb-ci2. See also blog of April 3, 2014, looking at hint. Copied 3 files for each language, like this sudo cp /var/www/oddb.org/ext/fulltext/data/dicts/french/fulltext.stop /usr/share/postgresql/tsearch_data/french_fulltext.stop and ran generate_dictionaries in bin/admin. Now the problem went away.

I propose to rebuild the interactions_index_de, restart ch.oddb (to be sure that we don't have tomorrow at 2 AM the same problem as today) and see whether the indices work correctly or not.

As the index returns now correctly a (emtpy) ODDB::SearchResult when calling search_by_interaction('Xadago', 'de'), it will also again show a correct empty result and the new watir tests passes, too. Pushed commits Return an empty result, if index is not present and Test for return an empty result, if index is not present. Waiting for import_daily to finish before pulling to thinpower.

I still have the problem, that the interaction index does not return valid items. What is the expected result. I think when selecting "Interaktion" as searchtype and entering Herzinfarkt we should get results, as this is a common problem. Are there other terms we should verify? Herzinfarkt should show Clopidogrel (IKSNR 60106).

Tried looking for Herzinfarkt via Anwendung and found only few products, eg. 48313, where there Herzinfarkt is in the chapter Kontraindikationen!

Found 2416 occurrences of Warfarin via grep -ci warfarin AipsDownload_20151201.xml. Therefore it does not surprise me, that the number of interaction could be higher than the limit of 250. Searchin for drugs is not limited to this limit.

Trying to create a bin/admin expression on thinpower to override this limit.

ch.oddb> $r= search_by_interaction('Aspirin', 'de')
-> #<ODDB::SearchResult:0x0000000e763230>
ch.oddb> $r.empty?
-> false
ch.oddb> $r.atc_classes.size
-> 38
ch.oddb> $r.package_count
-> 147

$drug_name = 'Aspirin'
$r = ODDB::SearchResult.new; $r.exact = true; $r.search_query = $drug_name; $r.search_type = :atc; $r.error_limit = 2500; $seqs = retrieve_from_index("interactions_index_de", $drug_name , $r)
ch.oddb> $seqs.size
-> 136
ch.oddb> $seqs.first
-> Vimovo, Filmtabletten

ch.oddb> $seqs =  retrieve_from_index("interactions_index_de", 'Warfarin')
-> Array
ch.oddb> $seqs.size
-> 2567
ch.oddb> $seqs.first
-> Caduet 10/10, Filmtabletten
ch.oddb> $seqs.first.iksnr
-> 57633

Pushed commit Must add test/stub/odba, too to fix unit-tests on travis-CI.

Home link does not work

undefined method `update' for #<ODDB::LimitationText

Must fix the problem on thinpower

src/util/language.rb:53:in `method_missing': undefined method `update' for #<ODDB::LimitationText:0x000000062713b0>

@40000000565e975408c6e8fc /var/www/oddb.org/src/util/language.rb:53:in `method_missing': undefined method `update' for #<ODDB::LimitationText:0x000000062713b0> (NoMethodError)
@40000000565e975408caf80c       from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing'
@40000000565e975408cafbf4       from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:590:in `block in update_indices'
@40000000565e975408cafbf4       from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:589:in `each'
@40000000565e975408caffdc       from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:589:in `update_indices'
@40000000565e975408caffdc       from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:515:in `store'
@40000000565e975408cb0b94       from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:274:in `odba_isolated_store'
@40000000565e975408cb0b94       from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:395:in `block in odba_store_unsaved'
@40000000565e975408cb9834       from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:392:in `each'
@40000000565e975408cb9834       from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:392:in `odba_store_unsaved'
@40000000565e975408cb9c1c       from /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:380:in `odba_store'
@40000000565e975408cb9c1c       from /var/www/oddb.org/src/util/oddbapp.rb:1532:in `initialize'
@40000000565e975408cba004       from bin/oddbd:46:in `new'
@40000000565e975408cba7d4       from bin/oddbd:46:in `<main>'

Added my most hackiest and ugliest patch ever with line 46 or src/util/languag return if language.eql?('update') && !self.respond_to?(:update).

Loading yesterdays dump to hope being able to reproduce the problem locally. Afterwards must look via bin/admin. The following procedures might be a starting point count_limitation_texts and multilinguify_analysis.

Could reproduce the problem here. Adding more debug output and I already catched a culprit.

Descriptions.method_missing symbol update language "update" update? false: 01.04.10.: Einfache Sedativa/Tranquillantia

Gesamthaft zugelassen 120 Punkte. Iniectabilia sine limitatione

Why do we suddenly have this problem? I think I might have make a mistaken when in end of october I removed the pharmacode from bsv-import. Analysing the commit 990ef52a9187bd7b21694367f2588a3c409ee91c again.

Looking at the results for first of decembre I find the report

ch.ODDB.org Report - SL-Update (XML) - 12/2015
Created SL-Entries                                           39
Updated SL-Entries                                         9295
Deleted SL-Entries                                           50
Created Limitation-Texts                                     29
Updated Limitation-Texts                                   1882
Deleted Limitation-Texts                                      0

Looking also at the import of first of november

ch.ODDB.org Report - SL-Update (XML) - 11/2015
Created SL-Entries                                          127
Updated SL-Entries                                         9221
Deleted SL-Entries                                           71
Created Limitation-Texts                                     17
Updated Limitation-Texts                                   1865
Deleted Limitation-Texts                                      0

In both months I updated Limitation text. What changed in between or did the data change? Compared ./oddb_limitation.xml of yesterday oddb2xml with the one from november 25 and found only expected differences. Using bin/admin packages.find{|x| x.limitation && x.limitation_text && /Einfache Sedativa\/Tranquillantia/.match(x.limitation_text.to_s)} to get insight. Found 72 entries.

Did not find 'Einfache Sedativa/Tranquillantia' which causes the problem in oddb2xml/oddb_limitation.xml. The code "01.04.10" however is found many times. The first result belongs to ["48285", "01", "031"] Tranxilium Tabs 20mg.

The limitationtext with oid 34323858 causes the problem and belongs to 32497/01/012 Seresta, Tabletten. Using registration('32497').sequence('01').package('012').delete_sl_entry in bin/admin made the limitation_text disappear from the package, but the startup problem remains.

If I try to call ch.oddb> delete registration('32497').sequence('02').package('047').sl_entry.limitation_text.pointer@2 in bin/admin I get undefined method `delete' for #<ODDB::LimitationText:0x00000006a3e9f8>@@

Deleting it directly in the cache works via bin/admin ODBA.cache.delete(ODBA.cache.fetch(34323858)). This deletes the limitation_text in the database, but not the sl_entry and oddbd restarts now without problem. Doing the same on thinpower. This worked, but as expected the limitation_text is no longer present on http://ch.oddb.org/de/gcc/show/reg/32497/seq/01/pack/012

view · edit · sidebar · attach · print · history
Page last modified on December 02, 2015, at 05:20 PM