view · edit · sidebar · attach · print · history

Index>

20160808-import-migel-bauernfeind

Summary

  • Update migel products from Bauernfeind
  • Add Evidentia link with logo in Fachinfo after Print
  • Keep in Mind

Commits

Index

Add Evidentia link with logo in Fachinfo after Print

Must add a link to the Evidentia in the FI after the print link. This is a little bit more difficult, as I have to search all packages whether they have an matching EAN13. Done. Looks like

Must also add a new column in the search result to display the new evidentia 16x16 icon. Fixed:

Pushed commit Added evidentia product_link to FI

Update migel products from Bauernfeind

Must fix import spec test. Done.

Must achieve 100% coverage in lib/migel/util/csv_importer.rb.

Analysing the code I find that there are two different migel products for german and french, whereas in oddb.org we have only one registration, package etc where we store localized names. And in the model of migel products we also define multilingual :article_name. Pondering how this is somehow resolved via the mode_super.

Checking whether we should use pharmacode or ean_code as primary key for a search via bin/admin

pry(#<Migel::Util::CsvImporter>)> products.values.find_all{|x| x.pharmacode}.size
=> 11273
pry(#<Migel::Util::CsvImporter>)> products.values.find_all{|x| x.pharmacode || x.ean_code}.size
=> 11273
pry(#<Migel::Util::CsvImporter>)> products.values.find_all{|x| x.pharmacode && !x.ean_code}.size
=> 2107
pry(#<Migel::Util::CsvImporter>)> products.values.find_all{|x| !x.pharmacode && x.ean_code}.size
=> 0
pry(#<Migel::Util::CsvImporter>)> products.values.find_all{|x| x.pharmacode == nil && x.ean_code == nil}.size
=> 0
pry(#<Migel::Util::CsvImporter>)> products.size
=> 11273
pry(#<Migel::Util::CsvImporter>)> products.values.collect{|x| x.migel_code}.size
=> 11273
pry(#<Migel::Util::CsvImporter>)> products.values.collect{|x| x.migel_code}.uniq.size
=> 260
pry(#<Migel::Util::CsvImporter>)> products.values.collect{|x| [x.migel_code, x.language]}.uniq.size
=> 359
pry(#<Migel::Util::CsvImporter>)> products.values.collect{|x| x.localized_name('de') }.uniq.size
=> 11174
pry(#<Migel::Util::CsvImporter>)> products.values.collect{|x| x.localized_name('fr') }.uniq.size
=> 11174

Conclusions:

  • currently all migel products can be found via pharmacode, but not all via ean13!
  • not all migel_code have a german and french article_name

Why do migel products have methods like :treetop_camelize, :to_lf, :to_nfc, :codepoints?

view · edit · sidebar · attach · print · history
Page last modified on August 08, 2016, at 06:06 PM