view · edit · sidebar · attach · print · history

Index>

20140224-add-medical-products-2

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

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

When running import I see now the following error

2014-02-24 09:18:00 +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'"
]

When looking at the code in package.rb

		def barcode
			if(key = ikskey)
				Ean13.new_unchecked('7680'+key).to_s
			end
		end

we see that there 80 for swissmedic is hardcoded. Must adapt it.

Still getting the error

Plugin: ODDB::MedicalProductPlugin
Error: NoMethodError
Message: undefined method `+' for nil:NilClass
Backtrace:
/var/www/oddb.org/src/model/sequence.rb:190:in `fix_pointers'

With debugging I see that @registration.pointer is nil. Why? Fixed the problem by changing create_registration in src/plugin/text_info.rb to TextInfoPlugin::create_registration. Now after the import I found looking via "Markenname" Sinovial the following .

But I have no text_info nor any of the links work.

Now the next big question to solve is. Howto add the pseudo fachinfo, given that I have an XML document without formats, a HTML with format and the original docx. The plugin/textinfo.rb nows how to handle a HTML with an attached stylesheet. Will it work without a stylesheet? How can I enhance it to efficiently parse exactly one document without looking for the metainformation?

After refactoring text_plugin.rb I finally got a link to the fachinfo under http://oddb-ci2.dyndns.org/de/gcc/search/zone/drugs/search_query/Sinovial/search_type/st_sequence#best_result. But following the link http://oddb-ci2.dyndns.org/de/gcc/fachinfo/reg/1229107 leads to page saying Die von Ihnen gewünschte Information ist leider nicht mehr vorhanden.. Why?

Debugging via bin/admin

(registration('1229107').fachinfo.methods - Object.methods).sort[0..5]
-> [:add_change_log_item, :add_registration, :all_descriptions, :article_codes, :atc_class, :change_log]
registration('1229107').fachinfo.methods - Object.methods).sort[6..10]
-> [:checkout, :company, :company_name, :data_origin, :data_origins]
ch.oddb> 
registration('1229107').company.class
-> NilClass
registration('1229107').fachinfo.description.class
-> NilClass

Tried fixing it, but got the following error undefined method `descriptions' for #<ODDB::FachinfoDocument2001:0x007fac98e269f8>. Must try better!

Now I can find a fachinfo via iksnr 1229107 but no more via name. Fixed. Another change in src/util/validator.rb to accept 7 digits for iksnr and I now I have the following error when accessing http://oddb-ci2.dyndns.org/de/gcc/fachinfo/reg/1229107.

NoMethodError
undefined method `de' for #<ODDB::State::Drugs::Fachinfo::FachinfoWrapper:0x007f7171752058>

in bin/oddbd I see more details

error in SBSM::Session#http_headers: /de/gcc/fachinfo/reg/1229107NoMethodError

undefined method `localized_name' for #<ODDB::FachinfoDocument2001:0x007f717174dee0>
NoMethodError/var/www/oddb.org/src/state/drugs/fachinfo.rb:29:in `init'
/usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/session.rb:367:in `process'
/var/www/oddb.org/src/util/session.rb:125:in `process'
/usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/session.rb:172:in `block in drb_process'
<internal:prelude>:10:in `synchronize'

undefined method `de' for #<ODDB::State::Drugs::Fachinfo::FachinfoWrapper:0x007f7171752058>
/var/www/oddb.org/src/view/drugs/fachinfo.rb:276:in `init'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/component.rb:139:in `initialize'
/var/www/oddb.org/src/view/publictemplate.rb:63:in `new'
/var/www/oddb.org/src/view/publictemplate.rb:63:in `content'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:68:in `create'
error in SBSM::Session#to_html: /de/gcc/fachinfo/reg/1229107
NoMethodError
undefined method `de' for #<ODDB::State::Drugs::Fachinfo::FachinfoWrapper:0x007f71a25e1490>
/var/www/oddb.org/src/view/drugs/fachinfo.rb:276:in `init'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/component.rb:139:in `initialize'
/var/www/oddb.org/src/view/publictemplate.rb:63:in `new'
/var/www/oddb.org/src/view/publictemplate.rb:63:in `content'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:68:in `create'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:286:in `compose_component'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:211:in `block in compose'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `each'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `compose'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:57:in `init'
/var/www/oddb.org/src/view/publictemplate.rb:60:in `init'
/var/www/oddb.org/src/view/privatetemplate.rb:17:in `init'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/component.rb:139:in `initialize'
/usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/state.rb:245:in `new'
/usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/state.rb:245:in `view'
/usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/state.rb:181:in `to_html'
/usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/session.rb:447:in `to_html'
/usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/session.rb:173:in `block in drb_process'
<internal:prelude>:10:in `synchronize'
/usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/session.rb:171:in `drb_process'
/usr/lib64/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block'
/usr/lib64/ruby/1.9.1/drb/drb.rb:1508:in `perform'
/usr/lib64/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop'
/usr/lib64/ruby/1.9.1/drb/drb.rb:1582:in `loop'
/usr/lib64/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop'
ODDB::View::Drugs::Fachinfo::COMPONENTS[[0, 3]] in create(content)
error in SBSM::Session#http_headers: /de/gcc/fachinfo/reg/1229107
NoMethodError
undefined method `de' for #<ODDB::State::Drugs::Fachinfo::FachinfoWrapper:0x007f71a25e1490>
/var/www/oddb.org/src/view/drugs/fachinfo.rb:276:in `init'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/component.rb:139:in `initialize'
/var/www/oddb.org/src/view/publictemplate.rb:63:in `new'
/var/www/oddb.org/src/view/publictemplate.rb:63:in `content'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:68:in `create'

