view · edit · sidebar · attach · print · history

20120507-fix-sl-generic-type-error

<< | Index | >>


Summary

  • Fixed sl_generic_type error in A-Z result list
  • Update swissmedic plugin

Commits

Index


Fixed sl_generic_type error

problem
NoMethodError
undefined method `sl_generic_type' for Rabeprazol Sandoz 10 mg, magensaftresistente Filmtabletten:ODDB::Sequence

Registration#generic_type is old.
In some case, This value were used as Sequence#generic_type.

Updated only Package#sl_generic_type in A-Z result list (result color)


Update swissmedic_plugin

Problem
Plugin: ODDB::SwissmedicPlugin
Error: NoMethodError
Message: undefined method `<' for nil:NilClass
Backtrace:
/var/www/oddb.org/src/plugin/swissmedic.rb:702:in `update_registration'
/var/www/oddb.org/src/plugin/swissmedic.rb:730:in `block in update_registrations'
...

update source data/xls/Packungen-****.**.**.xls

  • update_swissmedic (src/util/updater.rb)
    • update (src/plugin/swissmedic.rb)
ch.oddb> Updater.new(self).update_swissmedic
->

"row = [\"62500\", 1.0, \"Swidro sirop pectoral, sirop\", \"Phytopharma SA\", \"03.02.0.\", \"R05CA10\", \"Phytotherapeutika\", 40967.0, 41015.0, nil, \"002\", \"400\", \"ml\", \"D\", \"hederae helicis extractum ethanolicum siccum, thymi extractum aquosum siccum, primulae radicis extractum ethanolicum siccum\", \"hederae helicis extractum ethanolicum siccum 15.55 mg, DER: 6-7:1, thymi extractum aquosum siccum 198.2 mg, DER: 7-13:1, primulae radicis extractum ethanolicum siccum 39 mg, DER: 4-9:1, color.: E 150, conserv.: E 200, E 202, E 216, E 218, excipiens ad solutionem pro 15 ml.\", \"En cas de toux lors de refroidissements\", nil, 0]

 <a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
    <a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture">
      <pic:pic xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture">
        <pic:nvPicPr>
          <pic:cNvPr id="0" name="Picture 1281"/>
          <pic:cNvPicPr>
            <a:picLocks noChangeAspect="1" noChangeArrowheads="1"/>
          </pic:cNvPicPr>
        </pic:nvPicPr>
        <pic:blipFill>
          <a:blip r:embed="rId8" cstate="print"/>
          <a:srcRect/>
          <a:stretch>
            <a:fillRect/>
          </a:stretch>
        </pic:blipFill>
        <pic:spPr bwMode="auto">
          <a:xfrm>
            <a:off x="0" y="0"/>
            <a:ext cx="5483860" cy="4005580"/>
          </a:xfrm>
          <a:prstGeom prst="rect">
            <a:avLst/>
          </a:prstGeom>
          <a:noFill/>
        </pic:spPr>
      </pic:pic>
    </a:graphicData>
  </a:graphic>
<w:document
  xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:o="urn:schemas-microsoft-com:office:office"
  xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" 
  xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
  xmlns:v="urn:schemas-microsoft-com:vml"
  xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
  xmlns:w10="urn:schemas-microsoft-com:office:word"
  xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
  xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml">
  • diff word/_rels/document.xml.rels ../fi_mittel/word/_rels/document.xml.rels
  • diff \[Content_Types\].xml ../fi_mittel/\[Content_Types\].xml
NOTE
    def parse_image(r)
      id = nil 
=begin
      paths = [
        '//w:pict//v:shape',
        '//w:drawing//wp:anchor',
      ].each do |path|
        unless r.xpath(path).empty?
          if image = r.xpath("#{path}//v:imagedata").first
            id = image['id'] # r:id
            p id
          else # there are no a: namespace
            p r.xpath(path).class
            graphic = r.xpath(path).children.select {|c| c.node_name == 'graphic'}.first
            data = graphic.child
            pic = data.children.select {|c| c.node_name == 'pic'}.first
            blip = pic.children.select {|c| c.node_name == 'blipFill'}.first.child
            id = blip['embed'] # r:embed
          end
        end
      end
=end
      additional_namespaces = { 
        'xmlns:a'   => 'http://schemas.openxmlformats.org/drawingml/2006/main',
        'xmlns:pic' => 'http://schemas.openxmlformats.org/drawingml/2006/picture'
      }   
      ns = r.namespaces.merge additional_namespaces
      paths = { 
        :id    => '//w:pict//v:shape//v:imagedata',
        :embed => '//w:drawing//wp:anchor//a:graphic//a:graphicData//pic:pic//pic:blipFill//a:blip'
      }.each do |attr, path|
        if image = r.xpath(path, ns) and !image.empty?
          id = image.first[attr.to_s]
        end 
      end 



Plugin: ODDB::SwissmedicPlugin
Error: TypeError
Message: can't dup NilClass
Backtrace:
/var/www/oddb.org/src/model/package.rb:155:in `dup'
/var/www/oddb.org/src/model/package.rb:155:in `checkout'
/var/www/oddb.org/src/model/package.rb:409:in `checkout'
/var/www/oddb.org/src/util/persistence.rb:240:in `issue_delete'
/var/www/oddb.org/src/util/oddbapp.rb:114:in `block in delete'
/var/www/oddb.org/src/util/failsafe.rb:10:in `call'
/var/www/oddb.org/src/util/failsafe.rb:10:in `failsafe'
/var/www/oddb.org/src/util/oddbapp.rb:110:in `delete'
/var/www/oddb.org/src/command/delete.rb:11:in `execute'
/var/www/oddb.org/src/util/oddbapp.rb:640:in `execute_command'
/var/www/oddb.org/src/util/oddbapp.rb:1449:in `delete'
/var/www/oddb.org/src/plugin/swissmedic.rb:114:in `block in delete'
...

Swissmedic-Diff

lib/swissmedic-diff.rb

..
      @diff.package_deletions = known_pacs.collect { |key, row|
        ## the keys in known_pacs don't include the sequence number (which
        #  would prevent us from properly recognizing multi-sequence-Packages), 
        #  so we need complete the path to the package now
        key[1,0] = '%02i' % cell(row, column(:seqnr)).to_i
        key 
      }  
..
  • diff > known_data > _known_data > known_pacs
view · edit · sidebar · attach · print · history
Page last modified on May 07, 2012, at 05:11 PM