view · edit · sidebar · attach · print · history

20111116-translate-fachinfo-debug-missing-active_agent-oddb_org

<< | Index | >>


  1. Translation Fachinformation view
  2. Debug missing active agents
  3. Debug Package#compositions '+' link suspend
  4. Debug missing search result

Goal/Estimate/Evaluation
  • Debug missing active agents / 70% / 100%
Milestones
  1. Translation Fachinformation view
  2. Debug missing active agents
Commit

Translation Fachinformation view

Email

Commit

Debug missing active agents

Summary

  • The 'Wirkstoff' column of 'Donepezil Actavis' is null in Packungen.xls
  • In this case, Package#compositions is not set in update_swissmedic
  • We can set Package#compositions in Package view after settting 'Wirfstoff' of Sequence in Sequence view.
If the Swissmedic-Importer finds no data in Column O of Packungen.xls
then the active agent information will not be saved and also the
package information will not be saved. You will have to add the active
agent manually and also you will have to hit the "save" button in the
package information manually for the product to show up in the search
result. That will also make the active agent show up in the search
result of "Neue Registrierungen" . This happend in November 2011 with
Donepezil Actavis because Packungen.xls contained no data in the
column O.

Debug Package#compositions '+' link

Problem

  • '+' button in Admin Package view does not work

Note

  • This is related to pointer link

Replace

Updates

  • src/state/admin/package.rb
 def check_model
    #if(@model.pointer != @session.user_input(:pointer))
    #  @errors.store :pointer, create_error(:e_state_expired, :pointer, nil)
    #elsif !allowed?
    unless iksnr = @session.user_input(:reg) and seqnr = @session.user_input(:seq) and ikscd = @session.user_input(:pack)\
      and reg = @session.app.registration(iksnr) and seq = reg.sequence(seqnr) and pac = seq.package(ikscd)\
      and @model.pointer == pac.pointer
      @errors.store :pointer, create_error(:e_state_expired, :pointer, nil)
    end
    if !allowed?
      @errors.store :pointer, create_error(:e_not_allowed, :pointer, nil)
    end
 end
  • src/view/admin/package.rb
 def add(model)
    link = HtmlGrid::Link.new(:plus, model, @session, self)
    link.set_attribute('title', @lookandfeel.lookup(:create_part))
    link.css_class = 'create square'
    #args = [ :pointer, @session.state.model.pointer ]
    args = [ :reg, @session.state.model.iksnr, :seq, @session.state.model.seqnr, :pack, @session.state.model.ikscd ]
    url = @session.lookandfeel.event_url(:ajax_create_part, args)
    link.onclick = "replace_element('#{css_id}', '#{url}');"
    link
 end

Debub '-' link

Updates

  • src/state/admin/package.rb
 def ajax_delete_part
    check_model
    #keys = [:pointer, :part]
    keys = [:reg, :seq, :pack, :part]
    input = user_input(keys, keys)
    if(!error?        && (part = @model.parts[input[:part].to_i]))
      @session.app.delete part.pointer
    end
    AjaxParts.new(@session, @model.parts)
 end
  • src/view/admin/package.rb
 def delete(model)
    if(@model.size > 1)
      link = HtmlGrid::Link.new(:minus, model, @session, self)
      link.set_attribute('title', @lookandfeel.lookup(:delete))
      link.css_class = 'delete square'
      #args = [ :pointer, @session.state.model.pointer, :part, @list_index ]
      args = [ :reg, @session.state.model.iksnr, :seq, @session.state.model.seqnr, :pack, @session.state.model.ikscd, :part, @list_index ]
      url = @session.lookandfeel.event_url(:ajax_delete_part, args)
      link.onclick = "replace_element('#{css_id}', '#{url}');"
      link
    end
 end

suspend

Debug missing search result

Email

Problem

  • 'Donepezil Actavis' is not shown in the drug search result even though it is shown in the recent registration view

Experiment

ch.oddb> search_by_sequence('donepezil')
-> Donepezil
ch.oddb> search_by_sequence('donepezil').class
-> Array
ch.oddb> search_by_sequence('donepezil').length
-> 1
ch.oddb> search_by_sequence('donepezil').first.class
-> ODDB::AtcClass

ch.oddb> search_by_sequence('donepezil').first.packages.select{|pac| pac.name =~ /Donepezil Actavis/}.length
-> 8
ch.oddb> search_by_sequence('donepezil').first.active_packages.select{|pac| pac.name =~ /Donepezil Actavis/}.length
-> 0

ch.oddb> search_by_sequence('donepezil').first.packages.select{|pac| pac.name =~ /Donepezil Actavis/}[6].odba_id
-> 27652198
ch.oddb> registration('61815').sequence('02').package('026').public?
-> true
ch.oddb> registration('61815').sequence('02').package('026')
-> #<ODDB::Package:0x7f5a15661950>
ch.oddb> registration('61815').sequence('02').package('026').name
-> Donepezil Actavis 10 mg, Filmtabletten
ch.oddb> registration('61815').sequence('02').package('026').public?
-> true
ch.oddb> registration('61815').sequence('02').package('026').odba_id
-> 27652198
ch.oddb> registration('61815').sequence('02').public?
-> false
ch.oddb> registration('61815').public?
-> true
ch.oddb> registration('61815').sequence('02').package('026').public?
-> true
  • src/model/sequence.rb
    def public?
      !@export_flag && @registration.public? && active?
    end

Experiment

ch.oddb> registration('61815').sequence('02').export_flag.class
-> NilClass
ch.oddb> registration('61815').public?
-> true
ch.oddb> registration('61815').sequence('02').active?
-> false
  • src/model/sequence.rb
    def active?
      (!@inactive_date || (@inactive_date > @@two_years_ago)) \
        && @registration && @registration.active? && !violates_patent?
    end

Experiment

ch.oddb> registration('61815').sequence('02').instance_variable_get('@inactive_date').class
-> NilClass
ch.oddb> registration('61815').active?
-> true
ch.oddb> registration('61815').sequence('02').violates_patent?
-> true

Interim summary

  • Donepezil Actavis 10 mg (61815 02 026) is public but the Sequence (61815 02) is NOT public
  • That is why the package is not shown in the search result
  • In order to make the sequence public, it is necessary to make violates_patent? false
  • But 'violates_patent?' method is so complicated that I cannot summarize it here in one line.

Next

  • How did the Sequence#public? become false?

Experiment

  • Restore
$ sudo -u postgres dropdb oddb.org; sudo -u postgres createdb -E UTF8 -T template0 oddb.org
$ zcat data/sql/oddb.org.20111111.sql.gz |psql -U postgres oddb.org

Search 'donepezil'

  • It is shown

Check

ch.oddb> registration('61815').sequence('02').public?
-> true

From Davatz-san

This seems to be related to:
  http://ch.oddb.org/de/gcc/drug/reg/61815 then see the checkbox
Wird ohne "Patent-unabhängig" aufgrund eines Patentkonflikts nicht angezeigt.
view · edit · sidebar · attach · print · history
Page last modified on November 17, 2011, at 07:19 AM