view · edit · sidebar · attach · print · history

20110601-impfstoff_blutprodukt_flag-testcase-compare-subgroup-fachinfo-ch_oddb

<< Masa.20110603-fix-active_agents-testcases-view-activeagent-suggest_address-narcotics-ch_oddb | 2011 | Masa.20110531-impfstoff_blutprodukt_flag-testcase-swissindex-ch_oddb >>


  1. Log: import_swissmedic_only yesterday
  2. Create a new bin/admin command to update only I/B flag
  3. Testcases ch.oddb

Goal/Estimate/Evaluation
  • IB flag update / 100% / 100%
  • Testcase / 87% / 87.02%
Milestones
Summary
Commits
  1. Updated testcases, state/drugs/compare.rb, fachinfo.rb, and view/migel/subgroup.rb (ch.oddb)

Log: import_swissmedic_only yesterday

Procedure

  1. Delete all the line of Packungen-latest.xls
  2. Execute jobs/import_swissmedic_only
ODDB::SwissmedicPlugin - Report 31.05.2011
Created Packages: 18622
Updated Packages: 0
Deleted Packages: 0 (0 Replaced)
Deleted Sequences: 0
Deactivated Registrations: 0
Updated new Export-Registrations: 7159
Updated existing Export-Registrations: 445
Updated new Export-Sequences: 10695
Updated existing Export-Sequences: 632
Total Sequences without ATC-Class: 12
http://oddb.masa.org/de/gcc/resolve/pointer/:!registration,57441!sequence,01.
http://oddb.masa.org/de/gcc/resolve/pointer/:!registration,57525!sequence,01.
http://oddb.masa.org/de/gcc/resolve/pointer/:!registration,58550!sequence,01.
http://oddb.masa.org/de/gcc/resolve/pointer/:!registration,59080!sequence,01.
http://oddb.masa.org/de/gcc/resolve/pointer/:!registration,59290!sequence,01.
http://oddb.masa.org/de/gcc/resolve/pointer/:!registration,59338!sequence,01.
http://oddb.masa.org/de/gcc/resolve/pointer/:!registration,60413!sequence,01.
http://oddb.masa.org/de/gcc/resolve/pointer/:!registration,61207!sequence,01.
http://oddb.masa.org/de/gcc/resolve/pointer/:!registration,61408!sequence,01.
http://oddb.masa.org/de/gcc/resolve/pointer/:!registration,61436!sequence,01.
http://oddb.masa.org/de/gcc/resolve/pointer/:!registration,61471!sequence,01.
http://oddb.masa.org/de/gcc/resolve/pointer/:!registration,61540!sequence,01.

Online

Local

Note

  • IB flag is correctly updated
  • But there are some differences
    1. All packages are created
    2. 'Exportregistration' is checked
    3. 'Produktgruppe' is deleted
    4. Sequence name changes

Memo yus_add_user, yus_grant

for ch.oddb

masa@masa ~/ywesee/yus $ bin/yus_add_user mhatakeyama@ywesee.com login org.oddb.RootUser
masa@masa ~/ywesee/yus $ bin/yus_grant mhatakeyama@ywesee.com edit yus.entities
masa@masa ~/ywesee/yus $ bin/yus_grant mhatakeyama@ywesee.com edit org.oddb.drugs
masa@masa ~/ywesee/yus $ bin/yus_show mhatakeyama@ywesee.com
Password for mhatakeyama@ywesee.com: 
["mhatakeyama@ywesee.com",
 ["edit", [["org.oddb.drugs"], ["yus.entities"]]],
 ["login", [["org.oddb.RootUser"]]],
 ["reset_password", []],
 ["set_password", [["mhatakeyama@ywesee.com"]]]]

Note

  • yus_add_user requires a new password for the new account, but this password is not valid.
  • In order to valid it, I have to reset the password from the webinterface.
  • This is also the same for de.oddb
  • In de.oddb, there is not interface to reset the password, so we have to use the ch.oddb interface to reset the password even in de.oddb
  • Online, RootUser group is created and RootUser group has the privileges, login org.oddb.RoogUser, edit org.oddb.drugs and edit yus.entities
  • These privileges are not shown in the online server by yus_show command
  • Then, RootUser box should be checked from the web interface of Admin -> Benutzer
masa@masa ~/ywesee/yus/bin $ ./yus_show mhatakeyama@ywesee.com
Password for mhatakeyama@ywesee.com: 
["mhatakeyama@ywesee.com",
 ["edit", [["yus.entities"]]],
 ["login", [["org.oddb.RootUser"]]],
 ["reset_password", []],
 ["set_password", [["mhatakeyama@ywesee.com"]]],
 ["view", [["org.oddb"]]],
 ["RootUser"]]

See more: Attach:yus/Guide.20110601.txt

Create a new bin/admin command to update only I/B flag

Check the current I/B flags (src/util/oddbapp.rb)

  def all_heilmittelcode
    open("/home/masa/work/heilmittelcode.dat", "w") do |out|
      @registrations.values.select{|r| r.production_science =~ /Blutprodukte/ or r.production_science =~ /Impfstoffe/}.sort_by{|r| r.iksnr}.each do |reg|
        out.print reg.iksnr, ", ", reg.production_science, ", ", reg.vaccine, "\n"
      end
    end
  end

Run

masa@masa ~/ywesee/oddb.org $ bin/admin
ch.oddb> all_heilmittelcode

Result

Experiment (src/util/oddbapp.rb)

  def update_ibflag
    @registrations.values.select{|r| r.production_science =~ /Blutprodukte/ or r.production_science =~ /Impfstoffe/}.sort_by{|r| r.iksnr}.each do |reg|
      unless reg.vaccine
        ptr = reg.pointer
        args = {:vaccine => true}
        update ptr, args, :swissmedic
      end
    end
  end

Run

masa@masa ~/ywesee/oddb.org $ bin/admin
ch.oddb> update_ibflag

Result

Note

  • Success
  • All the registrations are updated

Commit

Testcases ch.oddb

  1. src/state/drugs/compare.rb (coverage: 100%)
  2. src/view/migel/subgroup.rb (coverage: 100%)
  3. src/state/drugs/fachinfo.rb (coverage: 100%)
  4. src/view/admin/activeagent.rb (coverage: 79.44%)
  5. src/view/suggest_address.rb (coverage: 69.81%)

Commit

  1. Updated testcases, state/drugs/compare.rb, fachinfo.rb, and view/migel/subgroup.rb (ch.oddb)
view · edit · sidebar · attach · print · history
Page last modified on April 25, 2012, at 02:50 PM