<< | Index | >>
Commit
Error: RuntimeError Message: not same unit: != ml Backtrace: (druby://localhost:10005) /var/www/oddb.org/src/util/quanty/main.rb:46:in `adjust' (druby://localhost:10005) /var/www/oddb.org/src/util/quanty/main.rb:62:in `+' (druby://localhost:10005) /var/www/oddb.org/src/model/dose.rb:100:in `+' (druby://localhost:10005) /var/www/oddb.org/ext/export/src/oddbdat.rb:401:in `structure' (druby://localhost:10005) /var/www/oddb.org/src/model/sequence.rb:130:in `inject' (druby://localhost:10005) /var/www/oddb.org/ext/export/src/oddbdat.rb:401:in `each' (druby://localhost:10005) /var/www/oddb.org/ext/export/src/oddbdat.rb:401:in `inject' (druby://localhost:10005) /var/www/oddb.org/ext/export/src/oddbdat.rb:401:in `structure' (druby://localhost:10005) /var/www/oddb.org/ext/export/src/oddbdat.rb:269:in `initialize' (druby://localhost:10005) /var/www/oddb.org/ext/export/src/oddbdat.rb:292:in `initialize' (druby://localhost:10005) /var/www/oddb.org/ext/export/src/oddbdat.rb:53:in `new' (druby://localhost:10005) /var/www/oddb.org/ext/export/src/oddbdat.rb:53:in `lines' (druby://localhost:10005) /var/www/oddb.org/ext/export/src/odba_exporter.rb:175:in `export_oddbdat' (druby://localhost:10005) /var/www/oddb.org/ext/export/src/odba_exporter.rb:174:in `each' (druby://localhost:10005) /var/www/oddb.org/ext/export/src/odba_exporter.rb:174:in `export_oddbdat' (druby://localhost:10005) /var/www/oddb.org/ext/export/src/odba_exporter.rb:172:in `each' (druby://localhost:10005) /var/www/oddb.org/ext/export/src/odba_exporter.rb:172:in `export_oddbdat' /var/www/oddb.org/src/plugin/oddbdat_export.rb:58:in `export' /var/www/oddb.org/src/util/exporter.rb:154:in `export_oddbdat' /var/www/oddb.org/src/util/exporter.rb:307:in `call' /var/www/oddb.org/src/util/exporter.rb:307:in `safe_export' /var/www/oddb.org/src/util/exporter.rb:152:in `export_oddbdat' /var/www/oddb.org/src/util/exporter.rb:52:in `run' /var/www/oddb.org/jobs/export_daily:13 /var/www/oddb.org/src/util/job.rb:17:in `call' /var/www/oddb.org/src/util/job.rb:17:in `run' /var/www/oddb.org/jobs/export_daily:12
Run
masa@masa ~/ywesee/oddb.org $ bin/admin ch.oddb> Exporter.new(self).export_oddbdat
Result
Error: RuntimeError Message: not same unit: != ml Backtrace: (druby://localhost:10005) /home/masa/ywesee/oddb.org/src/util/quanty/main.rb:46:in `adjust' (druby://localhost:10005) /home/masa/ywesee/oddb.org/src/util/quanty/main.rb:62:in `+' (druby://localhost:10005) /home/masa/ywesee/oddb.org/src/model/dose.rb:100:in `+' (druby://localhost:10005) /home/masa/ywesee/oddb.org/ext/export/src/oddbdat.rb:401:in `structure' (druby://localhost:10005) /home/masa/ywesee/oddb.org/src/model/sequence.rb:130:in `inject' (druby://localhost:10005) /home/masa/ywesee/oddb.org/ext/export/src/oddbdat.rb:401:in `each' (druby://localhost:10005) /home/masa/ywesee/oddb.org/ext/export/src/oddbdat.rb:401:in `inject' (druby://localhost:10005) /home/masa/ywesee/oddb.org/ext/export/src/oddbdat.rb:401:in `structure' (druby://localhost:10005) /home/masa/ywesee/oddb.org/ext/export/src/oddbdat.rb:269:in `initialize' (druby://localhost:10005) /home/masa/ywesee/oddb.org/ext/export/src/oddbdat.rb:292:in `initialize' (druby://localhost:10005) /home/masa/ywesee/oddb.org/ext/export/src/oddbdat.rb:53:in `new' (druby://localhost:10005) /home/masa/ywesee/oddb.org/ext/export/src/oddbdat.rb:53:in `lines' (druby://localhost:10005) /home/masa/ywesee/oddb.org/ext/export/src/odba_exporter.rb:175:in `export_oddbdat' (druby://localhost:10005) /home/masa/ywesee/oddb.org/ext/export/src/odba_exporter.rb:174:in `each' (druby://localhost:10005) /home/masa/ywesee/oddb.org/ext/export/src/odba_exporter.rb:174:in `export_oddbdat' (druby://localhost:10005) /home/masa/ywesee/oddb.org/ext/export/src/odba_exporter.rb:172:in `each' (druby://localhost:10005) /home/masa/ywesee/oddb.org/ext/export/src/odba_exporter.rb:172:in `export_oddbdat' /home/masa/ywesee/oddb.org/src/plugin/oddbdat_export.rb:58:in `export' /home/masa/ywesee/oddb.org/src/util/exporter.rb:154:in `export_oddbdat' /home/masa/ywesee/oddb.org/src/util/exporter.rb:307:in `call' /home/masa/ywesee/oddb.org/src/util/exporter.rb:307:in `safe_export' /home/masa/ywesee/oddb.org/src/util/exporter.rb:152:in `export_oddbdat' (eval):1:in `_admin' /home/masa/ywesee/oddb.org/src/util/failsafe.rb:9:in `call' /home/masa/ywesee/oddb.org/src/util/failsafe.rb:9:in `failsafe' /home/masa/ywesee/oddb.org/src/util/oddbapp.rb:1426:in `_admin' /home/masa/ywesee/oddb.org/src/util/oddbapp.rb:1424:in `initialize' /home/masa/ywesee/oddb.org/src/util/oddbapp.rb:1424:in `new' /home/masa/ywesee/oddb.org/src/util/oddbapp.rb:1424:in `_admin' /usr/lib64/ruby/1.8/drb/drb.rb:1555:in `__send__' /usr/lib64/ruby/1.8/drb/drb.rb:1555:in `perform_without_block' /usr/lib64/ruby/1.8/drb/drb.rb:1515:in `perform' /usr/lib64/ruby/1.8/drb/drb.rb:1589:in `main_loop' /usr/lib64/ruby/1.8/drb/drb.rb:1585:in `loop' /usr/lib64/ruby/1.8/drb/drb.rb:1585:in `main_loop' /usr/lib64/ruby/1.8/drb/drb.rb:1581:in `start' /usr/lib64/ruby/1.8/drb/drb.rb:1581:in `main_loop' /usr/lib64/ruby/1.8/drb/drb.rb:1430:in `run' /usr/lib64/ruby/1.8/drb/drb.rb:1427:in `start' /usr/lib64/ruby/1.8/drb/drb.rb:1427:in `run' /usr/lib64/ruby/1.8/drb/drb.rb:1347:in `initialize' /usr/lib64/ruby/1.8/drb/drb.rb:1627:in `new' /usr/lib64/ruby/1.8/drb/drb.rb:1627:in `start_service' bin/oddbd:38
Note
Experiment (ext/export/src/odba_exporter.rb#export_oddbdat)
def OdbaExporter.export_oddbdat(odba_ids, dir, klasses) FileUtils.mkdir_p(dir) files = klasses.collect { |klass| table = klass.new file = Tempfile.new(table.filename, dir) [file, table] } if(odba_ids.nil?) files.each { |file, table| file.puts table.lines } else odba_ids.each { |odba_id| item = ODBA.cache.fetch(odba_id, nil) files.each { |file, table| open("/home/masa/work/log.dat","a"){|f| f.print "table.class = ", table.class, "\n" f.print "item.pharmacode = ", item.pharmacode, "\n" f.print "item.parts.collect { |part| part.measure }.compact.join(',') = ", item.parts.collect { |part| part.measure }.compact.join(","), "\n" } file.puts table.lines(item) } #ODBA.cache.clear } end
Result
.... item.pharmacode = nil item.parts.collect { |part| part.measure }.compact.join(',') = 1 table.class = ODDB::OdbaExporter::LimitationTable item.pharmacode = nil item.parts.collect { |part| part.measure }.compact.join(',') = 1 table.class = ODDB::OdbaExporter::LimTxtTable item.pharmacode = nil item.parts.collect { |part| part.measure }.compact.join(',') = 1 table.class = ODDB::OdbaExporter::EanTable item.pharmacode = nil item.parts.collect { |part| part.measure }.compact.join(',') = 1 table.class = ODDB::OdbaExporter::AcTable item.pharmacode = 2237077 item.parts.collect { |part| part.measure }.compact.join(',') = 1 ,3 ml table.class = ODDB::OdbaExporter::AccompTable item.pharmacode = 2237077 item.parts.collect { |part| part.measure }.compact.join(',') = 1 ,3 ml table.class = ODDB::OdbaExporter::AcLimTable item.pharmacode = 2237077 item.parts.collect { |part| part.measure }.compact.join(',') = 1 ,3 ml table.class = ODDB::OdbaExporter::AcmedTable item.pharmacode = 2237077 item.parts.collect { |part| part.measure }.compact.join(',') = 1 ,3 ml table.class = ODDB::OdbaExporter::AcnamTable item.pharmacode = 2237077 item.parts.collect { |part| part.measure }.compact.join(',') = 1 ,3 ml
Note
Experiment (delete one of parts)
ch.oddb> ODDB::Package.find_by_pharmacode('2237077').iksnr -> 54915 ch.oddb> delete(ODDB::Package.find_by_pharmacode('2237077').parts[1].pointer) -> #<ODDB::Part:0x7f97dd1aba68>
Run
masa@masa ~/ywesee/oddb.org $ bin/admin ch.oddb> Exporter.new(self).export_oddbdat
Result
masa@masa ~/ywesee/oddb.org $ ls data/downloads/ oddbdat.tar.gz oddbdat.zip README s01x s02x s03x s06x s07x s09x s10x s11x s12x s16x s19x s40x s41x s99x
Note
Online server
ywesee@server /var/www/oddb.org $ bin/admin ch.oddb> ODDB::Package.find_by_pharmacode('2237077') ->
Note
ywesee@server /var/www/oddb.org $ bin/admin ch.oddb> Exporter.new(self).export_oddbdat ->
Result
ywesee@server /var/www/oddb.org $ ls data/downloads/ -al -rw-r--r-- 1 apache apache 2160825 2011-06-17 14:21 oddbdat.tar.gz -rw-r--r-- 1 apache apache 2146220 2011-06-17 14:21 oddbdat.zip
Note
suspend
Commmit