view · edit · sidebar · attach · print · history

Index>

20140304-add-medical-products-6

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|

---

Add medical products

Finishing remaining points of refactoring by adding PseudoFachinfo via

  1. And last but not least. Document these decision somewhere under http://dev.ywesee.com/Choddb/Index
  2. 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.

Now all chapters show up (in German and French). But we have the following error

  1. distributor has no entry on top for the moment Add distributor name
  2. indications missing Fix missing indications
  3. paragraphs have not the correct CSS-class attached. Create paragraphs and not subheadings by default
  4. commercial_form is missing https://github.com/ngiger/oddb.org/commit/fe67e544db0e24ae0d61eafb48606c0bddd48180|Add commercial_form
  5. import all data in data/docx (not data/medical_products) Read medical_products from data/docx instead of data/medical_products
  6. jobs/import_pseudo_fachinfo Renamed job to jobs/import_pseudofachinfo
  7. search by vendor name does not work
  8. search by comparing prices does not work
  9. atc-code should show medical-product and only unavailable
  10. cannot follow link to medication
  11. And last but not least. Document these decision somewhere under http://dev.ywesee.com/Choddb/Index

Added a line File.open(path.sub('.docx','.yaml'), 'w+') { |fi| fi.puts fachinfo.to_yaml } to test_fachinfo_simple to analyse the generated fachinfo. See that I have a subheading before each paragraph, which should not be present.

Now the pseudo-fi looks good.

bin/admin procedure commercial_form_by_name does only find exact matches

 commercial_forms.first
