view · edit · sidebar · attach · print · history

20100924-check-sl_entry

<< Masa.20100927-search-link-between_sl_entry_and_limitation_text | 2010 | Masa.20100923-trace-limitation-data-flow-in-oddbapp >>


  1. Brain Storming last night
  2. Confirm bsv_xml.rb again
  3. Trace SlEntry when 'L' returns
  4. Hypothesis testing
  5. Check ODDB::Persistence::Pointer#update_values
  6. Forcibly making connection between sl_entry and limitation_text

Goal
  • Trace limitation data flow in oddbapp.rb / 80%
Milestones
  1. Confirm the update problem yesterday 12:00
  2. Check ODDB::App#create method regarding LimitationText suspend
  3. Check ODDB::Persistence::Point#diff method 15:30
  4. Check ODDB::Persistence::Pointer#update_values 16:30
Summary
Commits
ToDo Tomorrow
Keep in Mind
  • emerge --sync
  1. Dimdi-Import-Error.
Attached Files

Brain Storming last night

  • 'grep -r create_limitation_text' tells me that there is no method to call create_limitation_text method
  • There seems to be no method to create a LimitationText instance of SlEntry class from ODDB::App#update method
  • ODDB::App#create method looks to create a new instance via calling ODDB::Persistence::Pointer#issue_create method
  • My hypothesis is there is a creating method other than bsv_xml.rb

grep search

masa@masa ~/ywesee/oddb.org $ grep -r create_limitation_text src
src/model/analysis/position.rb:                 def create_limitation_text
src/model/index_therapeuticus.rb:    def create_limitation_text
src/model/migel/group.rb:                       def create_limitation_text
src/model/migel/product.rb:                     def create_limitation_text
src/model/migel/subgroup.rb:                    def create_limitation_text
src/model/slentry.rb:           def create_limitation_text

masa@masa ~/ywesee/oddb.org $ grep -r @app.create src
src/plugin/analysis.rb:                 @app.create(ptr)
src/plugin/bsv_xml.rb:            group = @app.create @pointer
src/plugin/bsv_xml.rb:          comp = @app.create cptr
src/plugin/interaction.rb:                                      cyp450 = @app.create(pointer)
src/plugin/swissmedic.rb:        comp ||= @app.create(seq.pointer + :composition)
src/plugin/swissmedic.rb:        part ||= @app.create(package.pointer + :part)
src/plugin/vaccines.rb:          atc = @app.create(Persistence::Pointer.new([:atc_class, code]))
src/util/updater.rb:                    logs = @app.create(logs_pointer)
src/util/updater.rb:              @app.create(logs_pointer + [:log, latest >> 1])
src/util/updater.rb:                    logs = @app.create(logs_pointer)
src/util/updater.rb:      logs = @app.create(logs_pointer)
src/util/updater.rb:                    logs = @app.create(logs_pointer)

masa@masa ~/ywesee/oddb.org $ grep -r "def issue_create" src
src/util/persistence.rb:                        def issue_create(app)

masa@masa ~/ywesee/oddb.org $ grep -r "issue_create" src
src/util/oddbapp.rb:                    if(item = pointer.issue_create(self))
src/util/persistence.rb:                        def issue_create(app)
src/util/persistence.rb:                                # Only the hook must be stored in issue_create

Confirm bsv_xml.rb again

Procedure

  1. confirm the default result (55972 with 'L' and 56107 without 'L')
  2. delete entries in Preparation.xml except for 55972 and 56107
  3. run update_bsv
  4. (not reboot oddbd)
  5. run the search http://oddb.masa.org/en/gcc/search/zone/drugs/search_query/Isotretinoin/
    • 'NoMethodError undefined method `limitation_text' for nil:NilClass' on the screen
    • the following on the log of oddbd
ODDB::View::Drugs::RootResultList::COMPONENTS[[1, 0]] in create(limitation_text)
ODDB::View::Drugs::ResultComposite::COMPONENTS[[0, 2]] in create(ODDB::View::Drugs::RootResultList)
ODDB::View::Drugs::Result::COMPONENTS[[0, 2]] in create(content)
  1. reboot oddbd
  2. delete two Preparation entries, 55972009 and 55972013, from Preparation.xml
  3. run update_bsv
    • 'NoMethodError undefined method `limitation_text' for nil:NilClass' on the screen
  4. reboot oddbd
  5. confirm 'L' disappers for 55972009 and 55972013, and the category bocomes 'A', not 'A / SL / SG'.
  6. add two Preparation entries, 55972009 and 55972013, again
  7. run update_bsv
  8. confirm the result and nothing changes
  9. reboot oddbd
  10. @@confirm the result, 'L' still not appears but category returns back 'A / SL / SG'
  11. delete only the limitation entry for 55972013 and 55972015
  12. run update_bsv
  13. the result nothing changes
  14. reboot oddbd
  15. confirm the result and 'L' disappers but category does not change

