view · edit · sidebar · attach · print · history

Index>

20140226-add-medical-products-4

Summary

  • Add medical products

Commits

Index

Keep in Mind
  • Search nach Anwendung (indications), z.B. Konjunktivitis, does not report all occurrences in the section "Anwendung" of Fachinfo. Probably index is corrupted or not set up correctly.
  • Error: Patents with could not connect to www.swissreg.ch: #<Net::HTTPInternalServerError:0x007f8a7d69bb58>
  • vagrant-oddb.org: cleanup installation for yus with ruby 1.8, logrotate.conf and local vhosts for tests
  • Fix index with patch in oddbapp.rb?
-  def search_by_indication(key)
+  def search_by_indication(key, lang='de')
+    # indication_index_atc_de
+    pattern = key.gsub(/[^A-z0-9]/, '.')
+    return ODBA.cache.retrieve_from_index("indication_index_atc_#{lang}", pattern)
     pattern = key.gsub(/[^A-z0-9]/, '.')
     atcs = []
     indications.map do |indication|

---

Complete installation of X-11

Added VIDEO_CARDS="nouveau" to /etc/portage/make.conf Called emerge xf86-video-nouveau x11-base/nouveau-drm linux-firmware xdm awesome, emerge -1N xinit. Now calling startx succeeds. Added starting xdm at startup via rc-update add xdm default.

Made awesome my default Xsession by creating an executable file ~/.xsession with the content /etc/X11/Sessions/awesome. Cloned a default awesome configuration

git clone https://github.com/tony/awesome-config.git ~/.config/awesome && cd ~/.config/awesome && git submodule init && git submodule update && less ~/.config/awesome/README.md

It is probably time to create a personal github project for my awesome configuration.

Add medical products

Continuing work of http://dev.ywesee.com/Niklaus/20140225-add-medical-products-3#add-medical-products

Status: Link from http://oddb-ci2.dyndns.org/de/gcc/drug/reg/1229107/seq/0 to http://oddb-ci2.dyndns.org/de/gcc/resolve/pointer/ does not work. Package display size, but not unit (Spritzen)

Looking at how we get the information from the swissmedic I see that we have e.g the following content for iksnr 00274 Cardio-Pulmo-Rénal Sérocytol, suppositoire

  • Packungsgrösse 3
  • Einheit Suppositorien

Or for 62874 Fresenius Fertigspritze, Emulsion zur Infusion Fresenius Kabi (Schweiz)

  • Packungsgrösse 1 x 50 ml
  • Spritze(n)

In plugin/swissmedic.rb I found that the size is passed as size => [cell(row, column(:size)), cell(row, column(:unit))].compact.join(' '),

How does Fertigspritze 2 ml and 3 Fertigspritzen 2 mlnow fit into this scheme? Is this 1 x Fertigspritze 2 ml and 3 x Fertigspritze 2 ml? Is 1 the default unit?

Comparing 62874 and 1229107 in bin/admin I see that I created two parts instead of one for the package('845'). bin/admin reports

registration('62874').sequence('01').package('001').parts.size
-> 1
registration('62874').sequence('01').package('001').parts.first.size
-> Spritze(n) à 50 ml
registration('1229107').sequence('00').package('845').parts.size
-> 2
registration('1229107').sequence('00').package('845').parts[0].size
-> 
ch.oddb> registration('1229107').sequence('00').package('845').parts[1].size
-> 2 ml

Must correct this error while importing. First I deleted manually all parts in bin/admin via

registration('1229107').sequence('00').package('845').parts.first.oid
-> 31164900
registration('1229107').sequence('00').package('845').delete_part 31164900

But after a restart of bin/oddbd I found that the parts were not delete. Found out that

registration('1229107').sequence('00').package('847').checkout

really deletes all parts and setting @part to nil. But this creates problems afterwards. Therefore settled to use

registration('1229107').sequence('00').delete_package('847')

After adding the following lines, the new part size show up and links like http://oddb-ci2.dyndns.org/de/gcc/drug/reg/1229107/seq/0/pack/845 work, too. May be there is a redundant call or two, but at least it solves my problem now.

  package.parts.first.odba_store
  package.odba_store
  package.fix_pointers
  @app.odba_isolated_store # Why doesn't @app.updated consider the Part class?

Patching the chapters with the content of the xml does not work!

Suddenly I only get the chapter galenic-form and nothing else. Why?

Will need to make a clear refactoring by adding PseudoFachinfo via

  • new class PseudoFachinfoDokument in src/model/fachinfo.rb
  • a parser TextinfoPseudoFachino (similar to TextinfoHpricot) in ext/fiparse
  • a new writer FachinfoHpricotWriter (similar to FachinfoHpricot) in ext/fiparse
  • rewrite plugin/medical_products to use the parse/writer etc above
  • add test_case and rework unit tests to allow an easy test of each of the aspects mentioned above
  • may be a few changes in src/view/fachinfo (not sure about this)
  • may be rework ydocx gem to allow plugging in a new parser (but I think this is not necessary)
  • And last but not least. Document these decision somewhere under http://dev.ywesee.com/Choddb/Index
  • Do we want to use the fiparsed daemon to parse the docx-files? Only when serving via http? Not when running an importer or minitest? Will try using fiparsed by default and not running in the other two cases, if requested.

Verified that I have very few errors running test/suite.rb (totally 4 failures and 4 errors). Most of them come that the new unit tests for medical don't pass yet correctly.

Pushed commmit Added Gemfile and Gemfile.lock for running tests under travis-ci. The Gemfile is much closer to the installed gems in thinpower, as most of them are locked to use the same version. Using newer versions of activesupport, mail, mime-types and minitest to avoid conflicts between gem versions. bin/* and jobs/* do not require beeing run via bundler.

When looking at the newer release notes for Gem (e.g. 2.1.) I constated that gem is using now the same algorithm like bundler and can even use a Gemfile to resolve all versions. Not sure, whether it looks also at the Gemfile.lock.

Does delete_part delete the ruby principle of least surprise

When fighting with why changes to the newly created parts do not show up, I began to feel that a few things are quite wrong inside our oddb application. I really miss a guideline for developers which states some design principles.

E.g. also Yasu had to debug the delete_package method. See debug-package-deletion and resolved it with adding an odba_delete call into src/state/admin/package.rb. But when you look around most of the calls to odba_delete are in src/model/*.rb. This is I think the place where probably all of them should be. But where can I find a clear reasoning whether this odba_delete-statement belong to src/state/admin/package.rb or src/model/package.rb??

Also I wonder why the method updated in src/util/oddbapp.rb does not consider the Part-class to issue an odba_isolated_store statement.

view · edit · sidebar · attach · print · history
Page last modified on February 27, 2014, at 10:31 AM