Kaletra shows up, because search_sequences shows up als inactive sequences as show via bin/admin
ch.oddb> search_sequences('Kaletra').collect{|x| [x.iksnr, x.seqnr, x.atc_class.code,]} -> [["57555", "02", "J05AR10"], ["55648", "01", "J05AE06"], ["55649", "01", "J05AR10"], ["57555", "01", "J05AR10"]] ch.oddb> registration('55648').active? -> false ch.oddb> retrieve_from_index('sequence_index_exact', 'kaletra').find_all{|seq| true}.collect{|x| x.atc_class.code} -> ["J05AR10", "J05AE06", "J05AR10", "J05AR10"] ch.oddb> retrieve_from_index('sequence_index_exact', 'kaletra').find_all{|seq| seq.active?}.collect{|x| x.atc_class.code}.uniq -> ["J05AR10"] ch.oddb> retrieve_from_index('sequence_index_exact', 'kaletra').find_all{|seq| true}.collect{|x| x.atc_class.code}.uniq -> ["J05AR10", "J05AE06"] ch.oddb> search_oddb('Kaletra', 'de').atc_classes.collect{|x| x.code} -> ["J05AR10", "J05AE06"]
The problem can probably fixed by replacing in util/oddbapp retrieve_from_index(index, query)
by retrieve_from_index(index, query).find_all{|seq| seq.active?}
in the method search_sequences
Oh no, I found another inconsitency via bin/admin
ch.oddb> atc_class('J05AE06').sequences.collect{|x| [x.iksnr, x.active?, x.atc_class.code]} -> [["55649", true, "J05AR10"], ["57555", true, "J05AR10"], ["57555", true, "J05AR10"]] ch.oddb> atc_classes.select{|key, hash| key == "J05AE06" }.each{|key, value| value.sequences.find_all{|x| x.atc_class.code != key}} -> {"J05AE06"=>#<ODBA::Stub:54073520#12958 @odba_class= @odba_container=50625600#17>}
I think the following bin/admin command will fix the problem
ch.oddb> puts Time.now; atc_classes.each{|key, value| value.sequences.delete_if{|x| x.atc_class.code != key}; \ value.odba_isolated_store; puts value.code}; put Time.now -> {"J05AE06"=>#<ODBA::Stub:54073520#12958 @odba_class= @odba_container=50625600#17>} atc_classes.each{|key, value| value.sequences.delete_if{|x| x.atc_class.code != key}; value.odba_isolated_store}; atc_classes.odba_store
Added changes in mode, test/model, validator and plugin/who. Running jobs/import_whocc
to see whether it works. Before the import bin/admin reports
ch.oddb> atc_classes.values.find_all{|x| x.origin == nil}.size -> 7668 ch.oddb> atc_classes.size -> 7668
After the import we get
ch.oddb> atc_classes.values.find_all{|x| x.origin == nil}.size -> 4671 ch.oddb> atc_classes.values.find_all{|x| x.origin == :whocc}.size -> 2990 ch.oddb> atc_classes.size -> 7661
Running jobs/update_textinfo_swissmedicinfo --target=fi --reparse 3051 63242 65065 58943 65330 65512
. Then resetting xml/xlsx to state of end of august and running import_daily to check for problems.
Done with commit Remove explain FI for evidentia
Running jobs/update_textinfo_swissmedicinfo --target=both --reparse 63051 63242 65065 58943 65330 65512. Then reparse all.
Reparsing all failed, because I went into the pry debugger in the fiparsed process. Fixed this error and restarting again. Extracting the ATC-Code seems to work fine. Choked with another error after 42 FI.
Now running jobs/update_textinfo_swissmedicinfo --target=fi --reparse
updated already over 100 registrations. Waiting for the job to be finished.
The job finished, but we still have problems with Ofev. Symptoms are that the registration is very incomplete (no name_base, no sequences, therefor alos atc_classes). Looking at this problem. Iksnr 65330 Ofev appeared first 2015-08-31 in the AipsDownload, but the job atc_less did not update it correctly. In the log/oddb/2015/08.log I find the following entry
2015-08-31 07:12:59 +0200: /var/www/oddb.org/src/plugin/text_info.rb:611:in `create_registration': Updating sequence 65330. seq_args {:composition_text=>nil, :name_base=>"Ofev\u00AE", :name_descr=>nil, :dose=>nil, :sequence_date=>nil, :export_flag=>nil, :atc_class=>"L01XE31", :packages=>{ "000"=>#<ODDB::Package:0x0000000cb4f850 @revision=2015-08-31 07:12:59 +0200, @odba_id=34180282, @oid=34180282, @ikscd="000", @parts=[ #<ODDB::Part:0x0000000cb4f508 @revision=2015-08-31 07:12:59 +0200, @odba_id=34180283, @oid=34180283, @package=#<ODDB::Package:0x0000000cb4f850 ...>>], @mail_order_prices=[], @feedbacks=[], @sequence=>}}
As described under atc-codes-inconsistent and search-error I must analyse this problem carefully and refactor the db updates.
Banging my head to answer the question why in src/model/registration.rg the method delete_sequence(seqnr)
calls @sequences.odba_isolated_store
but neither create_sequence
nor create_patent
does anything similar. Also the methode add/delete_registrations in registration_observer are only used in company,indication, minifi, fachinfo.
Links to the chapters should be written like this Attach::50918_Links_Fachinfo.pdf
Currently we have
Vollst. Fachinformation DDD Drucken Zusammens. Galen.Form Ind./Anw.mögl. Dos./Anw. Kontraind. Warn.hinw. Interakt. Schwangerschaft Fahrtücht. Unerw.Wirkungen Überdos. Eigensch. Pharm.kinetik Präklin. Sonstige H. Swissmedic-Nr. Packungen Reg.Inhaber Stand d. Info.
Changed it. Also I must suppress the link to the DDD.
If Evidentia wants "Drucken" to appear bold, they should adapt the CSS definition for the class chapter-tab bold
Fixed with commit Update FI chapters for evidentia
Commits from yesterday removed all links from the name base field of the price comparision. This was not in the smoketest-spec. Fixed with commit Correct link for name_base