Summary

  • If I delete Preparation entry from Preparation.xml, 'L' never returns back
  • If I delete only Limitation entry, 'L' can return back

Trace SlEntry when 'L' returns

Default condition

before

after

Experiment
Check ODBA Cache data in the process from 'before' to 'after' src/plugin/bsv_xml.rb

print "pointer="
p pointer
print "========== ODBA Cache ==========\n"
sl = pointer.creator.resolve @app
pp sl
                @app.update pointer.creator, sl_data, :bag

Result

pointer=#<ODDB::Persistence::Pointer:0x7f3c81fb6bd8 @directions=[[:registration, "55972"], [:sequence, "03"], [:package, "019"], [:sl_entry]]>
========== ODBA Cache ==========
#<ODDB::SlEntry:0x7f3c81fafc48
 @bsv_dossier="17846",
 @data_origins=
  {"status"=>:bag,
   "introduction_date"=>:bag,
   "valid_from"=>:bag,
   "limitation_points"=>:bag,
   "limitation"=>:bag,
   "valid_until"=>:bag,
   "bsv_dossier"=>:bag},
 @introduction_date=Sun, 01 Jul 2007,
 @limitation=nil,
 @limitation_points=nil,
 @limitation_text=nil,
 @odba_id=1271980,
 @odba_observers=[],
 @odba_persistent=true,
 @oid=1271980,
 @pointer=
  #<ODDB::Persistence::Pointer:0x7f3c81faf0b8
   @directions=
    [[:registration, "55972"],
     [:sequence, "03"],
     [:package, "019"],
     [:sl_entry]]>,
 @revision=Fri Sep 24 10:10:46 +0200 2010,
 @status="0",
 @valid_from=Sun, 01 Jul 2007,
 @valid_until=Fri, 31 Dec 9999>

pointer=#<ODDB::Persistence::Pointer:0x7f3c81f81690 @directions=[[:registration, "55972"], [:sequence, "03"], [:package, "017"], [:sl_entry]]>
========== ODBA Cache ==========
#<ODDB::SlEntry:0x7f3c81f7b128
 @bsv_dossier="17846",
 @data_origins=
  {"status"=>:bag,
   "introduction_date"=>:bag,
   "valid_from"=>:bag,
   "limitation_points"=>:bag,
   "limitation"=>:bag,
   "valid_until"=>:bag,
   "bsv_dossier"=>:bag},
 @introduction_date=Sun, 01 Jul 2007,
 @limitation=nil,
 @limitation_points=nil,
 @limitation_text=nil,
 @odba_id=1271979,
 @odba_observers=[],
 @odba_persistent=true,
 @oid=1271979,
 @pointer=
  #<ODDB::Persistence::Pointer:0x7f3c81f7a5c0
   @directions=
    [[:registration, "55972"],
     [:sequence, "03"],
     [:package, "017"],
     [:sl_entry]]>,
 @revision=Fri Sep 24 10:10:46 +0200 2010,
 @status="0",
 @valid_from=Sun, 01 Jul 2007,
 @valid_until=Fri, 31 Dec 9999>

Difference

  • limitation_text = nil !?

Confirm
src/plugin/bsv_xml.rb

print "\npointer="
p pointer
print "========== sl_data ==========\n"
pp sl_data
                @app.update pointer.creator, sl_data, :bag

Result

pointer=#<ODDB::Persistence::Pointer:0x7f23b91fc168 @directions=[[:registration, "55972"], [:sequence, "03"], [:package, "017"], [:sl_entry]]>
========== sl_data ==========
{:bsv_dossier=>"17846",
 :limitation_points=>nil,
 :status=>"0",
 :introduction_date=>Sun, 01 Jul 2007,
 :limitation=>true,
 :valid_until=>Fri, 31 Dec 9999,
 :valid_from=>Sun, 01 Jul 2007}

pointer=#<ODDB::Persistence::Pointer:0x7f23b9085b18 @directions=[[:registration, "56107"], [:sequence, "01"], [:package, "004"], [:sl_entry]]>
========== sl_data ==========
{:bsv_dossier=>"17885",
 :limitation_points=>nil,
 :status=>"0",
 :introduction_date=>Thu, 01 May 2003,
 :limitation=>true,
 :valid_until=>Fri, 31 Dec 9999,
 :valid_from=>Thu, 01 May 2003}