Seems that I did not yet define a localized_name for my fachinfo. Will fix this error tomorrow.

Error Export: oddbdat

Got the following error message

Error: NoMethodError
Message: undefined method `formats' for (image):ODDB::Text::ImageLink
Backtrace:
(druby://localhost:10005) /var/www/oddb.org/ext/export/src/oddbdat.rb:173:in `block (2 levels) in format_line'
(druby://localhost:10005) /var/www/oddb.org/ext/export/src/oddbdat.rb:166:in `each'
(druby://localhost:10005) /var/www/oddb.org/ext/export/src/oddbdat.rb:166:in `block in format_line'
(druby://localhost:10005) /var/www/oddb.org/ext/export/src/oddbdat.rb:161:in `each'
(druby://localhost:10005) /var/www/oddb.org/ext/export/src/oddbdat.rb:161:in `format_line'
(druby://localhost:10005) /var/www/oddb.org/ext/export/src/oddbdat.rb:139:in `block (2 levels) in lines'
(druby://localhost:10005) /var/www/oddb.org/src/model/fachinfo.rb:206:in `call'
(druby://localhost:10005) /var/www/oddb.org/src/model/fachinfo.rb:206:in `block in each_chapter'
(druby://localhost:10005) /var/www/oddb.org/src/model/fachinfo.rb:204:in `each'
(druby://localhost:10005) /var/www/oddb.org/src/model/fachinfo.rb:204:in `each_chapter'
(druby://localhost:10005) /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing'
(druby://localhost:10005) /var/www/oddb.org/ext/export/src/oddbdat.rb:138:in `block in lines'
(druby://localhost:10005) /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `each'
(druby://localhost:10005) /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing'
(druby://localhost:10005) /var/www/oddb.org/ext/export/src/oddbdat.rb:136:in `lines'
(druby://localhost:10005) /var/www/oddb.org/ext/export/src/odba_exporter.rb:190:in `block (2 levels) in export_oddbdat'
(druby://localhost:10005) /var/www/oddb.org/ext/export/src/odba_exporter.rb:189:in `each'
(druby://localhost:10005) /var/www/oddb.org/ext/export/src/odba_exporter.rb:189:in `block in export_oddbdat'
(druby://localhost:10005) /var/www/oddb.org/ext/export/src/odba_exporter.rb:187:in `each'
(druby://localhost:10005) /var/www/oddb.org/ext/export/src/odba_exporter.rb:187:in `export_oddbdat'
(druby://localhost:10005) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block'
(druby://localhost:10005) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1508:in `perform'
(druby://localhost:10005) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop'
(druby://localhost:10005) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in `loop'
(druby://localhost:10005) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop'
/var/www/oddb.org/src/plugin/oddbdat_export.rb:144:in `export_fachinfos'
/var/www/oddb.org/src/util/exporter.rb:196:in `block in export_oddbdat'
/var/www/oddb.org/src/util/exporter.rb:425:in `call'
/var/www/oddb.org/src/util/exporter.rb:425:in `safe_export'
/var/www/oddb.org/src/util/exporter.rb:192:in `export_oddbdat'
/var/www/oddb.org/src/util/exporter.rb:67:in `block in run'
/var/www/oddb.org/src/util/schedule.rb:15:in `call'
/var/www/oddb.org/src/util/schedule.rb:15:in `run_on_weekday'
/var/www/oddb.org/src/util/exporter.rb:63:in `run'
jobs/export_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/export_daily:12:in `<module:Util>'
jobs/export_daily:11:in `<module:ODDB>'
jobs/export_daily:10:in `<main>'

Why? Did see the same erro on oddb-ci2. Adding a debug output in oddbdat.rb to see which fi fails. Starting jobs/export_oddbdat to see whether I can reproduce it on oddb-ci2 with this specifiy export.

view · edit · sidebar · attach · print · history
Page last modified on February 24, 2014, at 09:13 PM