view · edit · sidebar · attach · print · history

20130426-debug-fachinfo-yaml-exporter

<< | Index | >>


Summary

  • Debug Fachinfo Yaml Exporter
  • Commits
ebps
oddb.org

Index


Debug Fachinfo Yaml Exporter

Exporter is something wrong.

[4] 1.9.3-p194(#<ODDB::YamlExporter>)> no_descr['de'].length
=> 544
[5] 1.9.3-p194(#<ODDB::YamlExporter>)> info
=> "fachinfo"
[9] 1.9.3-p194(#<ODDB::YamlExporter>)> no_descr['de'].first
=> [nil, nil]

update to skip empty FI.

commit

Debug EBPS picture

Input file for conversion: /home/yasuhiro/Documents/workspace/ywesee/var/ebps/data/yaml/fachinfos.ch.oddb.yaml

Magick::ImageMagickError: zero-length blob not permitted `' @ error/blob.c/BlobToImage/347
/home/yasuhiro/Documents/workspace/ywesee/var/ebps/lib/ebps/text/picture.rb:31:in `from_blob'
/home/yasuhiro/Documents/workspace/ywesee/var/ebps/lib/ebps/text/picture.rb:31:in `image'
/home/yasuhiro/Documents/workspace/ywesee/var/ebps/lib/ebps/conversion/oebps.rb:106:in `format_picture'
/home/yasuhiro/Documents/workspace/ywesee/var/ebps/lib/ebps/conversion/oebps.rb:154:in `block in paragraphs'
commit

FI data is fine.

ch.oddb> fachinfos.values.select{|fi| fi.name_base =~ /Phenhydan/ }.length
-> 2
ch.oddb> fachinfos.values.select{|fi| fi.name_base =~ /Phenhydan/ }.first.name_base
-> Phenhydan
ch.oddb> fachinfos.values.select{|fi| fi.name_base =~ /Phenhydan/ }.first.company_name
-> Desitin Pharma GmbH

Name is missing in yaml.

[3] 1.9.3-p194(EBPS::Conversion::FachinfoYaml)> yaml_value['name']
=> nil
[5] 1.9.3-p194(EBPS::Conversion::FachinfoYaml)> yaml_value['iksnrs']
=> Zulassungsnummer
36110 (Swissmedic)
--- !oddb.org,2003/ODDB::Fachinfo 
oid: 29548219
descriptions: !oddb.org,2003/ODDB::SimpleLanguage::Descriptions 
  de: !oddb.org,2003/ODDB::FachinfoDocument2001 
    name: 
    amzv: 
    composition: !oddb.org,2003/ODDB::Text::Chapter 
      heading: Zusammensetzung
      sections: 
      - !oddb.org,2003/ODDB::Text::Section 
        subheading: ""
        paragraphs: 
        - !oddb.org,2003/ODDB::Text::Paragraph 
          formats: 
          - !oddb.org,2003/ODDB::Text::Format 
            values: []

            start: 0
            end: -1

Some FI Document does not have name, But Fachino Object(container) has name.

ch.oddb> fachinfos.values.select{|fi| fi.name_base =~ /Phenhydan/ }.first.descriptions['de'].name
->
ch.oddb> fachinfos.values.select{|fi| fi.name_base =~ /Phenhydan/ }.first.localized_name(:de)
-> Phenhydan

These values does not have :name chapter.
Maybe these chapter comes from swissmedicinfo importer.

# Total
ch.oddb> fachinfos.values.select { |fi| fi.descriptions['de']  }.length
-> 5648

# FI das no Document
ch.oddb> fachinfos.values.select { |fi| fi.descriptions['de'].nil?  }.length
-> 544

# FI has Document. but its name is nil.
ch.oddb> fachinfos.values.select { |fi| !fi.descriptions['de'].nil? and fi.descriptions['de'].name.nil? }.length
-> 91

# FI das Document. but its name is empty ("").
ch.oddb> fachinfos.values.select { |fi| !fi.descriptions['de'].nil? and fi.descriptions['de'].name.to_s.empty? }.length
-> 94

Then update these values via bin/admin. (use same value localized_name and name_base of Fachinfo)

ch.oddb> registration('39932').fachinfo.descriptions['de'].name
->
ch.oddb> registration('39932').fachinfo.descriptions['de'].name = "Phenhydan"
-> Phenhydan
ch.oddb> registration('39932').fachinfo.descriptions['de'].odba_isolated_store
-> #<ODDB::FachinfoDocument2001:0x0000000982a060>
# reboot
ch.oddb> registration('39932').fachinfo.descriptions['de'].name
-> Phenhydan
ch.oddb> registration('39932').fachinfo.descriptions['fr'].name #=> fr is fine.
-> Phenhydan® Concentré pour perfusion
view · edit · sidebar · attach · print · history
Page last modified on April 26, 2013, at 07:18 PM