view · edit · sidebar · attach · print · history






  • Saved only latest file for evidentia_fi_link and interactions

Changelog history for PI/FI

To fix the problem with the persistence of a Diffy::Diff object, I am working on a unit test for it and a fix inside the ODBA-Gem. As it seems to be clear, that the persistence layer should ignore closed files.

It took less than 10 minutes to add the unit test test_marshall_diff_item_with_closed_tempfile in test/test_model/fachinfo.rb. Now working on the needed changes in ODBA.

Zeno wanted to create a gem ydiffy. Released version 0.0.2.

Adding support for saving the patinfo changelog in the model and text_info plugin. Reloaded database from thinpower. Import first test using sudo -u apache bundle-240 exec /usr/local/bin/ruby-240 jobs/update_textinfo_swissmedicinfo --target=pi --reparse 66360

Having a small problem in a Log text. But adding the change_log seems to work, as shown by this bin/admin snippet

ch.oddb> registration('66360')
-> [#<ODBA::Stub:47289687635500#36113085 @odba_class=ODDB::PatinfoDocument::ChangeLogItem @odba_container=47289677380980#36113084>]
ch.oddb> registration('66360')
-> 2017-08-22
ch.oddb> registration('66360')[0..80]
-> -Was ist ASS Cardio Axapharm und wann wird es angewendet?
-ASS Cardio Axapharm en

Also must correct an error where I used patinfo[lang] instead of patinfo.descriptions[lang].

Could this be fixed in src/util/language with this definition?

def method_missing(symbol, *args, &block)
  language = symbol.to_s
  if symbol == :[] && args.first.is_a?(String) && args.first.length == 2
  elsif(language.length == 2)

Done, but now I get the following error

Plugin: ODDB::TextInfoPlugin

Error: NoMethodError
Message: undefined method `select_one' for nil:NilClass
(druby://localhost:10002) /var/www/ `restore_max_id'
(druby://localhost:10002) /var/www/ `ensure_next_id_set'
(druby://localhost:10002) /var/www/ `block in next_id'
(druby://localhost:10002) /var/www/ `synchronize'
(druby://localhost:10002) /var/www/ `next_id'
(druby://localhost:10002) /var/www/ `next_id'
(druby://localhost:10002) /var/www/ `odba_id'
(druby://localhost:10002) /var/www/ `set_oid'
(druby://localhost:10002) /var/www/ `initialize'
(druby://localhost:10002) /var/www/ `new'
(druby://localhost:10002) /var/www/ `to_textinfo'
(druby://localhost:10002) /var/www/ `extract'
(druby://localhost:10002) /var/www/ `parse_patinfo_html'
(druby://localhost:10002) /usr/local/ruby-2.4.0/lib/ruby/2.4.0/drb/drb.rb:1624:in `perform_without_block'
(druby://localhost:10002) /usr/local/ruby-2.4.0/lib/ruby/2.4.0/drb/drb.rb:1584:in `perform'
(druby://localhost:10002) /usr/local/ruby-2.4.0/lib/ruby/2.4.0/drb/drb.rb:1668:in `block (2 levels) in main_loop'
(druby://localhost:10002) /usr/local/ruby-2.4.0/lib/ruby/2.4.0/drb/drb.rb:1664:in `loop'
(druby://localhost:10002) /usr/local/ruby-2.4.0/lib/ruby/2.4.0/drb/drb.rb:1664:in `block in main_loop'
/var/www/ `parse_textinfo'
/var/www/ `block in import_swissmedicinfo'
/var/www/ `each'
/var/www/ `import_swissmedicinfo'
/var/www/ `block in update_notify_simple'
/var/www/ `wrap_update'
/var/www/ `update_notify_simple'
/var/www/ `update_textinfo_swissmedicinfo'
jobs/update_textinfo_swissmedicinfo:39:in `block in <module:Util>'
/var/www/ `run'
jobs/update_textinfo_swissmedicinfo:12:in `<module:Util>'
jobs/update_textinfo_swissmedicinfo:11:in `<module:ODDB>'
jobs/update_textinfo_swissmedicinfo:10:in `<main>'

I suspect, that this is the consequence of my interrupting the import. Therefore reloading the database dump and starting the import again.

No, this was not the case. Adding some pry debug statement to be able to track the problem. Must add a pry statement in the fiparse and run it manually.

Looks like the fiparse does not have a valid connnection to the database server

[11] pry(#<ODBA::Storage>)> row = self.dbi.select_one("SELECT odba_id FROM object ORDER BY odba_id DESC LIMIT 1")
NoMethodError: undefined method `select_one' for nil:NilClass
from (pry):11:in `restore_max_id'
[12] pry(#<ODBA::Storage>)> self.dbi
=> nil

Restarting the postgresql server and retrying the import. This did not help. It looks for me that is correctly defined when we run a ODDB-Job but that it is not defined when running the fiparse.

Fixed by adding the following two lines to ext/fiparse/bin/fiparsed

$: << File.expand_path("../../..", File.dirname(__FILE__))
require 'etc/db_connection'

Found cases, where we did not update the patinfo, as I updated the content before comparing it.

Tried to push the changes only for saving the fachinfo, but failed, because there I used the wrong diffy.

As the import_daily finished correctly on oddb-ci2 and produced some patinfo changes and multiple fi changes. I pushed the commits

Moved the change_logs into a separate class (in src/view/drugs/change_logs.rb). Fachinfo changes display correctly again. Patinfo changes produce the following error

NameError: undefined local variable or method `next_offset' for #<ODDB::View::Drugs::PiChapterChooser:0x00556361ae0988>
	/home/niklaus/git/ `init'
	/home/niklaus/git/ `initialize'
	/home/niklaus/git/ `new'
	/home/niklaus/git/ `chapter_chooser'
	/home/niklaus/git/ `create'
	/home/niklaus/git/ `compose_component'
	/home/niklaus/git/ `block in compose'
	/home/niklaus/git/ `each'
	/home/niklaus/git/ `compose'
	/home/niklaus/git/ `init'
	/home/niklaus/git/ `initialize'
	/home/niklaus/git/ `new'
	/home/niklaus/git/ `content'
	/home/niklaus/git/ `create'
	/home/niklaus/git/ `compose_component'
	/home/niklaus/git/ `block in compose'
	/home/niklaus/git/ `each'
	/home/niklaus/git/ `compose'
	/home/niklaus/git/ `init'
	/home/niklaus/git/ `init'
	/home/niklaus/git/ `init'
	/home/niklaus/git/ `initialize'
	/home/niklaus/git/sbsm/lib/sbsm/state.rb:243:in `new'
	/home/niklaus/git/sbsm/lib/sbsm/state.rb:243:in `view'
	/home/niklaus/git/sbsm/lib/sbsm/state.rb:176:in `to_html'
	/home/niklaus/git/sbsm/lib/sbsm/session.rb:548:in `to_html'
	/home/niklaus/git/sbsm/lib/sbsm/session.rb:280:in `block in process_rack'
	/home/niklaus/git/sbsm/lib/sbsm/session.rb:209:in `synchronize'
	/home/niklaus/git/sbsm/lib/sbsm/session.rb:209:in `process_rack'
	/home/niklaus/git/sbsm/lib/sbsm/app.rb:127:in `call'

After fixing this missing variable declaration and some other stuff http://localhost:8812/fr/gcc/patinfo/reg/66261/seq/01/pack/001 has the field "Afficher les changement". But the CSS is wrong, as the fields behind have a white background.

When following the link to /fr/gcc/show/patinfo/66261/diff it cannot display the information. We must probably correct the state. Had to correct calculating/using the request_url for patinfo diffs in various places. They are more complicated than the fachinfo, because they (maybe) specific to a package and not to a registration. Now a changelog is shown.

Tomorrow I will fix the CSS issue show below

view · edit · sidebar · attach · print · history
Page last modified on August 22, 2017, at 05:04 PM