view · edit · sidebar · attach · print · history

< Niklaus.20171030-reparse-patinfo | Index | Niklaus.20171024-reparse-patinfo >>

20171025-oddb2xml-prices

Summary

  • Wrong prices in oddb_article.xml from ZurRose
  • Fix reparsing patinfo
  • Keep in Mind

Commits

Index

Fix reparsing patinfo

Corrected reading swissmedic-packungen.xlsx with commit Open correct xlsx file for update_compositions

Trying without calling odba_store in PatinfoDocument.add_change_log_item. Dropping and reloading database to verify that it works as intended.

Now parsing works, but visiting the changelogs https://oddb-ci2.dyndns.org/de/gcc/show/patinfo/47909/01/015/diff/ throws

NoMethodError: undefined method `gsub' for #<ODDB::PatinfoDocument:0x007ffa258e1b48>
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/ydiffy-0.0.2/lib/diffy/diff.rb:64:in `diff'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/ydiffy-0.0.2/lib/diffy/diff.rb:88:in `each'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/ydiffy-0.0.2/lib/diffy/diff.rb:100:in `inject'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/ydiffy-0.0.2/lib/diffy/diff.rb:100:in `each_chunk'
        /var/www/oddb.org/src/view/drugs/change_logs.rb:132:in `nr_chunks'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:83:in `create'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:284:in `compose_component'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:213:in `block in compose'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `each'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `compose'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/list.rb:67:in `block in compose_list'
        /usr/local/ruby-2.4.0/lib/ruby/2.4.0/delegate.rb:83:in `each'
        /usr/local/ruby-2.4.0/lib/ruby/2.4.0/delegate.rb:83:in `each_with_index'
        /usr/local/ruby-2.4.0/lib/ruby/2.4.0/delegate.rb:83:in `method_missing'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/list.rb:65:in `compose_list'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/list.rb:54:in `compose'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:72:in `init'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/list.rb:129:in `init'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/component.rb:139:in `initialize'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:76:in `new'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:76:in `create'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:284:in `compose_component'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:213:in `block in compose'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `each'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `compose'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:72:in `init'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/component.rb:139:in `initialize'
        /var/www/oddb.org/src/view/drugs/change_logs.rb:162:in `initialize'
        /var/www/oddb.org/src/view/publictemplate.rb:71:in `new'
        /var/www/oddb.org/src/view/publictemplate.rb:71:in `content'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:83:in `create'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:284:in `compose_component'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:213:in `block in compose'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `each'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `compose'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:72:in `init'
        /var/www/oddb.org/src/view/publictemplate.rb:68:in `init'
        /var/www/oddb.org/src/view/privatetemplate.rb:17:in `init'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/component.rb:139:in `initialize'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.9/lib/sbsm/state.rb:241:in `new'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.9/lib/sbsm/state.rb:241:in `view'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.9/lib/sbsm/state.rb:174:in `to_html'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.9/lib/sbsm/session.rb:547:in `to_html'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.9/lib/sbsm/session.rb:279:in `block in process_rack'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.9/lib/sbsm/session.rb:209:in `synchronize'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.9/lib/sbsm/session.rb:209:in `process_rack'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.9/lib/sbsm/app.rb:127:in `call'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/lint.rb:49:in `_call'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/lint.rb:37:in `call'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/show_exceptions.rb:23:in `call'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/content_length.rb:15:in `call'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/static.rb:149:in `call'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/tempfile_reaper.rb:15:in `call'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/tempfile_reaper.rb:15:in `call'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/tempfile_reaper.rb:15:in `call'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/lint.rb:49:in `_call'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/lint.rb:37:in `call'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/show_exceptions.rb:23:in `call'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/chunked.rb:54:in `call'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/content_length.rb:15:in `call'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/rack-2.0.3/lib/rack/handler/webrick.rb:86:in `service'
        /usr/local/ruby-2.4.0/lib/ruby/2.4.0/webrick/httpserver.rb:140:in `service'
        /usr/local/ruby-2.4.0/lib/ruby/2.4.0/webrick/httpserver.rb:96:in `run'
        /usr/local/ruby-2.4.0/lib/ruby/2.4.0/webrick/server.rb:290:in `block in start_thread'
        ODDB::View::Drugs::ChangelogList::COMPONENTS[[1, 0]] in create(nr_chunks)
        ODDB::View::Drugs::ChangelogsComposite::COMPONENTS[[0, 0]] in create(ODDB::View::Drugs::ChangelogList)
        ODDB::View::Drugs::DocumentChangelogs::COMPONENTS[[0, 3]] in create(content)
192.168.0.70 - - [25/Oct/2017 14:00:03] "GET https://oddb-ci2.dyndns.org/de/gcc/show/patinfo/47909/01/015/diff/ HTTP/1.1" 500 190312 0.0438  "Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0"

I think we must use the odba_store and the important change is in the plugin/text_info.rb. Dropping and restoring the database and checking via bin/admin how the changelogs for the package 015 of the registration 47909 look like.

ch.oddb> $x=0;registration('47909').package('015').patinfo.de.change_log.size
-> 2
ch.oddb> $x=0;registration('47909').package('015').patinfo.de.change_log.first.diff.each_chunk{|x| $x +=1}
-> Array
ch.oddb> $x
-> 28
ch.oddb> $x=0;registration('47909').package('015').patinfo.de.change_log.last.diff.each_chunk{|x| $x +=1}
-> Array
ch.oddb> $x
-> 2

Now launching import and breaking when adding the new change_log.

Wrong prices in oddb_article.xml from ZurRose

The price of 7.20 for Pharmacode 5823918 oder 5786689 are wrong. In transfer.dat we have

1135786689NERIA multi 27G 10/60 2-fach 10 Stk               0190500196001000000000000000000000001
1125823918DURANCE huile essentielle tea tree 10 ml          0010080014004000000000000000000000001

The price is read correctly from the transfer.dat. A second breakpoint was never touched. Restarting the long lasting import bin/oddb2xml --log --append --extended with improved breakpoint. Found the reason, if the ean is 0 it gets the price of 7.20. Fixing it.

I find 263 prices 7.20 in transfer.dat using the following command cut -c67-72 downloads/transfer.dat | grep -c 000720.

Oddb2xml 2.0.7 of September 6 created the following entry for the parmacode 5823918

  <ART DT="">
    <REF_DATA>0</REF_DATA>
    <PHAR>5823918</PHAR>
    <SALECD>I</SALECD>
    <DSCRD>DURANCE huile essentielle tea tree 10 ml</DSCRD>
    <DSCRF>DURANCE huile essentielle tea tree 10 ml</DSCRF>
    <SORTD>DURANCE HUILE ESSENTIELLE TEA TREE 10 ML</SORTD>
    <SORTF>DURANCE HUILE ESSENTIELLE TEA TREE 10 ML</SORTF>
    <ARTCOMP/>
  </ART>

The output with my local version is

  <ART DT="" SHA256="41f65c5ebc7443949d8e67af958008a9f3048ba68474655e4622798fafd0028d">
    <REF_DATA>0</REF_DATA>
    <PHAR>5823918</PHAR>
    <SALECD>I</SALECD>
    <CDBG>N</CDBG>
    <BG>N</BG>
    <DSCRD>DURANCE huile essentielle tea tree 10 ml</DSCRD>
    <DSCRF>DURANCE huile essentielle tea tree 10 ml</DSCRF>
    <SORTD>DURANCE HUILE ESSENTIELLE TEA TREE 10 ML</SORTD>
    <SORTF>DURANCE HUILE ESSENTIELLE TEA TREE 10 ML</SORTF>
    <ARTCOMP/>
    <ARTBAR>
      <CDTYP>E13</CDTYP>
      <BC>0</BC>
      <BCSTAT>A</BCSTAT>
    </ARTBAR>
  </ART>

I must suppress the artbar if the barcode is 0.

I have 210 entries with price <PRICE>7.20</PRICE>

Pushed commits

view · edit · sidebar · attach · print · history
Page last modified on October 25, 2017, at 03:54 PM