view · edit · sidebar · attach · print · history

Index>

20140505-oddb2xml-with-FI

Summary

  • Estimating effort to generate pretty XML for FI using oddb2xml
  • Wrong SALECD-field with oddb2xml
  • Update color for interaction like amiko-windows

Commits

Index

Keep in Mind

---

Wrong SALECD-field with oddb2xml

We still have duplicated entries in oddb_article.xml

  • All Zur Rose Artikel have wrong SALECD. For Zur Rose Produkte "A" means(akti, in trade)
  • But all Zur Rose Product have an 'I'
  • This probably the cause for duplicaties entries for oddb_article.xml, e.g. 5366964. Differences are
    • "1-DAY ACUVUE Moist Tag -2.00dpt BC 8.5" or
    • "1-DAY ACUVUE Moist Tag -2.00dpt BC 8.5 30 Stk")
    • one product SALECD = A other one SALECD = I.

Fixed the following error extractor.rb. (Fix not yet pushed till finished refactoring unit tests.)

  • Use 'A' instead of 'I' when creating articles with prices from zurRose.
  • Get VAT directly from position in 69 in *.dat (IGM )

Eg. in our output we find

  <ART DT="">
    <PHAR>5366964</PHAR>
    <SALECD>A</SALECD>
    <CDBG>N</CDBG>
    <BG>N</BG>
    <QTY>30 Stk</QTY>
    <DSCRD>1-DAY ACUVUE Moist Tag -2.00dpt BC 8.5</DSCRD>
    <DSCRF>1-DAY ACUVUE moist jour -2.00dpt BC 8.5</DSCRF>
    <SORTD>1-DAY ACUVUE MOIST TAG -2.00DPT BC 8.5</SORTD>
    <SORTF>1-DAY ACUVUE MOIST JOUR -2.00DPT BC 8.5</SORTF>
    <ARTCOMP/>
    <ARTBAR>
      <CDTYP>E13</CDTYP>
      <BC>733905577161</BC>
      <BCSTAT>A</BCSTAT>
    </ARTBAR>
    <ARTINS>
      <NINCD>13</NINCD>
    </ARTINS>
  </ART>
<..>
  <ART DT="">
    <PHAR>5366964</PHAR>
    <SALECD>I</SALECD>
    <DSCRD>1-DAY ACUVUE Moist Tag -2.00dpt BC 8.5 30 Stk     </DSCRD>
    <DSCRF>1-DAY ACUVUE Moist Tag -2.00dpt BC 8.5 30 Stk     </DSCRF>
    <SORTD>1-DAY ACUVUE MOIST TAG -2.00DPT BC 8.5 30 STK     </SORTD>
    <SORTF>1-DAY ACUVUE MOIST TAG -2.00DPT BC 8.5 30 STK     </SORTF>
    <ARTCOMP/>
    <ARTBAR>
      <CDTYP>E13</CDTYP>
      <BCSTAT>A</BCSTAT>
    </ARTBAR>
  </ART>

In zurrose we find

grep 5366964 downloads/oddb2xml_zurrose_transfer.dat
11353669641-DAY ACUVUE Moist Tag -2.00dpt BC 8.5 30 Stk     0021170037501000000000000000000000001

In swissindex_NonPharma.xlm we find

      <ITEM DT="2013-06-22T00:00:00">
        <GTIN>733905577161</GTIN>
        <PHAR>5366964</PHAR>
        <STATUS>A</STATUS>
        <STDATE>2012-08-22T00:00:00</STDATE>
        <LANG>DE</LANG>
        <DSCR>1-DAY ACUVUE Moist Tag -2.00dpt BC 8.5</DSCR>
        <ADDSCR>30 Stk</ADDSCR>
        <COMP>
          <NAME>Johnson &amp; Johnson Consumer (Health Care / OTC)</NAME>
        </COMP>
      </ITEM>

We did not find this as a duplicata as

Must refactor the unit test as the directory spec/data is used for too many things. Goals are:

  • Running rake spec does not change any file in repository
  • Running rake spec does not delete downloaded files
  • Running rake spec does not delete create files
  • This means we use new constants SpecData (-> spec/data), SpecDownloads (-> spec/work/downloads), SpecWorkdir (-spec/work) while running tests.
  • Cleanup unused files in spec/data.

Update color for interaction like amiko-windows

See commit Use some colors as amiko-windows

Zeno asked epha and got the answer that the class '0' does not exists and was only used for HTML output. There committed https://github.com/ngiger/oddb.org/commit/5038245263cbc62371174f9cfd6e3494a7306ba71Class '0' is not valid for epha interactions

Estimating effort to generate pretty XML for FI using oddb2xml

Trying to run oddb2xml with jruby, brings up the following errors

Failures:
  1) Oddb2xml::Builder should handle BAG-articles with and without pharmacode 
     Failure/Error: @items = Oddb2xml::BagXmlExtractor.new(dat).to_hash
     NoMethodError:
       undefined method `call' for {:lazy=>true}:Hash
     # nokogiri/XmlSaxParserContext.java:241:in `parse_with'
     # ./spec/../lib/oddb2xml/extractor.rb:49:in `to_hash'
     # ./spec/builder_spec.rb:35:in `(root)'
  2) Oddb2xml::BagXmlExtractor should handle articles with and without pharmacode 
     Failure/Error: Oddb2xml::BagXmlExtractor.new(dat).to_hash
     NoMethodError:
       undefined method `call' for {:lazy=>true}:Hash
     # nokogiri/XmlSaxParserContext.java:241:in `parse_with'
     # ./spec/../lib/oddb2xml/extractor.rb:49:in `to_hash'
     # ./spec/extractor_spec.rb:18:in `subject'
     # ./spec/extractor_spec.rb:21:in `(root)'

Also installing jruby under funtoo failed. See also http://moving-innovations.com/blog/2014/04/23/the-precarious-state-of-jruby-in-gentoo?utm_source=dlvr.it&utm_medium=twitter

view · edit · sidebar · attach · print · history
Page last modified on May 06, 2014, at 08:05 AM