Notes

  • There looks no difference

Confirm
src/util/persistence.rb

      def issue_update(hook, values, origin = nil)
        obj = resolve(hook)
        unless(obj.nil?)
          diff = obj.diff(values, hook)
print "obj.class=", obj.class, "\n"
print "diff="
pp diff
          unless diff.empty?
            obj.update_values(diff, origin)
            obj.odba_store
          end
        end
        obj
      end

Result

obj.class=ODDB::Sequence
diff={}
obj.class=ODDB::Package
diff={}
obj.class=ODDB::Sequence
diff={}
obj.class=ODDB::Package
diff={}

pointer=#<ODDB::Persistence::Pointer:0x7f451084d788 @directions=[[:registration, "55972"], [:sequence, "03"], [:package, "019"], [:sl_entry]]>
obj.class=ODDB::SlEntry
diff={:limitation_points=>nil, :limitation=>true}


pointer=#<ODDB::Persistence::Pointer:0x7f4510832140 @directions=[[:registration, "55972"], [:sequence, "03"], [:package, "017"], [:sl_entry]]>
obj.class=ODDB::SlEntry
diff={:limitation_points=>nil, :limitation=>true}
obj.class=ODDB::LimitationText
diff={:de=>
  #<ODDB::Text::Chapter:0x7f451086e258
   @heading="",
   @sections=
    [#<ODDB::Text::Section:0x7f451086e140
      @paragraphs=
       [#<ODDB::Text::Paragraph:0x7f451086de70
         @format=
          #<ODDB::Text::Format:0x7f451086dce0 @end=-1, @start=0, @values=[]>,
         @formats=
          [#<ODDB::Text::Format:0x7f451086dce0 @end=-1, @start=0, @values=[]>],
         @preformatted=false,
         @raw_txt=nil,
         @text="Schwere, therapieresistente Akneformen.">],
      @subheading="Isotretinoin Mepha\n">]>,
 :fr=>
  #<ODDB::Text::Chapter:0x7f451086c570
   @heading="",
   @sections=
    [#<ODDB::Text::Section:0x7f451086c458
      @paragraphs=
       [#<ODDB::Text::Paragraph:0x7f451086c318
         @format=
          #<ODDB::Text::Format:0x7f451086c1d8 @end=-1, @start=0, @values=[]>,
         @formats=
          [#<ODDB::Text::Format:0x7f451086c1d8 @end=-1, @start=0, @values=[]>],
         @preformatted=false,
         @raw_txt=nil,
         @text=
          "Formes graves de l'acn\303\251, r\303\251sistantes \303\240 la th\303\251rapie.">],
      @subheading="Isotretinoine Mepha\n">]>,
 :it=>
  #<ODDB::Text::Chapter:0x7f451086abf8
   @heading="",
   @sections=
    [#<ODDB::Text::Section:0x7f451086ab08
      @paragraphs=
       [#<ODDB::Text::Paragraph:0x7f451086a9f0
         @format=
          #<ODDB::Text::Format:0x7f451086a888 @end=-1, @start=0, @values=[]>,
         @formats=
          [#<ODDB::Text::Format:0x7f451086a888 @end=-1, @start=0, @values=[]>],
         @preformatted=false,
         @raw_txt=nil,
         @text="Forme gravi di acne, resistenti alla terapia.">],
      @subheading="Isotretinoine Mepha\n">]>}
obj.class=ODDB::LimitationText
diff={:de=>
  #<ODDB::Text::Chapter:0x7f451086e2f8
   @heading="",
   @sections=
    [#<ODDB::Text::Section:0x7f451086d8d0
      @paragraphs=
       [#<ODDB::Text::Paragraph:0x7f451086d7b8
         @format=
          #<ODDB::Text::Format:0x7f451086d678 @end=-1, @start=0, @values=[]>,
         @formats=
          [#<ODDB::Text::Format:0x7f451086d678 @end=-1, @start=0, @values=[]>],
         @preformatted=false,
         @raw_txt=nil,
         @text="Schwere, therapieresistente Akneformen.">],
      @subheading="Isotretinoin Mepha\n">]>,
 :fr=>
  #<ODDB::Text::Chapter:0x7f451086c5e8
   @heading="",
   @sections=
    [#<ODDB::Text::Section:0x7f451086be90
      @paragraphs=
       [#<ODDB::Text::Paragraph:0x7f451086bd78
         @format=
          #<ODDB::Text::Format:0x7f451086bc38 @end=-1, @start=0, @values=[]>,
         @formats=
          [#<ODDB::Text::Format:0x7f451086bc38 @end=-1, @start=0, @values=[]>],
         @preformatted=false,
         @raw_txt=nil,
         @text=
          "Formes graves de l'acn\303\251, r\303\251sistantes \303\240 la th\303\251rapie.">],
      @subheading="Isotretinoine Mepha\n">]>,
 :it=>
  #<ODDB::Text::Chapter:0x7f451086ac70
   @heading="",
   @sections=
    [#<ODDB::Text::Section:0x7f451086a568
      @paragraphs=
       [#<ODDB::Text::Paragraph:0x7f451086a450
         @format=
          #<ODDB::Text::Format:0x7f451086a2e8 @end=-1, @start=0, @values=[]>,
         @formats=
          [#<ODDB::Text::Format:0x7f451086a2e8 @end=-1, @start=0, @values=[]>],
         @preformatted=false,
         @raw_txt=nil,
         @text="Forme gravi di acne, resistenti alla terapia.">],
      @subheading="Isotretinoine Mepha\n">]>}
obj.class=ODDB::Registration
diff={}





obj.class=ODDB::Sequence
diff={}
obj.class=ODDB::Package
diff={}
obj.class=ODDB::Sequence
diff={}
obj.class=ODDB::Package
diff={}

pointer=#<ODDB::Persistence::Pointer:0x7f4510678ed0 @directions=[[:registration, "56107"], [:sequence, "01"], [:package, "004"], [:sl_entry]]>
obj.class=ODDB::SlEntry
diff={:limitation_points=>nil}

pointer=#<ODDB::Persistence::Pointer:0x7f4510662c48 @directions=[[:registration, "56107"], [:sequence, "01"], [:package, "002"], [:sl_entry]]>
obj.class=ODDB::SlEntry
diff={:limitation_points=>nil}
obj.class=ODDB::LimitationText
diff={}
obj.class=ODDB::LimitationText
diff={}
obj.class=ODDB::Registration
diff={}

Notes

  • ODDB::Persistence::Pointer#diff create SlEntry differences
  • 55972: :limitation=false => :limitation=true, :limitation_text=nil => :limitation_text=<object>
  • 56107: :limitation=ture
  • 55972: detects the difference of limitation_text
  • 56107: does not detect the difference of limitation_text

Check
src/plugin/bsv_xml.rb

print "txt_ptr="
p txt_ptr
print "========== lim_data ==========\n"
pp lim_data
                @app.update txt_ptr.creator, lim_data, :bag

Result

pointer=#<ODDB::Persistence::Pointer:0x7fd90412fb80 @directions=[[:registration, "55972"], [:sequence, "03"], [:package, "019"], [:sl_entry]]>

pointer=#<ODDB::Persistence::Pointer:0x7fd904118160 @directions=[[:registration, "55972"], [:sequence, "03"], [:package, "017"], [:sl_entry]]>
txt_ptr=#<ODDB::Persistence::Pointer:0x7fd9041017d0 @directions=[[:registration, "55972"], [:sequence, "03"], [:package, "019"], [:sl_entry], [:limitation_text]]>
========== lim_data ==========
{:de=>
  #<ODDB::Text::Chapter:0x7fd9041501a0
   @heading="",
   @sections=
    [#<ODDB::Text::Section:0x7fd904150060
      @paragraphs=
       [#<ODDB::Text::Paragraph:0x7fd90414fef8
         @format=
          #<ODDB::Text::Format:0x7fd90414fc78 @end=-1, @start=0, @values=[]>,
         @formats=
          [#<ODDB::Text::Format:0x7fd90414fc78 @end=-1, @start=0, @values=[]>],
         @preformatted=false,
         @raw_txt=nil,
         @text="Schwere, therapieresistente Akneformen.">],
      @subheading="Isotretinoin Mepha\n">]>,
 :fr=>
  #<ODDB::Text::Chapter:0x7fd90414e620
   @heading="",
   @sections=
    [#<ODDB::Text::Section:0x7fd90414e530
      @paragraphs=
       [#<ODDB::Text::Paragraph:0x7fd90414e418
         @format=
          #<ODDB::Text::Format:0x7fd90414e2d8 @end=-1, @start=0, @values=[]>,
         @formats=
          [#<ODDB::Text::Format:0x7fd90414e2d8 @end=-1, @start=0, @values=[]>],
         @preformatted=false,
         @raw_txt=nil,
         @text=
          "Formes graves de l'acn\303\251, r\303\251sistantes \303\240 la th\303\251rapie.">],
      @subheading="Isotretinoine Mepha\n">]>,
 :it=>
  #<ODDB::Text::Chapter:0x7fd90414cca8
   @heading="",
   @sections=
    [#<ODDB::Text::Section:0x7fd90414cbb8
      @paragraphs=
       [#<ODDB::Text::Paragraph:0x7fd90414ca78
         @format=
          #<ODDB::Text::Format:0x7fd90414c8c0 @end=-1, @start=0, @values=[]>,
         @formats=
          [#<ODDB::Text::Format:0x7fd90414c8c0 @end=-1, @start=0, @values=[]>],
         @preformatted=false,
         @raw_txt=nil,
         @text="Forme gravi di acne, resistenti alla terapia.">],
      @subheading="Isotretinoine Mepha\n">]>}
txt_ptr=#<ODDB::Persistence::Pointer:0x7fd9040ab308 @directions=[[:registration, "55972"], [:sequence, "03"], [:package, "017"], [:sl_entry], [:limitation_text]]>
========== lim_data ==========
{:de=>
  #<ODDB::Text::Chapter:0x7fd904150218
   @heading="",
   @sections=
    [#<ODDB::Text::Section:0x7fd90414f958
      @paragraphs=
       [#<ODDB::Text::Paragraph:0x7fd90414f818
         @format=
          #<ODDB::Text::Format:0x7fd90414f6b0 @end=-1, @start=0, @values=[]>,
         @formats=
          [#<ODDB::Text::Format:0x7fd90414f6b0 @end=-1, @start=0, @values=[]>],
         @preformatted=false,
         @raw_txt=nil,
         @text="Schwere, therapieresistente Akneformen.">],
 :fr=>
  #<ODDB::Text::Chapter:0x7fd90414e6c0
   @heading="",
   @sections=
    [#<ODDB::Text::Section:0x7fd90414dfb8
      @paragraphs=
       [#<ODDB::Text::Paragraph:0x7fd90414dea0
         @format=
          #<ODDB::Text::Format:0x7fd90414dd60 @end=-1, @start=0, @values=[]>,
         @formats=
          [#<ODDB::Text::Format:0x7fd90414dd60 @end=-1, @start=0, @values=[]>],
         @preformatted=false,
         @raw_txt=nil,
         @text=
          "Formes graves de l'acn\303\251, r\303\251sistantes \303\240 la th\303\251rapie.">],
      @subheading="Isotretinoine Mepha\n">]>,
 :it=>
  #<ODDB::Text::Chapter:0x7fd90414cd48
   @heading="",
   @sections=
    [#<ODDB::Text::Section:0x7fd90414c438
      @paragraphs=
       [#<ODDB::Text::Paragraph:0x7fd90414c280
         @format=
          #<ODDB::Text::Format:0x7fd90414c0c8 @end=-1, @start=0, @values=[]>,
         @formats=
          [#<ODDB::Text::Format:0x7fd90414c0c8 @end=-1, @start=0, @values=[]>],
         @preformatted=false,
         @raw_txt=nil,
         @text="Forme gravi di acne, resistenti alla terapia.">],
      @subheading="Isotretinoine Mepha\n">]>}
pointer=#<ODDB::Persistence::Pointer:0x7fd903f4dfb0 @directions=[[:registration, "56107"], [:sequence, "01"], [:package, "004"], [:sl_entry]]>

pointer=#<ODDB::Persistence::Pointer:0x7fd903f39f88 @directions=[[:registration, "56107"], [:sequence, "01"], [:package, "002"], [:sl_entry]]>
txt_ptr=#<ODDB::Persistence::Pointer:0x7fd903f250b0 @directions=[[:registration, "56107"], [:sequence, "01"], [:package, "004"], [:sl_entry], [:limitation_text]]>
========== lim_data ==========
{:de=>
  #<ODDB::Text::Chapter:0x7fd903f6cd20
   @heading="",
   @sections=
    [#<ODDB::Text::Section:0x7fd903f6cb90
      @paragraphs=
       [#<ODDB::Text::Paragraph:0x7fd903f6ca00
         @format=
          #<ODDB::Text::Format:0x7fd903f6c7f8 @end=-1, @start=0, @values=[]>,
         @formats=
          [#<ODDB::Text::Format:0x7fd903f6c7f8 @end=-1, @start=0, @values=[]>],
         @preformatted=false,
         @raw_txt=nil,
         @text="Schwere, therapieresistente Akneformen.">],
      @subheading="Isotretinoin Teva\n">]>,
 :fr=>
  #<ODDB::Text::Chapter:0x7fd903f6aca0
   @heading="",
   @sections=
    [#<ODDB::Text::Section:0x7fd903f6abb0
      @paragraphs=
       [#<ODDB::Text::Paragraph:0x7fd903f6aa48
         @format=
          #<ODDB::Text::Format:0x7fd903f6a8b8 @end=-1, @start=0, @values=[]>,
         @formats=
          [#<ODDB::Text::Format:0x7fd903f6a8b8 @end=-1, @start=0, @values=[]>],
         @preformatted=false,
         @raw_txt=nil,
         @text=
          "Formes graves de l'acn\303\251, r\303\251sistantes \303\240 la th\303\251rapie.">],
      @subheading="Isotretinoin Teva\n">]>,
 :it=>
  #<ODDB::Text::Chapter:0x7fd903f68d38
   @heading="",
   @sections=
    [#<ODDB::Text::Section:0x7fd903f68c48
      @paragraphs=
       [#<ODDB::Text::Paragraph:0x7fd903f68b30
         @format=
          #<ODDB::Text::Format:0x7fd903f689a0 @end=-1, @start=0, @values=[]>,
         @formats=
          [#<ODDB::Text::Format:0x7fd903f689a0 @end=-1, @start=0, @values=[]>],
         @preformatted=false,
         @raw_txt=nil,
         @text="Forme gravi di acne, resistenti alla terapia.">],
      @subheading="Isotretinoin Teva\n">]>}
txt_ptr=#<ODDB::Persistence::Pointer:0x7fd903ef79f8 @directions=[[:registration, "56107"], [:sequence, "01"], [:package, "002"], [:sl_entry], [:limitation_text]]>
========== lim_data ==========
{:de=>
  #<ODDB::Text::Chapter:0x7fd903f6cde8
   @heading="",
   @sections=
    [#<ODDB::Text::Section:0x7fd903f6c438
      @paragraphs=
       [#<ODDB::Text::Paragraph:0x7fd903f6c2f8
         @format=
          #<ODDB::Text::Format:0x7fd903f6c1b8 @end=-1, @start=0, @values=[]>,
         @formats=
          [#<ODDB::Text::Format:0x7fd903f6c1b8 @end=-1, @start=0, @values=[]>],
         @preformatted=false,
         @raw_txt=nil,
         @text="Schwere, therapieresistente Akneformen.">],
      @subheading="Isotretinoin Teva\n">]>,
 :fr=>
  #<ODDB::Text::Chapter:0x7fd903f6ad40
   @heading="",
   @sections=
    [#<ODDB::Text::Section:0x7fd903f6a3b8
      @paragraphs=
       [#<ODDB::Text::Paragraph:0x7fd903f6a250
         @format=
          #<ODDB::Text::Format:0x7fd903f6a048 @end=-1, @start=0, @values=[]>,
         @formats=
          [#<ODDB::Text::Format:0x7fd903f6a048 @end=-1, @start=0, @values=[]>],
         @preformatted=false,
         @raw_txt=nil,
         @text=
          "Formes graves de l'acn\303\251, r\303\251sistantes \303\240 la th\303\251rapie.">],
      @subheading="Isotretinoin Teva\n">]>,
 :it=>
  #<ODDB::Text::Chapter:0x7fd903f68db0
   @heading="",
   @sections=
    [#<ODDB::Text::Section:0x7fd903f68680
      @paragraphs=
       [#<ODDB::Text::Paragraph:0x7fd903f68518
         @format=
          #<ODDB::Text::Format:0x7fd903f683d8 @end=-1, @start=0, @values=[]>,
         @formats=
          [#<ODDB::Text::Format:0x7fd903f683d8 @end=-1, @start=0, @values=[]>],
         @preformatted=false,
         @raw_txt=nil,
         @text="Forme gravi di acne, resistenti alla terapia.">],
      @subheading="Isotretinoin Teva\n">]>}

Notes

  • There is no difference of lim_data in both 55972 and 56107
  • Namely, lim_data and sl_data are the same but ODDB::App#diff detects the limitation_text diference only in the case of 55972
  • I guess the reason for that is ODDB::Persistence::Pointer#diff does not delete the old limitation_text data from ODBA cache
  • Next, I should check the difference between new and old limitation_text data in ODDB::Persistence::Pointer#diff

Hypothesis testing

src/util/persistence.rb

    def diff(values, app=nil, masa=nil)
      #adjust_types(values, app)
      result = {}
      adjust_types(values, app).each { |key, value|
        if(self.respond_to?(key))
          oldval = self.send(key)
if masa == ODDB::LimitationText
  print "key="
  pp key
  print "=========== oldval ==========\n"
  pp oldval
end
          if(oldval.nil? || undiffable?(oldval) || value != oldval)
            result.store(key, value)
          end
        end
      }
      result
    end

Result

pointer=#<ODDB::Persistence::Pointer:0x7fe03cc6fa10 @directions=[[:registration, "55972"], [:sequence, "03"], [:package, "019"], [:sl_entry]]>
obj.class=ODDB::SlEntry

pointer=#<ODDB::Persistence::Pointer:0x7fe03cc59cb0 @directions=[[:registration, "55972"], [:sequence, "03"], [:package, "017"], [:sl_entry]]>
obj.class=ODDB::SlEntry
obj.class=ODDB::LimitationText
key=:de
=========== oldval ==========
""
key=:fr
=========== oldval ==========
""
key=:it
=========== oldval ==========
""
obj.class=ODDB::LimitationText
key=:de
=========== oldval ==========
""
key=:fr
=========== oldval ==========
""
key=:it
=========== oldval ==========
""

pointer=#<ODDB::Persistence::Pointer:0x7fe03cad8e68 @directions=[[:registration, "56107"], [:sequence, "01"], [:package, "004"], [:sl_entry]]>
obj.class=ODDB::SlEntry

pointer=#<ODDB::Persistence::Pointer:0x7fe03cac41e8 @directions=[[:registration, "56107"], [:sequence, "01"], [:package, "002"], [:sl_entry]]>
obj.class=ODDB::SlEntry
obj.class=ODDB::LimitationText
key=:de
=========== oldval ==========
#<ODDB::Text::Chapter:0x7fe03caa9578
 @heading="",
 @sections=
  [#<ODDB::Text::Section:0x7fe03caa94b0
    @paragraphs=
     [#<ODDB::Text::Paragraph:0x7fe03caa9410
       @format=
        #<ODDB::Text::Format:0x7fe03caa92a8 @end=-1, @start=0, @values=[]>,
       @formats=
        [#<ODDB::Text::Format:0x7fe03caa92a8 @end=-1, @start=0, @values=[]>],
       @preformatted=false,
       @raw_txt=nil,
       @text="Schwere, therapieresistente Akneformen.">],
    @subheading="Isotretinoin Teva\n">]>
key=:fr
=========== oldval ==========
#<ODDB::Text::Chapter:0x7fe03caa9168
 @heading="",
 @sections=
  [#<ODDB::Text::Section:0x7fe03caa90c8
    @paragraphs=
     [#<ODDB::Text::Paragraph:0x7fe03caa9028
       @format=
        #<ODDB::Text::Format:0x7fe03caa8f60 @end=-1, @start=0, @values=[]>,
       @formats=
        [#<ODDB::Text::Format:0x7fe03caa8f60 @end=-1, @start=0, @values=[]>],
       @preformatted=false,
       @raw_txt=nil,
       @text=
        "Formes graves de l'acn\303\251, r\303\251sistantes \303\240 la th\303\251rapie.">],
    @subheading="Isotretinoin Teva\n">]>
key=:it
=========== oldval ==========
#<ODDB::Text::Chapter:0x7fe03caa9c80
 @heading="",
 @sections=
  [#<ODDB::Text::Section:0x7fe03caa9b40
    @paragraphs=
     [#<ODDB::Text::Paragraph:0x7fe03caa9a28
       @format=
        #<ODDB::Text::Format:0x7fe03caa98e8 @end=-1, @start=0, @values=[]>,
       @formats=
        [#<ODDB::Text::Format:0x7fe03caa98e8 @end=-1, @start=0, @values=[]>],
       @preformatted=false,
       @raw_txt=nil,
       @text="Forme gravi di acne, resistenti alla terapia.">],
    @subheading="Isotretinoin Teva\n">]>
obj.class=ODDB::LimitationText
key=:de
=========== oldval ==========
#<ODDB::Text::Chapter:0x7fe03ca7c4b0
 @heading="",
 @sections=
  [#<ODDB::Text::Section:0x7fe03ca7c410
    @paragraphs=
     [#<ODDB::Text::Paragraph:0x7fe03ca7c398
       @format=
        #<ODDB::Text::Format:0x7fe03ca7c320 @end=-1, @start=0, @values=[]>,
       @formats=
        [#<ODDB::Text::Format:0x7fe03ca7c320 @end=-1, @start=0, @values=[]>],
       @preformatted=false,
       @raw_txt=nil,
       @text="Schwere, therapieresistente Akneformen.">],
    @subheading="Isotretinoin Teva\n">]>
key=:fr
=========== oldval ==========
#<ODDB::Text::Chapter:0x7fe03ca7c208
 @heading="",
 @sections=
  [#<ODDB::Text::Section:0x7fe03ca7c168
    @paragraphs=
     [#<ODDB::Text::Paragraph:0x7fe03ca7c0f0
       @format=
        #<ODDB::Text::Format:0x7fe03ca7c078 @end=-1, @start=0, @values=[]>,
       @formats=
        [#<ODDB::Text::Format:0x7fe03ca7c078 @end=-1, @start=0, @values=[]>],
       @preformatted=false,
       @raw_txt=nil,
       @text=
        "Formes graves de l'acn\303\251, r\303\251sistantes \303\240 la th\303\251rapie.">],
    @subheading="Isotretinoin Teva\n">]>
key=:it
=========== oldval ==========
#<ODDB::Text::Chapter:0x7fe03ca7c9b0
 @heading="",
 @sections=
  [#<ODDB::Text::Section:0x7fe03ca7c898
    @paragraphs=
     [#<ODDB::Text::Paragraph:0x7fe03ca7c7d0
       @format=
        #<ODDB::Text::Format:0x7fe03ca7c708 @end=-1, @start=0, @values=[]>,
       @formats=
        [#<ODDB::Text::Format:0x7fe03ca7c708 @end=-1, @start=0, @values=[]>],
       @preformatted=false,
       @raw_txt=nil,
       @text="Forme gravi di acne, resistenti alla terapia.">],
    @subheading="Isotretinoin Teva\n">]>

Notes

  • The old values remain as I expected

Experiment
src/util/persistence.rb

    def diff(values, app=nil, masa=nil)
      #adjust_types(values, app)
      result = {}
      adjust_types(values, app).each { |key, value|
        if(self.respond_to?(key))
          oldval = self.send(key)

if masa == ODDB::LimitationText
  oldval = nil
end
          if(oldval.nil? || undiffable?(oldval) || value != oldval)
            result.store(key, value)
          end
        end
      }
      result
    end

Result

  • ODDB::Persistece::Point#diff works well
  • But failed

Therefore

  • Even if diff works, showing 'L' does not work
  • The bug must be different place

Consideration

  • The problem may be the connection between sl_entry and limitation_text
  • Once this connection is removed, it would never come back only by running update_bsv
  • If a Preparation entry is removed from Preparation.xml, this link seems to disappear
  • If a Limitation entry is removed from Preparation.xml, this link seems to remain
  • There is data of both slentry and limitation text in ODBA cache
  • Parsing and updating process of Preparation.xml look going well

Solution

  • The next target is: how to create the link between @sl_entry and qlimitation_text

Check ODDB::Persistence::Pointer#update_values

Experiment
src/util/persistence.rb

    def update_values(values, origin=nil)
      @revision = Time.now
      values.each { |key, value|
print "key=", key, "\n"
        key = key.to_s
        data_origins.store(key, origin)
        self.send(key + '=', value)
      }
    end

Result

pointer=#<ODDB::Persistence::Pointer:0x7f89de2b1f00 @directions=[[:registration, "55972"], [:sequence, "03"], [:package, "019"], [:sl_entry]]>
key=limitation_points
key=limitation

pointer=#<ODDB::Persistence::Pointer:0x7f89de29ad00 @directions=[[:registration, "55972"], [:sequence, "03"], [:package, "017"], [:sl_entry]]>
key=limitation_points
key=limitation

pointer=#<ODDB::Persistence::Pointer:0x7f89de138c00 @directions=[[:registration, "56107"], [:sequence, "01"], [:package, "004"], [:sl_entry]]>
key=limitation_points
key=limitation

pointer=#<ODDB::Persistence::Pointer:0x7f89de123ad0 @directions=[[:registration, "56107"], [:sequence, "01"], [:package, "002"], [:sl_entry]]>
key=limitation_points
key=limitation
key=report
key=parts
key=mail_from
key=report
key=recipients

Conclusion

  • update_bsv (src/util/bsv_xml.rb) does not update the @limitation_text of sl_entry object (the link between sl_entry and limitation_text)

Forcibly making connection between sl_entry and limitation_text

Experiment
src/plugin/bsv_xml.rb

                if (lim_data = @lim_texts[pac_ptr]) && !lim_data.empty?
                  sl_data.store :limitation, true
# experiment
txt_ptr = pack.sl_entry.pointer + :limitation_text
sl_data.store :limitation_text, txt_ptr.resolve(@app)
                end

Result

view · edit · sidebar · attach · print · history
Page last modified on July 13, 2011, at 11:58 AM