view · edit · sidebar · attach · print · history

Index>

20170905-create-pi-if-not-in-packages

Summary

  • PIs and FIs not created with a new drug not yet in packungen.xlsx
  • Heatmap aktivieren
  • Fix error in export drug_shortage
  • Ethereum contracs
  • Keep in Mind

Commits

Index

PIs and FIs not created with a new drug not yet in packungen.xlsx

Banging my head because I still get the error "connection closed" when accessing a newly created patinfo via bin/admin

Try 4 to save a new patinfo for all packages (in a sequence using) (line 315 ff on src/plugin/text_info.rb

existing = @app.create_patinfo;
languages = existing.descriptions
languages[lang] = patinfo_lang
ptr = existing.pointer
patinfo = @app.update ptr, languages
patinfo.odba_store;
sequence.patinfo  = patinfo;
sequence.odba_store;
[24] pry(#<ODDB::TextInfoPlugin>)> sequence.patinfo.pointer
=> #<ODDB::Persistence::Pointer:0x0055a843aa6068 @directions=[[:patinfo, 36113092]]>

Restarting ch.odbb and access via bin/admin shows

ch.oddb> registration('66085').sequence('00').patinfo.pointer
-> druby://localhost:10000 - #<Errno::ECONNREFUSED: Connection refused - connect(2) for "localhost" port 10000>
ch.oddb> registration('66085').sequence('00').patinfo.pointer
-> :!patinfo,36113092.
ch.oddb> registration('66085').sequence('00').patinfo.descriptions.keys
-> ["de"]
ch.oddb> registration('66085').sequence('00').patinfo.descriptions['de']
-> connection closed
ch.oddb> registration('66085').sequence('00').patinfo.descriptions['de'].to_s
-> connection closed
ch.oddb> registration('66085').sequence('00').patinfo.descriptions['de'].to_s[0..120]
-> connection closed

If I try to acces now I see in the log/2017/09/05/oddb.log

192.168.0.75 - - [05/Sep/2017 08:28:54] "GET https://oddb-ci2.dyndns.org/de/gcc/search/zone/drugs/search_query/66085/search_type/st_registration HTTP/1.1" 200 18464 0.2361  "Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0"
[2017-09-05 08:28:57] ERROR SystemStackError: stack level too deep                                            
        /var/www/oddb.org/src/util/language.rb:25:in `each'                                            
        /var/www/oddb.org/src/util/language.rb:25:in `sort'                                            
        /var/www/oddb.org/src/util/language.rb:25:in `first'                                                              
        /var/www/oddb.org/src/util/language.rb:66:in `to_s'                                                                                
        (eval):2:in `to_s'                                                                                                                                       
<...>
       /var/www/oddb.org/src/util/language.rb:66:in `to_s'                                                                                       
        (eval):2:in `name'                                                                                          
        /var/www/oddb.org/src/view/drugs/patinfo.rb:199:in `patinfo_name'                                                                      
        /var/www/oddb.org/src/view/drugs/patinfo.rb:238:in `patinfo_name'                                           
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:83:in `create'                                  
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:284:in `compose_component'                       
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:213:in `block in compose'                                              
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `each'             
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `compose'                                      
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:72:in `init'              
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/component.rb:139:in `initialize'                                                               
        /var/www/oddb.org/src/view/publictemplate.rb:71:in `new'                                                                                                                                                                                   
        /var/www/oddb.org/src/view/publictemplate.rb:71:in `content'                                                
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:83:in `create'            
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:284:in `compose_component'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:213:in `block in compose'       
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `each'                                    
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `compose'                                                       
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:72:in `init'        
        /var/www/oddb.org/src/view/publictemplate.rb:68:in `init'                                             
        /var/www/oddb.org/src/view/privatetemplate.rb:17:in `init'                                            
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/component.rb:139:in `initialize' 
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.9/lib/sbsm/state.rb:241:in `new'                    
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.9/lib/sbsm/state.rb:241:in `view'                   
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.9/lib/sbsm/state.rb:174:in `to_html'                
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.9/lib/sbsm/session.rb:547:in `to_html'              
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.9/lib/sbsm/session.rb:279:in `block in process_rack'
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.9/lib/sbsm/session.rb:209:in `synchronize'   
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.9/lib/sbsm/session.rb:209:in `process_rack'  
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/sbsm-1.5.9/lib/sbsm/app.rb:127:in `call'

Try5 like this

existing = @app.create_patinfo;
languages = existing.descriptions:
languages[lang] = patinfo_lang;
ptr = existing.pointer
sequence = reg.sequences.values.first;
patinfo = sequence.patinfo = @app.update ptr, languages;
patinfo.odba_store;
sequence.odba_store;

Once I have solved this problem we must not reject PI which are not in the Packungen.xlsx when their chapter date contains an actual date. We only must reject outdated PI.

This looks better via bin/admin

ch.oddb> registration('66085').sequence('00').patinfo.pointer
-> :!patinfo,36113076.
ch.oddb> registration('66085').sequence('00').patinfo.de.pointer
-> 
ch.oddb> registration('66085').sequence('00').patinfo.de.date
-> Diese Packungsbeilage wurde im August 2017 letztmals durch die Arzneimittelbehörde (Swissmedic) geprüft.
ch.oddb> registration('66085').sequence('00').patinfo.de.name
-> Kisplyx®
ch.oddb> registration('66085').sequence('00').patinfo.de.to_s
-> String
ch.oddb> registration('66085').sequence('00').patinfo.de.to_s[0..120]
-> Kisplyx®
Was ist Kisplyx und wann wird es angewendet?
Kisplyx wird zur Behandlung des fortgeschrittenen Nierenzellkarzino

After a restart of ch.oddb https://oddb-ci2.dyndns.org/de/gcc/patinfo/reg/66085/seq/00/pack/000 displays the correct values for Kisplyx®.

Checking whether the date of the PI is current was easy. Same procedure for FI. Reloading database and running import_daily before pushing commit.

But found another place where the FI are reject, because they are not in Packungen.xlsx.

But it looks that we do import too many PIs (e.g. 00679 - 02- 012). If I try to load it now via https://oddb-ci2.dyndns.org/de/gcc/patinfo/reg/00679/seq/02/pack/012 I get an exception. Waiting till import is finished before restarting ch.oddbd.

NoMethodError: undefined method `size' for #<ODDB::PatinfoDocument:0x007f6b179095f0>                                                                              
        /var/www/oddb.org/src/view/drugs/patinfo.rb:87:in `init'                                                                                                  
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/component.rb:139:in `initialize'                                                     
        /var/www/oddb.org/src/view/drugs/patinfo.rb:222:in `new'                                                                                                  
        /var/www/oddb.org/src/view/drugs/patinfo.rb:222:in `chapter_chooser'                                                                                      
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:83:in `create'                                                          
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:284:in `compose_component'                                              
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:213:in `block in compose'                                               
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `each'                                                           
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:209:in `compose'                                                        
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:72:in `init'                                                            
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/component.rb:139:in `initialize'                                                     
        /var/www/oddb.org/src/view/publictemplate.rb:71:in `new'                                                                                                  
        /var/www/oddb.org/src/view/publictemplate.rb:71:in `content'                                                                                              
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:83:in `create'                                                          
        /var/www/oddb.org/vendor/ruby/2.4.0/gems/htmlgrid-1.1.4/lib/htmlgrid/composite.rb:284:in `compose_component'                               
<..>
192.168.0.1, 192.168.0.80 - - [05/Sep/2017 11:34:10] "GET https://oddb-ci2.dyndns.org/de/gcc/patinfo/reg/00679/seq/02/pack/012 HTTP/1.1" 500 140749 75.0449  "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0"

On thinpower we have 73 patinfo.de which do not have a change_log

ch.oddb> active_packages.find_all{|x| x.patinfo &&  !x.patinfo.de.respond_to?(:change_log)}
-> Array
ch.oddb> $x=active_packages.find_all{|x| x.patinfo &&  !x.patinfo.de.respond_to?(:change_log)}
-> Array
ch.oddb> $x.size
-> 73
-> :!registration,00627!sequence,01!package,001.
ch.oddb> $x.last.pointer
-> :!registration,61252!sequence,01!package,001.
ch.oddb> $x.collect{ |x| x.patinfo.de.class}.uniq
-> [String]

This patinfo.de are all strings which is a case I do not yet handle correctly.

Checking the state before importing gives me

ch.oddb> registration('00679').package('012').patinfo.de.class
-> ODDB::PatinfoDocument
ch.oddb> registration('00679').package('012').patinfo.de.date
-> Diese Packungsbeilage wurde im Juli 2013 letztmals durch die Arzneimittelbehörde (Swissmedic) geprüft.
ch.oddb> registration('00679').package('012').patinfo.de.change_log.class
-> Array
ch.oddb> registration('00679').package('012').patinfo.de.change_log.size
-> 0

Imported correctly a FI and PI, which are displayed nicely via

Stumbled over the case of https://ch.oddb.org/de/gcc/drug/reg/35587/seq/03 where Packungen.xlsx has 2 packages 039 and 047 for the sequence both of which are valid till 06.02.2016. These to sequences are not listed, but the patinfo can be displayed. Is this the correct behviour?

Pushed commits

Heatmap aktivieren

Pulled the changes from Yasuhiro. Added the scrolliris keys from Zeno. Fixed a small problem with the Patinfo, where a counter was not updated correctly. Pushed the commits

Fix error in export drug_shortage

Got the following error

Plugin: ODDB::ShortagePlugin

Error: NoMethodError
Message: undefined method `gsub' for 2017-07-05T00:00:00+00:00:DateTime
Backtrace:
/var/www/oddb.org/src/plugin/shortage.rb:83:in `block (3 levels) in export_drugshortage_csv'
/var/www/oddb.org/src/plugin/shortage.rb:81:in `each'
/var/www/oddb.org/src/plugin/shortage.rb:81:in `block (2 levels) in export_drugshortage_csv'
/var/www/oddb.org/src/plugin/shortage.rb:71:in `each'
/var/www/oddb.org/src/plugin/shortage.rb:71:in `block in export_drugshortage_csv'
/usr/local/ruby-2.4.0/lib/ruby/2.4.0/csv.rb:1299:in `open'
/var/www/oddb.org/src/plugin/shortage.rb:65:in `export_drugshortage_csv'
/var/www/oddb.org/src/util/updater.rb:374:in `block in update_drugshortage'
/var/www/oddb.org/src/util/updater.rb:543:in `wrap_update'
/var/www/oddb.org/src/util/updater.rb:370:in `update_drugshortage'
jobs/update_drugshortage:21:in `block in <module:Util>'
/var/www/oddb.org/src/util/job.rb:40:in `run'
jobs/update_drugshortage:12:in `<module:Util>'
jobs/update_drugshortage:11:in `<module:ODDB>'
jobs/update_drugshortage:10:in `<main>'

Could not reproduce the problem here on oddb-ci2. Adding code to catch this (or similar errors) when running the export.

Pushed commit Raise more interesting error when parsing shortage fails

Pulled changes on thinpower, remove drugshortage-latest.csv and started update_drugshortage again in screen drugshortage.

Ethereum contracs

For the ruby gem ethereum.rb I must install | prerequisites, which needs a tool called parity. Downloaded https://github.com/paritytech/parity/archive/v1.7.0.tar.gz to /usr/local/src

bash <(curl https://get.parity.io -Lk) sudo npm install -g solc

view · edit · sidebar · attach · print · history
Page last modified on September 06, 2017, at 08:33 AM