view · edit · sidebar · attach · print · history

Index>

20151027-import-new-atc-codes

Summary

  • UTF-8 problem when changing the password
  • Should consider new atc-codes from who
  • Port oddb.org to ruby 2.x
  • Diff fachinfo

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.

Should consider new atc-codes from who

Verifying import of yesterday. First via bin/admin

ch.oddb> atc_class('L01XC21')
-> Ramucirumab
ch.oddb> atc_class('L01XC21').origin
-> whocc_new
ch.oddb> registration('65330').name_base
-> OFEV 100 mg
ch.oddb> registration('65330').atc_class
-> Nintedanib
-> L01XE31
ch.oddb> atc_class('L01XE31').origin
-> whocc_new
ch.oddb> atc_class('L01XE31')
-> Nintedanib

But looking via http://oddb-ci2.dyndns.org/de/gcc/search/zone/drugs/search_query/Nintedanib/search_type/st_substance?#best_result did not produce any result. Restarting oddbd did not help. Running rebuild_indices.

Search via atc_chooser I remarked that I find infos for L01D, but not for L01E http://oddb-ci2.dyndns.org/de/gcc/atc_chooser/code/L01E and http://oddb-ci2.dyndns.org/de/gcc/search/search_query/L01XE31 displays an empty result. This is probably the result that I cannot import import_guidelines and/or DDD for a not yet published ATC.

Deleting 65785 (Esbriet) and 65330 (Ofev) from registration with fachinfo via bin/admin

reg = @system.registration('65330'); delete reg.fachinfo.pointer if reg.fachinfo; update reg.pointer, :fachinfo => nil; delete reg.pointer 
reg = @system.registration('65782'); delete reg.fachinfo.pointer if reg.fachinfo; update reg.pointer, :fachinfo => nil; delete reg.pointer 

Running jobs/update_textinfo_swissmedicinfo --reparse --target=both 65782 65330 to see whether Ofev appears then when looking via price comparison. This did not work, as the ATC-class of the registration is not updated as it should be. Correcting src/plugin/text_info.rb. After a few tries I got everything working. Pushed commit Add new ATC code from who. Correct plugin/text_info.rb

UTF-8 problem when changing the password

Imported yus db from thinpower. Changed my password and with my commit the http://oddb-ci2.dyndns.org/de/gcc/user/name/martin.born%40pharmasuisse.org worked fine. Pushed commit Handle UTF-8 problem in login

Still having problems on thinpower. Pushed commit Handle UTF-8 problem in login. Second try

Port oddb.org to ruby 2.x

Started porting to ruby 2.x. Progress and big ideas are found under http://dev.ywesee.com/Choddb/Ruby20

Pushed commits for yus:

Pushed some commits for odba:

When a new fachinfo is imported, we should save the differences to the last fachinfo

Create a history of FI changes and add a nice diff (colored) to compare any two versions. Look at gems like diffy or differ

We get some inspiration from the prices info. There the prices form an array of Money. Each has it valid_from date and newer entries seem to be inserted in the front.

Therefore I think we should add the following features to fachinfo

  • text. A text which represents the text of the fachinfo (without the HTML entities)
  • history. A Hash of { date, text} corresponding to the date of the FI-import
  • Do we need to have a separate/combinable history of chapters or only the whole FI? Displaying title of chapter will be implemented later.
  • Links like de/gcc/show/reg/00373/diff/2015-10-27 should work and correspond with "Data was imported".
  • Users might want also to see a list of all diffs (sorted by IKSRN, name, atc and or date)

Is the fachinfo.add_change_log_item method really used? I only find in src/plugin/fachinfo_invoicer.rb, src/state/admin/fachinfoconfirm.rb, src/state/drugs/fachinfo.rb. This functionality should be dropped. Found an existing change_log via bin/admin

ch.oddb> registrations.values.find{|x| x.fachinfo and x.fachinfo.change_log.size > 0}.iksnr
-> 55561
ch.oddb> registration('55561').fachinfo.change_log.size
-> 3
ch.oddb> registration('55561').fachinfo.change_log.first
-> #<ODDB::Fachinfo::ChangeLogItem:0x007f71949ef8d8>
ch.oddb> registration('55561').fachinfo.change_log.first.email
-> zdavatz@ywesee.com
ch.oddb> registration('55561').fachinfo.change_log.first.time
-> 2012-07-16 11:58:29 +0200
ch.oddb> registration('55561').fachinfo.change_log.first.chapter
-> uploaded
ch.oddb> registration('55561').fachinfo.change_log.first.language
-> de

Question: Do we need the same for the patinfo?

Choosing between gems and differ

  • Differ: Version 0.2Last commit 2011, last release February 2011, with 114,612 downloads
  • Diffy: Version 3.0.7, Last release October 12, 2014 with 279,191 downloads. Last commit February 2015

Diffy seems to have the necessary functionality, eg. diffing two strings (or files), generating html with -/+ sign, number lines surrounding

Next sub-task is generating a unit tests and changes in model to test two different versions of a fachinfo.

Removed old change_log functionality. Added new method text to fachinfo. Tested with bin/admin

ch.oddb> registration('00485').fachinfo.de.effects.to_s[0..150]
-> Eigenschaften/Wirkungen
ATC-Code: J07BB02
Die Schutzwirkung des Impfstoffs ist innerhalb von 2-3 Wochen nach Injektion erreicht. Die Dauer der Schutzwi
ch.oddb> registration('00485').fachinfo.fr.effects.to_s[0..150]
-> Propriétés/Effets
Code ATC: J07BB02
La séroprotection est obtenue dans les 2 à 3 semaines suivant l'injection du vaccin. La durée de l'immunité post-va
ch.oddb> registration('00485').fachinfo.fr.effects.to_s[0..150]
-> Propriétés/Effets
Code ATC: J07BB02
La séroprotection est obtenue dans les 2 à 3 semaines suivant l'injection du vaccin. La durée de l'immunité post-va
ch.oddb> registration('00485').fachinfo.fr.text.to_s[0..150]
-> Composition
Principes actifs
Influvac est un vaccin anti-grippal inactivé cultivé sur œufs de poule fécondés issus d'élevages de poules saines, à base 
ch.oddb> registration('00485').fachinfo.de.text.to_s[0..150]
-> Zusammensetzung
Wirkstoffe
Influvac ist ein auf befruchteten Hühnereiern aus gesunder Hühnerzucht hergestellter inaktivierter Influenzavirus-Impfstoff 
ch.oddb> registration('00485').fachinfo.fr.text.to_s[-150..-1]
-> lage de 10 x 1 seringue prête à l'emploi de 0,5 ml. [B]Titulaire de l’autorisation
BGP Products GmbH, 6341 Baar.Mise à jour de l’information
Mai 2014.
ch.oddb> registration('00485').fachinfo.de.text.to_s[-150..-1]
-> tigspritze zu 0,5 ml [B]
Packung zu 10 x 1 Fertigspritze zu 0,5 ml [B]Zulassungsinhaberin
BGP Products GmbH, 6341 Baar.Stand der Information
Mai 2014.
ch.oddb> registration('00485').fachinfo.de.text.size
-> 9327
ch.oddb> registration('00485').fachinfo.fr.text.size
-> 9736

Running the watir tests before pushing commit.

Thinking whether I want to include the diff functionality directly in the FachinfoDocument class or moving it into a seperate class. Patinfo? And what should I change in the logs? The whole text (which is quite often several 10 or 100 kB big). Or only the diff? But in which format?

view · edit · sidebar · attach · print · history
Page last modified on October 27, 2015, at 07:18 PM