view · edit · sidebar · attach · print · history

Index>

20140401-add-caption-for-interaction-type

Summary

  • Add option -e "extended" to oddb2xml. This should include all articles (including prices) from transfer.dat of the "Apotheke zur Rose"
  • Use bundler/gem_tasks instead of hoe ]]

Commits

Index

Keep in Mind
  • Fix dojo error http://www.sitepen.com/blog/2012/10/31/debugging-dojo-common-error-messages/#forgot-dom-ready
  • Search nach Anwendung (indications), z.B. Konjunktivitis, does not report all occurrences in the section "Anwendung" of Fachinfo. Probably index is corrupted or not set up correctly.
  • Error: Patents with could not connect to www.swissreg.ch: #<Net::HTTPInternalServerError:0x007f8a7d69bb58>
  • vagrant-oddb.org: cleanup installation for yus with ruby 1.8, logrotate.conf and local vhosts for tests

---

Fix oddb2xml to import items without ean13

A closer look at the report about duplicated 7614700999989 revelead that is was correct, as it is the GLN of the company selling/producing the product.

Fixed import of items with an ean13 by creating a dummy ean with '000000' + pharmacode. Pushed commits

Now running time bundle exec bin/oddb2xml -p zurrose -f dat -e completes in a bit more than a minute and produces a 15MB bit oddb.dat.

Added an option -ae to produce nonpharma, extended, creating dat file. See commit

Sample output

time bundle exec bin/oddb2xml -ae 
DE
        Pharma products: 15443
        NonPharma products: 28884
FR
        Pharma products: 15443
        NonPharma products: 28884
2014-04-01 10:44:48 +0200: 102 done
Added 53848 via pharmacodes of 137496 items when extracting the transfer.dat from "Zur Rose"

real    1m49.894s
user    1m47.836s
sys     0m1.208s

Creates a 31MB oddb_with_migel.dat, which has 136723 lines like '1118808689Milchsäure 1% wässrig 500 ml 000000000000300 000000000000088086891'. Something is wrong now! Okay, I created obj outside the @articles.root. Fixed.

Next problem is that after running odb2xml -ae I find always two articles, e.g

grep -n 0000008808688 *.dat
oddb_with_migel.dat:152177:1138808688Hydroxyethylcellulose Gel 3% 100 g Tube           0000000000003000000000000000088086882
oddb_with_migel.dat:315784:1118808688Hydroxyethylcellulose Gel 3% 100 g Tube           000000000000300 000000000000088086881

Now things look better

<..>
Duplicate ean13 7611746064107 in line 
act: 1138804582Methadon 2% 250 ml                                0056600056801030000000076117460641072
org: 1138100464Methadon 1% 100 ml Streuli                        0024680032900030000000076117460641072
DE
        Pharma products: 15443
        NonPharma products: 28884
FR
        Pharma products: 15443
        NonPharma products: 28884
2014-04-01 13:31:30 +0200: 102 done
Added 53075 via pharmacodes of 136723 items when extracting the transfer.dat from "Zur Rose"
  found 773 lines with duplicated ean13

real    2m58.368s
user    2m57.224s
sys     0m1.136s

Creates a 17MB big oddb_with_migel.dat with 179062 lines. The first 42339 are identical with a file produced with the original 1.7.4 version of the oddb2xml gem.

As there are many duplicated ean13 we decided to write them to a separate file and to remove the -ae option. See commits Removed option -ae Write duplicated ean13s to duplicate_ean13_from_zur_rose.txt

I emittede (without thinking much) the pseudo-GTINs starting with '000000'. Fixed with commit Don't emit pseudo-eans starting with 000000

Output is e.g.

 <ART DT="">
    <PHAR>8808689</PHAR>
    <VAT>2</VAT>
    <SALECD>I</SALECD>
    <CDBG>N</CDBG>
    <BG>N</BG>
    <DSCRD>Milchsäure 1% wässrig 500 ml                      </DSCRD>
    <DSCRF>Milchsäure 1% wässrig 500 ml                      </DSCRF>
    <SORTD>MILCHSäURE 1% WäSSRIG 500 ML                      </SORTD>
    <SORTF>MILCHSäURE 1% WäSSRIG 500 ML                      </SORTF>
    <ARTCOMP>
    </ARTCOMP>
    <ARTBAR>
      <CDTYP>E13</CDTYP>
      <BC>0000008808689</BC>
      <BCSTAT>A</BCSTAT>
    </ARTBAR>
    <ARTPRI>
      <VDAT>01.04.2014</VDAT>
      <PTYP>ZURROSE</PTYP>
      <PRICE>8.71</PRICE>
    </ARTPRI>
    <ARTPRI>
      <VDAT>01.04.2014</VDAT>
      <PTYP>ZURROSEPUB</PTYP>
      <PRICE>11.85</PRICE>
    </ARTPRI>
  </ART>

Use bundler/gem_tasks instead of hoe

Modified the rake setup to use the bundler/gem_tasks instead of hoe. Made the following changes with Use bundler/gem_tasks instead of hoe

  • Rakefile includes now bundler/gem_tasks and has an alias task :gem -> :build to ease transition from hoe
  • Created an oddb2xml.gemspec which gets all runtime and development requirements from Gemfile
  • Gemfile loads the gemspec and kept only additional group :debugger (for pry)

Running on travis-ci failed, as it did not find bundler 1.6. Therefore I locally installed bundler 1.5.3, relaxed the specification of bundler to 1.5.3. Then ran bundle update and committed the changes in commit Regenerated Gemfile.lock with bundler 1.5.3 for travis-ci

Cleanup help message with Fix wording for option -ae

Add a caption to explain the code for interaction

caption must explain for interactions that

  • A Keine Massnahmen
  • B Vorsichtsmassnahmen
  • C Monitorisieren
  • D Kombination meiden
  • X Kontraindiziert

In the legend each category must appear in the corresponding colour. The caption should work the link "show caption" inside the search result of oddb.org.

We will use a similar approach as in src/view/result_footer.rb

view · edit · sidebar · attach · print · history
Page last modified on April 02, 2014, at 08:09 AM