The WHO publishes a list of candidates of new ATC codes. These should be added to our list with a separate flag. See http://www.whocc.no/atc/lists_of_new_atc_ddds_and_altera/new_atc/?order_by=0.
Added a unit test. Looks nice, but will continue tomorrow.
When running swissmedic import, it did not set no more found sequences to expired. Example was sequence 26 of IKSNR 00485 (Influvac).
It was quite easy to add a unit test for this problem in test/test_plugin/swissmedic_xlsx.rb
. Looks as I could fix the problem now. Running jobs/import_swissmedic_only
on oddb-ci2. Had to correct an error, as I deleted way too many packages. Reloaded DB and restarted import.
Now the list of deleted packages looks a lot better. Now found about 970 package which are obsolete. But there was
Error: NotImplementedError Message: method `method_missing' called on terminated object (0x00000039e08588 flags=0x0 klass=0x0) Backtrace: /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing' /var/www/oddb.org/src/model/sequence.rb:351:in `block in violates_patent?' /var/www/oddb.org/src/model/sequence.rb:350:in `each' /var/www/oddb.org/src/model/sequence.rb:350:in `any?' /var/www/oddb.org/src/model/sequence.rb:350:in `violates_patent?' /var/www/oddb.org/src/model/sequence.rb:93:in `active?' /var/www/oddb.org/src/model/sequence.rb:65:in `active_packages' /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing' /var/www/oddb.org/src/model/registration.rb:74:in `block in active_packages' /var/www/oddb.org/src/model/registration.rb:73:in `each' /var/www/oddb.org/src/model/registration.rb:73:in `inject' /var/www/oddb.org/src/model/registration.rb:73:in `active_packages' /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing' /var/www/oddb.org/src/plugin/swissmedic.rb:127:in `block in deactivate_not_found_packages' /var/www/oddb.org/src/plugin/swissmedic.rb:123:in `each' /var/www/oddb.org/src/plugin/swissmedic.rb:123:in `deactivate_not_found_packages' /var/www/oddb.org/src/plugin/swissmedic.rb:236:in `update' /var/www/oddb.org/src/util/updater.rb:444:in `block in update_swissmedic' /var/www/oddb.org/src/util/updater.rb:549:in `call' /var/www/oddb.org/src/util/updater.rb:549:in `wrap_update' /var/www/oddb.org/src/util/updater.rb:442:in `update_swissmedic' jobs/import_swissmedic_only:29: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_swissmedic_only:12:in `<module:Util>' jobs/import_swissmedic_only:11:in `<module:ODDB>' jobs/import_swissmedic_only:10:in `<main>'
Add a work around for this problem. Also deleting packages no longer presents. Sequences were never deleted. Drop, reload databse and restart import again.
Looks a lot better. But report output was not clear enough. Running import again after restoring database again.
Now I am happy with it and pushed commit Delete packages not found when running import_swissmedic
When visiting http://ch.oddb.org/de/gcc/user/name/martin.born%40pharmasuisse.org we got the error Encoding::CompatibilityError incompatible character encodings: ASCII-8BIT and UTF-8
.
Looking at service log I found:
40000000562dd595313aaf1c error in SBSM::Session#to_html: /de/gcc @40000000562dd595313ab304 Encoding::CompatibilityError @40000000562dd595313ab6ec incompatible character encodings: ASCII-8BIT and UTF-8 @40000000562dd595313ab6ec /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/lookandfeel.rb:105:in `_lookup' @40000000562dd595313abad4 /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/lookandfeel.rb:94:in `lookup' @40000000562dd595313abad4 /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/errormessage.rb:43:in `error_text' @40000000562dd595313af184 /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/errormessage.rb:56:in `__message' @40000000562dd595313af184 /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/errormessage.rb:66:in `block in __messages' @40000000562dd595313af56c /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/errormessage.rb:63:in `each' @40000000562dd595313af954 /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/errormessage.rb:63:in `__messages' @40000000562dd595313b0124 /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/errormessage.rb:36:in `error_message' @40000000562dd595313b050c /var/www/oddb.org/src/view/admin/entity.rb:134:in `init' @40000000562dd595313b050c /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/component.rb:139:in `initialize' @40000000562dd595313b1894 /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:61:in `new' @40000000562dd595313b1894 /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:61:in `create' @40000000562dd595313b1c7c /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:286:in `compose_component' @40000000562dd595313b1c7c /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:211:in `block in compose' @40000000562dd595313c261c /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `each' @40000000562dd595313c2a04 /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `compose' @40000000562dd595313c2dec /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:57:in `init' @40000000562dd595313c2dec /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/component.rb:139:in `initialize' @40000000562dd595313c39a4 /var/www/oddb.org/src/view/publictemplate.rb:62:in `new' @40000000562dd595313c39a4 /var/www/oddb.org/src/view/publictemplate.rb:62:in `content' @40000000562dd595313c39a4 /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:68:in `create' @40000000562dd595313c3d8c /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:286:in `compose_component' @40000000562dd595313c5114 /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:211:in `block in compose' @40000000562dd595313c5114 /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `each' @40000000562dd595313c54fc /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `compose' @40000000562dd595313c54fc /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:57:in `init' @40000000562dd595313c5ccc /var/www/oddb.org/src/view/publictemplate.rb:59:in `init' @40000000562dd595313c60b4 /var/www/oddb.org/src/view/privatetemplate.rb:17:in `init' @40000000562dd595313c60b4 /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/component.rb:139:in `initialize' @40000000562dd595313c60b4 /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/state.rb:245:in `new' @40000000562dd595313c649c /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/state.rb:245:in `view' @40000000562dd595313c6c6c /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/state.rb:181:in `to_html' @40000000562dd595313c6c6c /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/session.rb:447:in `to_html' @40000000562dd595313c7054 /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/session.rb:173:in `block in drb_process' @40000000562dd595313c83dc <internal:prelude>:10:in `synchronize' @40000000562dd595313c83dc /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/session.rb:171:in `drb_process' @40000000562dd595313c83dc /usr/local/lib/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block' @40000000562dd595313c87c4 /usr/local/lib/ruby/1.9.1/drb/drb.rb:1508:in `perform' @40000000562dd595313c87c4 /usr/local/lib/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop' @40000000562dd595313c8f94 /usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in `loop' @40000000562dd595313c937c /usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop' @40000000562dd595313c937c ODDB::View::Admin::EntityComposite::COMPONENTS[[0, 1]] in create(ODDB::View::Admin::EntityForm) @40000000562dd595313c937c ODDB::View::Admin::Entity::COMPONENTS[[0, 3]] in create(content) current [1] RO 1-1, 852 of 876, (66484) Ende 0x40 (64)