view · edit · sidebar · attach · print · history

20110729-setup-ddd-bbmb_ch

<< | Index | >>


  1. Setup DDD
  2. Testcases bbmb.ch

Goal/Estimate/Evaluation
  • Setup FI and DDD / 100% / 100%
  • Testcases bbmb.ch / 70% /
Milestones
Summary
Commits

Setup DDD

Problem

  • DDD link does not work

Experiment

  • with old atc.yaml
  • without replacing new ids

Result

  • success

Note

  • The cause is related to the new atc.yaml or oddb.yaml format

Check more in detail

Experiment

  • with new atc.yaml and old oddb.yaml

Result

  • failure

Note

  • Namely, the new atc.yaml format is the problem

Next

  • Compare the new and old atc.yaml format

Note

Experiment

    def to_html(context)
      html = ''
      if @value
        unless(@value.heading.empty?)
          html << context.h3 { self.escape(@value.heading) }
        end
        html << sections(context, @value.sections)
      end
    end

Setup

masa@masa ~/ywesee/bbmb.ch $ rm log/mnemonic/*.*
masa@masa ~/ywesee/bbmb.ch $ cp ~/work/bbmb_data_bak/mnemonic_local_update_all_kund_bak/*.* log/mnemonic/
masa@masa ~/ywesee/bbmb.c  $ rm data/yaml/*
masa@masa ~/ywesee/bbmb.ch $ cp ~/work/new_yaml/atc.yaml backup_yaml/downloads/
masa@masa ~/ywesee/bbmb.ch $ cp ~/work/new_yaml/oddb.yaml backup_yaml/downloads/

Run

  • bin/bbmbd
  • ruby ext/yaml_oddb/src/yaml_oddb.rb
  • bin/admin
ch.bbmb.globopharm> update

Result

  • success

Note

  • The cause is because of less data in the new atc.yaml
  • The following the old atc.yaml
 --- !oddb.org,2003/ODDB::AtcClass 
 code: R03DC
 descriptions: !oddb.org,2003/ODDB::SimpleLanguage::Descriptions
   de: Leukotrienrezeptor-Antagonisten
   en: Leukotriene receptor antagonists
 guidelines: 
  • This is the new
 --- !oddb.org,2003/ODDB::AtcClass 
 code: R03DC
 descriptions: !oddb.org,2003/ODDB::SimpleLanguage::Descriptions
   de: Leukotrienrezeptor-Antagonisten
   en: Leukotriene receptor antagonists
 guidelines: !oddb.org,2003/ODDB::Text::Document
   descriptions: !oddb.org,2003/ODDB::SimpleLanguage::Descriptions
     en:
  • In this case, the to_html method tries to search the sub class values (Chapter, Paragraph or etc.) under ODDB::TexT::Document
  • but the value becomes nil and error
  • I changed the to_html method of view class as the process skips if the value equals to nil

Note (yaml)

  • YAML.load_documents or similar method of yaml can load a different format from the class that is used during the output of yaml file.

Example

Result

masa@masa ~/work $ ruby test_save_yaml.rb > test.yaml
masa@masa ~/work $ ruby test_load_yaml.rb 
#<Test:0x7f87c240e588 @b="bye", @a="hello", @c=#<YAML::Object:0x7f87c240ed58 @class="Child", @ivars={"d"=>"helo"}>>
"hello"

Next

  • check with the replacing of new ids

Result

  • almost
  • 'Dosis','Adm.Route', 'Note' are not shown

Experiment

  • src/oddb/dose.rb
 module ODDB
  module Drugs
    class Dose < ODDB::Dose; end
  end
 end

Result

  • failed

Experiment

  • with old oddb.yaml and new atc.yaml

Result

  • success

Note

  • This means that new oddb.yaml is something wrong

Experiment

  • new atc.yaml - !oddb.org,2003/ODDB::Registration
    iksnr: "53750"
    registration_date: 1998-02-26
    revision_date: 2006-11-17
    expiration_date: 2013-11-05
    inactive_date:
    sequences:
      "01": !oddb.org,2003/ODDB::Sequence
        seqnr: "01"
        name_base: Accolate 20 mg
        name_descr: Filmtabletten
        atc_class: !oddb.org,2003/ODDB::AtcClass
          code: R03DC01
          descriptions: !oddb.org,2003/ODDB::SimpleLanguage::Descriptions
            de: Zafirlukast
            en: Zafirlukast
          guidelines:
          ddd_guidelines:
          ddds:
            O: !oddb.org,2003/ODDB::AtcClass::DDD
              administration_route: O
              dose: !oddb.org,2003/ODDB::Dose
                not_normalized:
                val: 40
                unit: mg
                scale:
              note:

Result

  • success

Note

  • It means that 'dose: !oddb.org,2003/ODDB::Drugs::Dose' in the new atc.yaml is not recognized

Experiment

  • src/oddb/dose.rb
  module Drugs
    class Dose < ODDB::Dose; end
  end
  • src/oddb/yaml.rb
  module Drugs
    class Dose; end
    YAML.add_domain_type('oddb.org,2003', 'ODDB::Drugs::Dose') { |type, val|
      YAML.object_maker(Dose, val)
    }
  end

Setup

masa@masa ~/ywesee/bbmb.ch $ rm log/mnemonic/*.*
masa@masa ~/ywesee/bbmb.ch $ rm data/yaml/*
masa@masa ~/ywesee/bbmb.ch $ cp ~/work/bbmb_data_bak/mnemonic_local_update_all_kund_bak/*.* log/mnemonic/
masa@masa ~/ywesee/bbmb.ch $ cp ~/work/oddb_new.yaml backup_yaml/downloads/oddb.yaml 
masa@masa ~/ywesee/bbmb.ch $ cp ~/work/atc_new.yaml backup_yaml/downloads/atc.yaml 

Run

  • bin/bbmbd
  • ruby ext/yaml_oddb/src/yaml_oddb.rb
  • bin/admin
ch.bbmb.globopharm> update

Result

  • success

Next

  • check it with the replacing new ids (final check)

Setup

masa@masa ~/ywesee/bbmb.ch $ rm log/mnemonic/*.*
masa@masa ~/ywesee/bbmb.ch $ rm data/yaml/*
masa@masa ~/ywesee/bbmb.ch $ cp ~/work/bbmb_data_bak/mnemonic_local_update_all_kund_bak/*.* log/mnemonic/
masa@masa ~/ywesee/bbmb.ch $ cp ~/work/new_yaml/atc.yaml backup_yaml/downloads/
masa@masa ~/ywesee/bbmb.ch $ cp ~/work/new_yaml/oddb.yaml backup_yaml/downloads/
masa@masa ~/ywesee/bbmb.ch $ cp ~/work/new_yaml/fachinfo.yaml backup_yaml/downloads/
  • src/custom/behavior.rb
    UPDATES = [
      :update_stock,
      #:update_suppliers,
      :update_users,
      #:update_user_access,
      :update_group_access,
      #:update_user_article_prices,
      #:update_user_article_discounts,
      #:update_user_group_discounts,
      #:update_user_volume_prices,
      :update_stock_atc,
      :update_sl,
      :update_atc_classes,
      :update_fachinfos,
    ]

Run

  • bin/bbmbd
  • ruby ext/yaml_oddb/src/yaml_oddb.rb
  • bin/admin
ch.bbmb.globopharm> overwrite_customer_ids_by_email '/home/masa/work/bbmb_data_bak/new_data/new_customer_id_ean_email.dat'
-> 27
ch.bbmb.globopharm> replace_customer_ids_gag_to_alloga '/home/masa/work/bbmb_data_bak/new_data/actual_gag_ean_allo_user_ids.csv'
-> 123
ch.bbmb.globopharm> replace_article_ids_gag_to_alloga '/home/masa/work/bbmb_data_bak/new_data/actual_gag_ean_allo_stock_ids.csv'
-> 284
ch.bbmb.globopharm> update

Log

BbmbApp::update - updating admin@ywesee.com
update: update_stock
update_stock done
update: update_users
update_users done
update: update_group_access
update_group_access done
update: update_stock_atc
"getin update_stock_atc in custom"
"getin update_stock_atc"
"getin update_atc_sl in yaml"
"getin update_stock_atc in bbmbapp"
"getin set_stock_atc in reseller"
"getin set_atc_classes in stock"
update_stock_atc done
update: update_sl
"getin update_sl in custom"
"getin update_sl in yaml"
"getin update_sl in bbmbapp"
"getin set_sl_entries in reseller"
"getin set_sl_entries in stock"
update_sl done
update: update_atc_classes
"getin update_atc_classes in custom"
"getin update_atc_classes in yaml"
"getin update_atc_classes in bbmbapp"
"getin set_atc_classes in reseller"
update_atc_classes done
update: update_fachinfos
"getin update_fachinfos in custom"
"getin update_fachinfos in yaml"
"getin update_fachinfos in bbmbapp"
"getin set_fachinfos in reseller"
"getin set_fachinfos in stock"
update_fachinfos done

Result

  • success

Testcases bbmb.ch

Current status

masa@masa ~/work/bbmb.ch $ ruby -W0 test/suite.rb 
  1) Error:
test_dont_send_empty_order(BBMB::TestBbmbAppHospital):
NoMethodError: undefined method `value' for nil:NilClass
    /home/masa/work/bbmb.ch/src/transactions/stock.rb:16:in `execute'
    /home/masa/work/bbmb.ch/src/transactions/transactions.rb:11:in `execute'
    /usr/lib64/ruby/site_ruby/1.8/mnemonic/Mnemonic.rb:221:in `execute'
    /usr/lib64/ruby/site_ruby/1.8/mnemonic/Mnemonic.rb:192:in `runAt'
    /usr/lib64/ruby/site_ruby/1.8/mnemonic/Mnemonic.rb:220:in `execute'
    /home/masa/work/bbmb.ch/src/transactions/transactions.rb:26:in `executeTransaction'
    /home/masa/work/bbmb.ch/src/transactions/transactions.rb:23:in `synchronize'
    /home/masa/work/bbmb.ch/src/transactions/transactions.rb:23:in `executeTransaction'
    /home/masa/work/bbmb.ch/src/util/bbmbapp.rb:655:in `update_stock'
    ./test/test_bbmbapp.rb:494:in `setup'

  2) Error:
test_keep_price(BBMB::TestBbmbAppHospital):
NoMethodError: undefined method `value' for nil:NilClass
    /home/masa/work/bbmb.ch/src/transactions/stock.rb:16:in `execute'
    /home/masa/work/bbmb.ch/src/transactions/transactions.rb:11:in `execute'
    /usr/lib64/ruby/site_ruby/1.8/mnemonic/Mnemonic.rb:221:in `execute'
    /usr/lib64/ruby/site_ruby/1.8/mnemonic/Mnemonic.rb:192:in `runAt'
    /usr/lib64/ruby/site_ruby/1.8/mnemonic/Mnemonic.rb:220:in `execute'
    /home/masa/work/bbmb.ch/src/transactions/transactions.rb:26:in `executeTransaction'
    /home/masa/work/bbmb.ch/src/transactions/transactions.rb:23:in `synchronize'
    /home/masa/work/bbmb.ch/src/transactions/transactions.rb:23:in `executeTransaction'
    /home/masa/work/bbmb.ch/src/util/bbmbapp.rb:655:in `update_stock'
    ./test/test_bbmbapp.rb:494:in `setup'

  3) Error:
test_send_order(BBMB::TestBbmbAppHospital):
NoMethodError: undefined method `value' for nil:NilClass
    /home/masa/work/bbmb.ch/src/transactions/stock.rb:16:in `execute'
    /home/masa/work/bbmb.ch/src/transactions/transactions.rb:11:in `execute'
    /usr/lib64/ruby/site_ruby/1.8/mnemonic/Mnemonic.rb:221:in `execute'
    /usr/lib64/ruby/site_ruby/1.8/mnemonic/Mnemonic.rb:192:in `runAt'
    /usr/lib64/ruby/site_ruby/1.8/mnemonic/Mnemonic.rb:220:in `execute'
    /home/masa/work/bbmb.ch/src/transactions/transactions.rb:26:in `executeTransaction'
    /home/masa/work/bbmb.ch/src/transactions/transactions.rb:23:in `synchronize'
    /home/masa/work/bbmb.ch/src/transactions/transactions.rb:23:in `executeTransaction'
    /home/masa/work/bbmb.ch/src/util/bbmbapp.rb:655:in `update_stock'
    ./test/test_bbmbapp.rb:494:in `setup'

  4) Failure:
test_resolve(BBMB::TestStock) [./test/test_stock.rb:95]:
<"10002"> expected but was
<"10001">.

187 tests, 1073 assertions, 1 failures, 3 errors

Note

  • The number of failure and error looks different from the previous time
view · edit · sidebar · attach · print · history
Page last modified on July 29, 2011, at 04:57 PM