view · edit · sidebar · attach · print · history

< Niklaus.20160125-sort-order-cellcept | Index | Niklaus.20160118-parse-all-fi-aipsdownloads >>

20160120-fix-migel-missing-ean13

Summary

  • jobs/update_migel_products_with_report did not generate EAN13
  • Fix NotImplementedError in WHO import
  • Correct Tramal Patinfo
  • Remove VDAT file from oddb_article.xml
  • Sort order for evidentia

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
  • Remove parser for minifi (but keep the minifi)

jobs/update_migel_products_with_report did not generate EAN13

Where did we loose the GTIN? I must enable accessing the RefdataArticle from the SwissindexMigel. Working on downloading the XML files only once.

The method check_item in ext/swissindex/src/swissindex.rb must fetch the the RefData information (e.g. GTIN/EAN). Changing its name to get_refdata_info to reflect its useage.

Fix NotImplementedError in WHO import

Got following stacktrace in mail of who import of today

Plugin: ODDB::WhoPlugin
Error: NotImplementedError
Message: method `method_missing' called on terminated object
(0x000000572619a0 flags=0x0 klass=0x0)
Backtrace:
(eval):2:in `block in proc_instance_origin'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/index.rb:202:in `call'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/index.rb:202:in
`update_target'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/index.rb:161:in `update'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in
`method_missing'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:590:in
`block in update_indices'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:589:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:589:in
`update_indices'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:515:in `store'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:274:in
`odba_isolated_store'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:395:in
`block in odba_store_unsaved'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:392:in
`each'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:392:in
`odba_store_unsaved'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:380:in
`odba_store'
/var/www/oddb.org/src/util/persistence.rb:280:in `issue_update'
/var/www/oddb.org/src/util/oddbapp.rb:138:in `block in update'
/var/www/oddb.org/src/util/failsafe.rb:10:in `call'
/var/www/oddb.org/src/util/failsafe.rb:10:in `failsafe'
/var/www/oddb.org/src/util/oddbapp.rb:136:in `update'
/var/www/oddb.org/src/util/oddbapp.rb:1644:in `update'
/var/www/oddb.org/src/plugin/who.rb:93:in `import_atc'
/var/www/oddb.org/src/plugin/who.rb:128:in `block in import_code'
/usr/local/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.1/lib/nokogiri/xml/node_set.rb:237:in
`block in each'
/usr/local/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.1/lib/nokogiri/xml/node_set.rb:236:in
`upto'
/usr/local/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.1/lib/nokogiri/xml/node_set.rb:236:in
`each'
/var/www/oddb.org/src/plugin/who.rb:125:in `import_code'
/var/www/oddb.org/src/plugin/who.rb:78:in `import'
/var/www/oddb.org/src/util/updater.rb:573:in `block in update_notify_simple'
/var/www/oddb.org/src/util/updater.rb:549:in `call'
/var/www/oddb.org/src/util/updater.rb:549:in `wrap_update'
/var/www/oddb.org/src/util/updater.rb:567:in `update_notify_simple'
/var/www/oddb.org/src/util/updater.rb:481:in `update_whocc'
/var/www/oddb.org/src/util/updater.rb:215:in `block in run'
/var/www/oddb.org/src/util/schedule.rb:10:in `call'
/var/www/oddb.org/src/util/schedule.rb:10:in `run_on_monthday'
/var/www/oddb.org/src/util/updater.rb:214: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 locally jobs/import_whocc to see whether I can reproduce the error locally.

Correct Tramal Patinfo

Tramal (IKSNR 43788) has different patinfos for "Tramal® Tropfen, Lösung zum Einnehmen" and "Tramal® Tropfen, Lösung zum Einnehmen mit Dosierpumpe)" in its packages 078 (50 ml) and 086 (30 ml).

Until now we always matched PI/FI only via it IKSNR. But here the AipsDownload.xml contains both PI. Must check how we can distinguish them. For this I must find (also for other reasons) a simple way to split the Aips.xml into files for each fi/pi/lang. Trying first ruby.

Reading the whole file with ruby takes about 9 seconds. Thats acceptable. Now must split and generate valid XML files. Splitting is easy, but when I use REXML to parse each chunk it takes up to 2 seconds to parse each chunk, which is not good. Therefore getting authnr, lang and type via regular expression matching, which should be a lot cheaper. It indeed it is. Now the whole reading and splitting takes only less than 10 seconds. And it found 342 entries, which were the tuple [iksnr,type,lang] was already taken. Now generating in case of problems files which contain the name (title) of the FI/PI. This works and produces Attach:aips_problems.txt. Improved script Attach:split_aips.rb a little to list in the problems the first title, too.

In the case of the Tramal all entries in the Packungen.xlsx have as name "Tramal, Tropfen". In the patinfo the title is either Tramal® Tropfen, Lösung zum Einnehmen or Tramal® Tropfen, Lösung zum Einnehmen mit Dosierpump. I think we shoud generate warnings if no matching name can be found in the Packungen.xlsx. But what do we do in the mean time?

Remove VDAT file from oddb_article.xml

Done with commits

Sort order for evidentia

Evidentia would like to have the following corrections:

  • Sort-Oder for Concor. For Bisoprolol und Thiazide (C07BB07) Lodoz must come at the end
  • Sort Order for Topiramat. The desitin products must be order by their doseage unit not the alphabetical order

