Class: ODDB::Import::Whocc::Atc
- Inherits:
-
Xml
- Object
- ODDB::Import
- Xml
- ODDB::Import::Whocc::Atc
- Defined in:
- lib/oddb/import/whocc.rb
Instance Method Summary collapse
Methods inherited from Xml
Instance Method Details
#import_document(doc) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/oddb/import/whocc.rb', line 13 def import_document(doc) REXML::XPath.each(doc, '//rs:data/rw:row', "rs" => 'urn:schemas-microsoft-com:rowset', "rw" => '#RowsetSchema') { |row| code = row.attributes['ATCCode'] atc = Drugs::Atc.find_by_code(code) || Drugs::Atc.new(code) atc.name.de = row.attributes['Name'] atc.save } end |