<< | Index | >>
Note
Server yus setting
$ yus_show mhatakeyama@ywesee.com Password for mhatakeyama@ywesee.com: ["mhatakeyama@ywesee.com", ["credit", [["org.oddb.download"]]], ["login", [["org.oddb.de.Admin"], ["org.oddb.de.PowerUser"]]], ["reset_password", []], ["set_password", [["mhatakeyama@ywesee.com"]]], ["view", [["org.oddb.de"]]], ["RootUser"]]
Local yus setting
masa@masa ~/ywesee/yus $ bin/yus_show mhatakeyama@ywesee.com Password for mhatakeyama@ywesee.com: ["mhatakeyama@ywesee.com", ["credit", [["org.oddb.download"]]], ["login", [["org.oddb.de.Admin"]]], ["reset_password", []], ["set_password", [["mhatakeyama@ywesee.com"]]]]
Note
Add RootUser grant
masa@masa ~/ywesee/yus $ bin/yus_grant mhatakeyama@ywesee.com login org.oddb.RootUser Password for mhatakeyama@ywesee.com: granted permission to login org.oddb.RootUser for mhatakeyama@ywesee.com until masa@masa ~/ywesee/yus $ bin/yus_show mhatakeyama@ywesee.com Password for mhatakeyama@ywesee.com: ["mhatakeyama@ywesee.com", ["credit", [["org.oddb.download"]]], ["login", [["org.oddb.RootUser"], ["org.oddb.de.Admin"]]], ["reset_password", []], ["rootuser", [["org.oddb"]]], ["set_password", [["mhatakeyama@ywesee.com"]]]]
Then it works.
http://oddb.masa.org/de/gcc/resolve/pointer/%3A!registration%2C00332.
Note
src/state/admin/registration.rb#update
class Registration < State::Admin::Global VIEW = View::Admin::RootRegistration SELECT_STATE = State::Admin::SelectIndication include RegistrationMethods def update keys = [ :inactive_date, :generic_type, :registration_date, :revision_date, :market_date, :expiration_date, :complementary_type, :export_flag, :renewal_flag, :renewal_flag_swissmedic, :parallel_import, :index_therapeuticus, :ignore_patent, :ith_swissmedic, :activate_fachinfo, :deactivate_fachinfo, :manual_inactive_date ] if(@model.is_a? Persistence::CreateItem) iksnr = @session.user_input(:iksnr) if(error_check_and_store(:iksnr, iksnr, [:iksnr])) return self elsif(@session.app.registration(iksnr)) error = create_error('e_duplicate_iksnr', :iksnr, iksnr) @errors.store(:iksnr, error) return self else @model.append(iksnr) end end do_update(keys) end
Note
Experiment (src/state/admin/registration.rb#update )
def update
keys = [
:inactive_date, :generic_type, :registration_date,
:revision_date, :market_date, :expiration_date,
:complementary_type, :export_flag, :renewal_flag,
:renewal_flag_swissmedic,
:parallel_import, :index_therapeuticus, :ignore_patent,
:ith_swissmedic, :activate_fachinfo, :deactivate_fachinfo, :manual_inactive_date,
:vaccine
]
Result
Note
Commit
src/plugin/swissmedic.rb#update
src/util/oddbapp.rb
def all_heilmittelcode open("/home/masa/work/heilmittelcode.dat", "w") do |out| @registrations.values.each do |reg| out.print reg.iksnr, ", ", reg.production_science, ", ", reg.name_base, "\n" end end end
check_heilmittelcode.rb
# 20110530 masa # Compare Impfstoffe/Blutprodukte between xls and oddb # from csv list = [] File.readlines('pack.csv').each_with_index do |line, i| x = line.split(/;/) if x[0] and x[6] and x[0].gsub(/"/,'').to_i > 0 list << [x[0].gsub(/"/,''), x[6].gsub(/"/,'')] end end print "total registration (Pack.xls): ", list.uniq.length, "\n" csv_list = Hash[*(list.uniq.flatten)] print "Impfstoffe/Blutprodukte : ", list.uniq.select{|x| x[1] =~ /Impfstoffe/ or x[1] =~ /Blutprodukte/}.length, "\n" # from oddb list = [] File.readlines('heilmittelcode.dat').each do |line| x = line.split(/,/) list << [x[0], x[1]] end print "total registration (ch.oddb) : ", list.uniq.length, "\n" print "Impfstoffe/Blutprodukte : ", list.uniq.select{|x| x[1] =~ /Impfstoffe/ or x[1] =~ /Blutprodukte/}.length, "\n" oddb_list = Hash[*(list.uniq.flatten)] diff = {} csv_list.each do |k,v| if v.strip == "Impfstoffe" or v.strip == "Blutprodukte" unless oddb_list[k] diff[k] = [v, nil] else if v.strip != oddb_list[k].strip #print v, "\t", oddb_list[k], "\n" diff[k] = [v, oddb_list[k]] end end end end print "different: ", diff.keys.length, "\n"
Result
total registration (Pack.xls): 7867 Impfstoffe/Blutprodukte : 163 total registration (ch.oddb) : 10350 Impfstoffe/Blutprodukte : 172 different: 0
Note
The current total coverage: 86.19%
Commit