-> [1067521, #<ODBA::Stub:70270022246620#1067521 @odba_class= @odba_container=70270023358820#1067430>]
ch.oddb> commercial_forms.first[1]
-> Sachet(s)
ch.oddb>commercial_form_by_name('Sachet').class
-> NilClass
commercial_form_by_name('Sachet(s)').class
-> ODDB::CommercialForm

But we can find entries using an expression like

commercial_forms.find_all{|item| item[1].match(/Fertigspritze/)}.first[1]
-> Fertigspritze(n)
registration('62630').packages.first.commercial_forms.first
-> Tablette(n)

Tried importing Sinovial_Mini_DE.docx. Most things look gut, but the packages and composition have many empty paragraphs. See .

We will have problems to resolve correctly the french names, as it seems that many of the commercial_names are not translated correctly. E.g. http://oddb-ci2.dyndns.org/de/gcc/commercial_form/oid/1067471 displays for german, english and french always Fertigspritze(n)

My first try at adding the commercial_form did not work and the units (eg. 2 x 2 ml) did not show up. Reworked algorithm and pushed Add commercial_form

Search by name "Sinovial" looks good now. Links to sequences and parts are working. Import mail signals that no commercial form could be found, e.g. we expected "Fertigspritze" but in the DB we have "Fertigspritze(n)".

bin/admin reports, that we cannot find the registration_owner for our newly created PseudoFachinfoDocument. On the other side a distributor can be found via the description.

registration('62630').fachinfo.description(:de).registration_owner
-> Zulassungsinhaberin
Pfizer AG, Zürich
registration('1229105').fachinfo.description(:de).registration_owner
-> undefined method `registration_owner' for #<ODDB::PseudoFachinfoDocument:0x007f268b6462f8>
registration('1229105').fachinfo.description(:de).distributor
-> Vertriebsfirma
IBSA Institut Biochimique SA, 6903 Lugano.

Therefore I will add method which will return the first paragraph of the distributor chaper as registration_owner. Adding a procedure in src/model/fachinfo.rb made unit tests pass, but fails on oddb-ci2.

Also we have an error when following the link to the receipt, e.g. http://oddb-ci2.dyndns.org/de/gcc/rezept/ean/7612291092232. Also in the results for 'Sinovial' I get an error nothing found when clicking on the link to the product, e.g. http://oddb-ci2.dyndns.org/de/gcc/compare/ean13/7612291058641

Okay. I see that in src/state/global.rb the rezept tries to get the package via

        if ean13 = @session.user_input(:ean) and
           pack  = @session.app.package_by_ikskey(ean13.to_s[4,8])
          State::Drugs::Prescription.new(@session, pack)
        end
and in src/util/oddbapp.rb we expect the 5 digit iksnr
  def package_by_ikskey(ikskey)
    ikskey = ikskey.to_s
    iksnr = "%05i" % ikskey[-8..-4].to_i
    ikscd = ikskey[-3..-1]
    if reg = registration(iksnr)
      reg.package ikscd
    end
  end

This cannot work now, where the pseudoinfo uses 7 digit for the registration and not 5. We should probably have a look at each of the occurences of '%05i' in the code

src/state/admin/fachinfoconfirm.rb:26:                          sprintf('%05i', iksnr.to_i)
src/plugin/vaccines.rb:269:                             reg.iksnr = sprintf('%05i', iksval.to_i)
src/plugin/bsv_xml.rb:441:          @iksnr = "%05i" % @text.to_i
src/plugin/bsv_xml.rb:475:            @registration = @app.registration("%05i" % @text[0..-4].to_i)
src/plugin/swissmedic.rb:291:          iksnr = "%05i" % row[iksnr_idx].to_i
src/plugin/swissmedic.rb:347:      iksnr = "%05i" % cell(row, column(:iksnr)).to_i
src/plugin/swissmedic.rb:378:                     "#{"%05i" % cell(row, column(:iksnr)).to_i}\""
src/plugin/swissmedic.rb:410:        && (reg = @app.registration("%05i" % cell(row, column(:iksnr)).to_i)) \
src/plugin/swissmedic.rb:506:                          @empty_compositions << "iksnr #{"%05i" % cell(row, column(:iksnr)).to_i} seq #{seq}"
src/plugin/swissmedic.rb:687:        iksnr = "%05i" % cell(row, column(:iksnr)).to_i
src/plugin/text_info.rb:99:        iksnr = "%05i" % row[0].value.to_i
src/util/oddbapp.rb:775:    iksnr = "%05i" % ikskey[-8..-4].to_i

src/state/global.rb:522:           pack = @session.app.package_by_ikskey(ean13.to_s[4,8])
src/state/global.rb:623:           pack  = @session.app.package_by_ikskey(ean13.to_s[4,8])
src/state/drugs/prescription.rb:68:       pack = @session.app.package_by_ikskey($2 + $3)
src/state/drugs/fachinfo_search.rb:83:       pack = @session.app.package_by_ikskey($2 + $3)
src/state/drugs/api_search.rb:14:      package = @session.app.package_by_ikskey(ean.to_s[4,8])
src/state/drugs/compare.rb:81:      @package = @session.app.package_by_ikskey(ean13.to_s[4,8])
src/state/interactions/interaction_chooser.rb:129:       pack = @session.app.package_by_ikskey($2 + $3)

I will add a new method session.app.package_by_ean13 which will work of iksnr and pseudo-fi.

Now displaying the Rezept works. But search via owner throws the following error in bin/oddbd

package_by_ean13 pseudo_fachinfo 1229109 ikscd 223
error in SBSM::Session#process: /de/gcc/search/zone/drugs/search_query/Sinovial/search_type/st_oddb
ArgumentError
wrong number of arguments (2 for 1)
/var/www/oddb.org/src/util/oddbapp.rb:1016:in `search_by_indication'
/var/www/oddb.org/src/util/oddbapp.rb:963:in `search_oddb'
/var/www/oddb.org/src/util/session.rb:198:in `search_oddb'
/var/www/oddb.org/src/state/global.rb:864:in `_search_drugs'
/var/www/oddb.org/src/state/global.rb:883:in `_search_drugs_state'

This may explain a lot of missing searches. search_by_indication is often called with a second parameter lang, but expects only one! After patching this error by setting the second parameter by default to :de. The search returns nothing. But on the bin/oddbd I get the following warning

HINWEIS:  Textsucheanfrage enthält nur Stoppwörter oder enthält keine Lexeme, ignoriert

Is my postgreSQL text search no more working correctly on oddb-ci2?

create_atc_class('Medizinprodukt')
-> 
atc_class('Medizinprodukt').pointer_descr
->  (Medizinprodukt)
view · edit · sidebar · attach · print · history
Page last modified on March 05, 2014, at 08:32 AM