Lodoz did not come at the end, becsuse Bilol (IKSNR 57382) is active? (defined as expired less than two years ago) as it expired in November 2015.

Banging my head, because the debug output of oddbd shows the correct order like this

Resultsort 73: tm "Topiramat" from /de/evidentia/search/zone/drugs/search_query/Topiramat/search_type/st_combined?
<..>
adjusted_name_and_prio evidentia? false Topiramat res false pack 58796/01 Topiramat Desitin 25 mg type  expired? false out_of_trade false false prio 21
adjusted_name_and_prio evidentia? false Topiramat res false pack 58796/02 Topiramat Desitin 50 mg type  expired? false out_of_trade false false prio 21
adjusted_name_and_prio evidentia? false Topiramat res false pack 58796/03 Topiramat Desitin 100 mg type  expired? false out_of_trade false false prio 21
adjusted_name_and_prio evidentia? false Topiramat res false pack 58796/04 Topiramat Desitin 200 mg type  expired? false out_of_trade false false prio 21
<..>
result_sort 0: [-1, 5, ["Tabletten"], ["Filmtabletten"], 5, "topamax", Quanty(25,'mg'), Quanty(60,'')]
result_sort 1: [-1, 5, ["Tabletten"], ["Filmtabletten"], 5, "topamax", Quanty(50,'mg'), Quanty(60,'')]
result_sort 2: [-1, 5, ["Tabletten"], ["Filmtabletten"], 5, "topamax", Quanty(100,'mg'), Quanty(60,'')]
result_sort 3: [-1, 5, ["Tabletten"], ["Filmtabletten"], 5, "topamax", Quanty(200,'mg'), Quanty(60,'')]
result_sort 4: [-1, 5, ["Tabletten"], ["Kapseln"], 5, "topamax", Quanty(15,'mg'), Quanty(60,'')]
result_sort 5: [-1, 23, ["Tabletten"], ["Kapseln"], 23, "topamax", Quanty(25,'mg'), Quanty(60,'')]
result_sort 6: [-1, 5, ["Tabletten"], ["Kapseln"], 5, "topamax", Quanty(50,'mg'), Quanty(60,'')]

whereas in the HTML-Output of http://evidentia.oddb-ci2.dyndns.org/de/evidentia/search/zone/drugs/search_query/Topiramat/search_type/st_combined? I get

Topamax 25 mg	Topiramatum	Filmtabletten	25 mg	60 Tablette(n)	21.82	41.45	10%	Janssen-Cilag AG	B / SL / SO
Topamax 50 mg	Topiramatum	Filmtabletten	50 mg	60 Tablette(n)	37.85	59.85	10%	Janssen-Cilag AG	B / SL / SO
Topamax 100 mg	Topiramatum	Filmtabletten	100 mg	60 Tablette(n)	67.35	93.70	10%	Janssen-Cilag AG	B / SL / SO
Topamax 200 mg	Topiramatum	Filmtabletten	200 mg	60 Tablette(n)	114.07	147.35	10%	Janssen-Cilag AG	B / SL / SO
Topamax 15 mg	Topiramatum	Kapseln	15 mg	60 Kapsel(n)	13.30	27.55	10%	Janssen-Cilag AG	B / SL / SO
Topamax 50 mg	Topiramatum	Kapseln	50 mg	60 Kapsel(n)	37.85	59.85	10%	Janssen-Cilag AG	B / SL / SO
Topiramat Desitin 100 mg	Topiramatum	Filmtabletten	100 mg	60 Tablette(n)	53.88	78.25	k.A.	Desitin Pharma GmbH	B
Topiramat Desitin 200 mg	Topiramatum	Filmtabletten	200 mg	60 Tablette(n)	92.72	122.85	k.A.	Desitin Pharma GmbH	B
Topiramat Desitin 25 mg	Topiramatum	Filmtabletten	25 mg	60 Tablette(n)	16.40	35.25	k.A.	Desitin Pharma GmbH	B
Topiramat Desitin 50 mg	Topiramatum	Filmtabletten	50 mg	60 Tablette(n)	29.17	49.90	k.A.	Desitin Pharma GmbH	B
<..>

Looking at my debug code found an error. Now it display the sorted package likes

packages.sorted 0: 53537 01 014 Topamax 25 mg, Filmtabletten
packages.sorted 1: 53537 02 022 Topamax 50 mg, Filmtabletten
packages.sorted 2: 53537 03 030 Topamax 100 mg, Filmtabletten
packages.sorted 3: 53537 04 049 Topamax 200 mg, Filmtabletten
packages.sorted 4: 54751 01 028 Topamax 15 mg, Kapseln
packages.sorted 5: 54751 03 044 Topamax 50 mg, Kapseln
packages.sorted 6: 58796 03 003 Topiramat Desitin 100 mg, Filmtabletten
packages.sorted 7: 58796 04 004 Topiramat Desitin 200 mg, Filmtabletten
packages.sorted 8: 58796 01 001 Topiramat Desitin 25 mg, Filmtabletten
packages.sorted 9: 58796 02 002 Topiramat Desitin 50 mg, Filmtabletten

Found the culprit. When the name contained desitin the trailing dose was not removed. Adding test cases. Done. Now it looks nice. Running all spec tests before pushing commit. Pushed commit

view · edit · sidebar · attach · print · history
Page last modified on January 20, 2016, at 06:02 PM