view · edit · sidebar · attach · print · history

20120309-article-codes-for-patinfo

<< | Index | >>


summary

  • commited previous patches (for NoMethodErrors).
  • added article_codes to exported patinfo.yaml.
  • added warning notification for exporting of patinfo.yaml.
    • in only a few case are there unexpected Patinfo Object (it das no sequense, no company_name.)

commits

index


Fixed NoMethod Errors

  • localized_name in FachinfoNews
  • atc_classes in recent_registrations for mymedi

Add article_codes to patinfo.yaml

z.B. (fachinfo.yaml)

article_codes: 
- :article_ean13: "7680274430289"
  :article_size: 40 g
- :article_ean13: "7680274430449"
  :article_size: 100 g
...
  • Registrations <--- Fachinfo
  • Sequences <--- Patinfo
  • Packages

run export_patinfo_yaml

after ran ext/export/bin/exportd, I tried
$ ruby jobs/export_patinfo_yaml

got error.

jobs/export_patinfo_yaml:14:in `block in <module:Util>': undefined method `export_patinfo_yaml' for #<ODDB::Exporter:0x9909ea4> (NoMethodError)
        from /var/www/oddb.org/src/util/job.rb:18:in `call'
        from /var/www/oddb.org/src/util/job.rb:18:in `run'
        from jobs/export_patinfo_yaml:13:in `<module:Util>'
        from jobs/export_patinfo_yaml:12:in `<module:ODDB>'
        from jobs/export_patinfo_yaml:11:in `<main>'

There is not export_patinfo_yaml for job.
added in src/util/exporter.rb

  ...
    def export_patinfo_yaml
      exporter = YamlExporter.new(@app)
      safe_export 'patinfo.yaml' do
        exporter.export_patinfos
      end 
    end 
  ...

Attach:Added-export_patinfo_yaml-method-for-job-exporter.patch-20120309.txt

via binadmin

ch.oddb> Exporter.new(self).export_patinfo_yaml
NOTE
  • if exportd not running or not enough standing by, got drb connection error.
Error: DRb::DRbConnError
Message: connection closed

exported_files

  • patinfo.yaml
  • patinfo.gz
  • patinfo.zip

Extracted Sample file (see buttom) Attach:patinfo.yaml-20120309.txt

NOTE

exportd ouput (what is this errror... suspend)

$ bin/exportd
...
loading testenvironment
disabling UPDATER
...
loading testenvironment2
ODBA::Stub was unable to replace #28427454 from ODDB::Patinfo:#23699560

Try exporting fachinfo.yaml

tried fachinfo.yaml

got warnnig mail.

Message:
YamlExporter#export_fachinfs method is still running,
but I found some missing Fachinfo document data.
This may cause an error in export ebooks process of ebps.

There is no 'fr' description of Fachinformation of the following
Swissmedic Registration (Company, Product, Numbers):
[" 1. ProReo Pharma AG, Methotrexat Proreo 10 mg / 1 ml, 51078\n", " 2. Iromedica AG, Maku Mucolyticum, 58502\n"]

This is a very heavy job.
I downloaded fachinfo.yaml.gz from production server.

  • job/patinfo_yaml_exporter.rb
    • src/util/exporter.rb
      • src/util/oddbapp.rb
        • src/plugin/yaml.rb
          • ext/export/bin/exportd
            • ext/export/src/odba_exporter.rb
              • patinfo.yml

article_codes in RegistrationObserver class.

tested to get barcode(EAN code),pharmacode and etc. via sequence

ch.oddb> registration('31706').sequences.values.first.packages.values.first.barcode
-> 7680317060176
ch.oddb> registration('31706').sequences.values.first.packages.values.first.pharmacode
-> 223332
ch.oddb> registration('31706').sequences.values.first.packages.values.first.size
-> 50 Tablette(n)
ch.oddb> registration('31706').sequences.values.first.packages.values.first.dose
-> 10 mg
ch.oddb> registration('31706').sequences.values.first.each_package.first.dose

updated following files, then ran Exporter job.

  • ext/export/src/oddb_yaml.rb
  • src/model/sequence_observer.rb

exported patinfo.yaml:

...
article_codes: 
- :article_ean13: "7680473110128"
  :article_pcode: "2678798"
  :article_size: 30 Tablette(n)
  :article_dose: 5 mg
- :article_ean13: "7680473110203"
  :article_pcode: "2678806"
  :article_size: 100 Tablette(n)
  :article_dose: 5 mg
...

Attach:Added-article_codes-in-exported-patinfo_yaml.patch-20120309.txt

Check blank descriptions?

Fachinfo has check method for blank description

Added(updated) checker method like fachinfo's one.
This method send warnig notification.

get iksnr via Sequence

ch.oddb> patinfos.first.last.sequences.first.registration.iksnr
-> 42675

In only a few case, Patinfo doesn't have any sequences, company_name, description. If I access this object, error caused.
backed to above error.

ODBA::Stub was unable to replace #28427454 from ODDB::Patinfo:#23699560

via bin/admin (strange data)

ch.oddb> ODBA.cache.fetch('23699560')
-> undefined method `empty?' for nil:NilClass
ch.oddb> ODBA.cache.fetch('28427454')
-> Unknown odba_id 28427454
ch.oddb> ODBA.cache.fetch('11578635')
-> ODDB::Patinfo
ch.oddb> ODBA.cache.fetch('11578635').company_name
-> 
ch.oddb> ODBA.cache.fetch('11578635').name_base
->

Maybe, 'ODBA::Stub was unable to replace: error also comes from store(editing) via browser.

refs

    ch.oddb> patinfos.values.first.descriptions['fr'] = nil
    -> 
    ch.oddb> patinfos.values.first.descriptions['fr']
    -> 
    ch.oddb> patinfos.values.first.descriptions.class
    -> ODDB::SimpleLanguage::Descriptions
    ch.oddb> patinfos.values.first.class
    -> ODDB::Patinfo
    ch.oddb> patinfos.values.first.odba_store
    -> ODDB::Patinfo
    ch.oddb> patinfos.values.first.odba_id
    -> 2242
    # exit / reboot oddbd
    ch.oddb> ODBA.cache.fetch('2242').class
    -> ODDB::Patinfo
    ch.oddb> ODBA.cache.fetch('2242').descriptions['de'].class
    -> ODDB::PatinfoDocument
    ch.oddb> ODBA.cache.fetch('2242').descriptions['fr'].class
    -> NilClass

Skipped this unexpected data, I could got waring e-mail.

Attach:patinfo-warning-notification-mail-20120309.txt

view · edit · sidebar · attach · print · history
Page last modified on March 09, 2012, at 06:57 PM