view · edit · sidebar · attach · print · history

20130107-update-oddb2xml-fi-product-from-swissmedic-info

<< | Index | >>


Summary

  • Updated oddb2xml
    • added fi.xml output

Commits

Index


Create oddb2xml oddb_fi.xml

Ref.

Response

Broken Zip file response in Mechanize.

$ bin/oddb2xml 
/path/to/gems/ruby/1.9.1/gems/mechanize-2.5.1/lib/mechanize/http/agent.rb:899:in `rescue in response_read': end of file reached (Mechanize::ChunkedTerminationError) (Mechanize::ChunkedTerminationError)
        from /path/to/gems/ruby/1.9.1/gems/mechanize-2.5.1/lib/mechanize/http/agent.rb:878:in `response_read'
        from /path/to/gems/ruby/1.9.1/gems/mechanize-2.5.1/lib/mechanize/http/agent.rb:261:in `block in fetch'
        from /path/to/ruby/1.9.1/net/http.rb:1322:in `block (2 levels) in transport_request'
        from /path/to/ruby/1.9.1/net/http.rb:2671:in `reading_body'
        ...

use Agent#ingnore_bad_chunking for swissmedicinfo response.

XML structure

AipsDownload_2012xxxx.xml structure.

<medicalInformation type='fi'>
  <title></title>
  <authHolder></authHolder>
  <atcCode></atcCode>
  <substances><substances>
   <style></style>
  <content>
   <![CDATA[
     HTML
   ]]>
  </content>
  <sections></sections>
</medicalInformation>

oddb_fi.xml

<?xml version="1.0" encoding="utf-8"?>
<KOMPENDIUM xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://wiki.oddb.org/wiki.php?pagename=Swissmedic.Datendeklaration" CREATION_DATETIME="2013-01-07T16:27:36.1414021+0900" PROD_DATE="2013-01-07T16:27:36.1414021+0900" VALID_DATE="2013-01-07T16:27:36.1414021+0900">
  <ART MONTYPE="fi" LANG="DE" DT="">
    <name>
      <p>3TC®</p>
    </name>
    <owner>
      <p>ViiV Healthcare GmbH</p>
    </owner>
    <monid>53663</monid>
    <paragraph><![CDATA[
      <title><p>3TC®</p></title><div class="paragraph" id="Section7000">
      ...raw HTML...
    ]]>
    </paragraph>
  </ART>
</KOMPENDIUM>

New option.

Created -o fi option for :oddb_fi.xml: and :oddb_pi_product.xml:.

bin/oddb2xml ver.1.1.0
Usage:
  oddb2xml [option]
    -c F, --compress=F   Compress format F. {tar.gz|zip}
    -a T, --append=T     Additional target. T, only 'nonpharma' is available.
    -o O, --optional=O   Optional output. O, only 'fi' is available.                # <= fi option
    -t S, --tag-suffix=S XML tag suffix S. Default is none. [A-z0-9_]
                         If S is given, it is also used as prefix of filename.
    -h,   --help         Show this help message.

Next

oddb_fi_product.xml output.

view · edit · sidebar · attach · print · history
Page last modified on January 08, 2013, at 02:51 AM