view · edit · sidebar · attach · print · history

Index>

20140219-add-medical-products

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

---

Add medical products

Agreed on the following requirements with Zeno:

  • Create jobs/import_medical_products which imports *.docx files from data/medical_products. Has 1 parameter a glob style string for selecting files, e.g. '*' or 'Sinovial_DE.docx'
  • imported items must be found using the search by atcclass. We will add a pseudo atc_class with code 'medical'.
  • We must be able to find it by its EAN13 code.
  • We must update oddbapp.rb to return medical_products and be able to search it via name.
  • We assume the convention name{_DE|_FR}.docx to find out the language the document is.

Working on adding a possibility to query the content of each chapter easily after converting the *.docx file to *.xml.

Pushed some commits for improving ydocx.

Adding a unit-test for the plugin/medical_products.rb. Must increase Footprint in src/util/oddbapp.rb when running unit tests, as I got the following error msg

ruby test/test_util/oddbapp.rb
<...>
init system
init system: 0.000547046
setup drb-delegation
reset
reset: 0.000711219
system initialized
initialized: 0.000773888
.process: test/test_util/oddbapp.rb
Footprint exceeds 5120MB. Exiting. Exiting status.init system

Now tests for oddbapp.rb run. Working on importer tests. Copied docx to /var/www/oddb.org/data/medical_products/de/Sinovial_DE.docx. After some iterations jobs/import_medical_products works. Get the expected e-mail. I can query now via bin/admin.

medical_products.size
-> 1
medical_products.first
-> Sinovial® HighVisc 1,6%;7612291078458;7612291078472

Pushed commit Added medical_products

Now attacking the problem to show it on my oddb-ci2 via http.

Now I would like a search to complete like for Konjunktivis, e.g. search_oddb('Sinovial', 'de').empty? should return false.

search_oddb('konjunktivitis', 'de').package_count
-> 18
ch.oddb> search_oddb('Konjunktivitis', 'de').empty?
-> false
 search_oddb('Sinovial', 'de').empty?
-> true
ch.oddb>  ODBA.cache.retrieve_from_index("medical_product_index", 'sinovial')
-> key not found: "medical_product_index"

We should be able to find 'Sinovial' using the method search_medical_products in oddbapp.rb. Index medical_product_index does not yet exist. Must create it.

Added a simple search by expanding search_oddb including a debug message. Now bin/admin works like this:

search_oddb('Sinovial', 'de').atc_classes.first
-> Sinovial® HighVisc 1,6%;7612291078458;7612291078472
search_oddb('Sinovial', 'de').atc_classes.size
-> 1
search_oddb('Sinovial', 'de').atc_classes.first.class
-> ODDB::MedicalProduct

But when I search via the web. Neither my debug message nor a result shows up. Must have worked with the wrong search method.

  1. http://dev.ywesee.com/wiki.php/ODBA/SimpleIndex
  2. http://dev.ywesee.com/wiki.php/ODBA/ConditionIndex
  3. http://dev.ywesee.com/wiki.php/ODBA/FulltextIndex

After discussion with Zeno we agreed that the medical_product-import should create for each medical product a package (7 digits), a fachinfo, a sequence (00). EAN13 e,g 761291078458 -> package-id 1291078). Conceptually this would mean that the traditional 5 digit iksnr, eg. 62630, would have (implicit) prepended 80, resulting 8062630.

Adapted code. Now when running the import I get the following errors

2014-02-20 08:54:30 +0100: /var/www/oddb.org/src/plugin/medical_products.rb 113: created IBSA Institut Biochimique SA nr 1229107 pack 845 name: Sinovial® HighVisc 1,6%
SBSM::InvalidDataError: e_invalid_ean_code when updating index 'oddb_package_name_with_size_company_name_ean13_fi' with a ODDB::Package
["/var/www/oddb.org/src/model/ean13.rb:12:in `initialize'", "/var/www/oddb.org/src/model/ean13.rb:26:in `new'", "/var/www/oddb.org/src/model/ean13.rb:26:in `new_unchecked'", "/var/www/oddb.org/src/model/package.rb:163:in `barcode'"]

and in the received e-mail

Plugin: ODDB::MedicalProductPlugin
Error: NoMethodError
Message: undefined method `+' for nil:NilClass
Backtrace:
/var/www/oddb.org/src/model/sequence.rb:185:in `fix_pointers'
/var/www/oddb.org/src/plugin/medical_products.rb:121:in `create_sequence_and_package_if_necessary'
/var/www/oddb.org/src/plugin/medical_products.rb:185:in `block (3 levels) in update'
/var/www/oddb.org/src/plugin/medical_products.rb:181:in `each'
/var/www/oddb.org/src/plugin/medical_products.rb:181:in `block (2 levels) in update'
/var/www/oddb.org/src/plugin/medical_products.rb:133:in `each'
/var/www/oddb.org/src/plugin/medical_products.rb:133:in `block in update'
/var/www/oddb.org/src/plugin/medical_products.rb:130:in `each'
/var/www/oddb.org/src/plugin/medical_products.rb:130:in `update'
/var/www/oddb.org/src/util/updater.rb:525:in `block in update_notify_simple'
/var/www/oddb.org/src/util/updater.rb:501:in `call'
/var/www/oddb.org/src/util/updater.rb:501:in `wrap_update'
/var/www/oddb.org/src/util/updater.rb:519:in `update_notify_simple'
/var/www/oddb.org/src/util/updater.rb:340:in `update_medical_products'
jobs/import_medical_products:27: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_medical_products:26:in `<module:Util>'
jobs/import_medical_products:12:in `<module:ODDB>'
jobs/import_medical_products:11:in `<main>'

Will continue next week. Saved work in Attach:Updated-medical_product-with-dummy-registration.txt.

view · edit · sidebar · attach · print · history
Page last modified on February 20, 2014, at 09:14 AM