view · edit · sidebar · attach · print · history

Index>

20150922-atc-code-from-fi

Summary

  • Get the ATC code from the fachinfo, compare it to the atc in Packungen.xlsx(if present) from Swissmedic and in refdata.xml(if present)
  • Add new method origin for atc_codes to be able to distinguis between code from who, swissmedic, refdata or unknown

Commits

Index

Keep in Mind for work to do
  • Fix dojo error http://www.sitepen.com/blog/2012/10/31/debugging-dojo-common-error-messages/#forgot-dom-ready
  • I removed on May-27 tests for ix_registrationss, fix_sequences, fix_compositions, fix_packages from test/test_plugin/swissmedic.rb,as he could not find any references for them in the src code. Did I erroneously remove stuff when cleaning up the swissmedic import earlier?
  • The whole test for older/newer Packages must be adapted to xlsx. One must compare the rows (e.g. by creating csv files) and do the same stuff in xlsx!
  • creat gem: task: input=file with ean-codes, standard output show ean-codes + atc-code. Source is Swissmedic Packungen.xlsx or XML.
  • Import via data/medreg_companies.yaml
  • Fix problem with radioactivatum 99m-technetio when parsing Wirkstoffe
  • Fix galenic_forms when parsing swissmedic.xlsx
  • Cleanup generic_type. Replace it everywhere by sl_generic_type and adapt code accordingly.
  • Get updated ATC-codes from EPha for oddb.org, too.
  • Use refdatabase for oddb.org, too.
  • Check whether we should revert the part which touche src/plugin/text_info.rb of commit 17af82ba4d76a5838683411b260de265531f9e74. We should improve test/stub/oddbapp.rb to work similar for update/pointer as the real oddbapp. In this case we would have a good Stub for plugins. May we need a different stub when working with plugins (which create/modify/destroy ODDB-Objects), when in most other cases a very simple stub is sufficient.
  • Create a history of FI changes and add a nice diff (colored) to compare any two versions. Look at gems like diffy or differ
  • Ofev (IKSNR 65330) has a not yet WHO-Approved ATC-Code L01XE31. The job atc_less should add the new ATC-Code with an empty name and flag it in its report for human intervention (e.g. extracting the substance name from the FI)

Fix problem with kaletra where two different ATC-codes (J05AE06 and J05AR10) are found

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

Add new method origin for atc_codes to be able to distinguis between code from who, swissmedic, refdata or unknown

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.

Remove FI=Fachinformation in legend for evidentia

Done with commit Remove explain FI for evidentia

Get the ATC code from the fachinfo, compare it to the atc in Packungen.xlsx(if present) from Swissmedic and in refdata.xml(if present)

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.

Evidentia wants different names for the chapters displayed in the info

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

view · edit · sidebar · attach · print · history
Page last modified on September 23, 2015, at 04:24 PM