view · edit · sidebar · attach · print · history

20110531-impfstoff_blutprodukt_flag-testcase-swissindex-ch_oddb

<< | Index | >>


  1. Testcases ch.oddb
  2. Check the latest Blutprodukte

Goal/Estimate/Evaluation
  • Testcase ch.oddb / 87% /
Milestones
  • testcases, swissindex
Summary
Commits

Testcases ch.oddb

Total coverage: 86.49%

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

Commit

Check the latest Blutprodukte

Problem

  • For example, Registration (number 00277) is 'Blutprodukte' but the box 'Impfstoff/Blutprodukt' is not checked

Check

ch.oddb> self.registrations.values.select{|r| r.iksnr == '00277'}[0].name_base
-> Coeur-Vaisseaux Sérocytol
ch.oddb> self.registrations.values.select{|r| r.iksnr == '00277'}[0].production_science
-> Blutprodukte
ch.oddb> self.registrations.values.select{|r| r.iksnr == '00277'}[0].vaccine
-> 

Cause

  • The Impfstoff/Blutprodukt is saved in ODDB::Registration@production_science variable
  • The check box is reflected from ODDB::Registration@vaccine (boolean) value

Solution

  • When the @production_science is updated, also the @vaccine should be updated

Check all heilmittelcode (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

Result

Consider

  • All the list should be 'true'

Experiment (src/plugin/swissmedic.rb#update_registration)

    def update_registration(row, opts = {})
      first_day = Date.new(today.year, today.month, 1)
      opts = {:date => first_day, :create_only => false}.update(opts)
      opts[:date] ||= first_day
      group = cell(row, column(:production_science))
      if(group != 'Tierarzneimittel')
        iksnr = cell(row, column(:iksnr))
        return if (filter = opts[:iksnr]) && iksnr != filter
        return if (filter = opts[:iksnrs]) && !filter.include?(iksnr)
        science = cell(row, column(:production_science))
        ptr = if(registration = @app.registration(iksnr))
                return registration if opts[:create_only]
                registration.pointer
              else
                Persistence::Pointer.new([:registration, iksnr]).creator
              end
        expiration = date_cell(row, column(:expiry_date))
        reg_date = date_cell(row, column(:registration_date))
        vaccine = if science =~ /Blutprodukte/ or science =~ /Impfstoffe/
                    true
                  else
                    nil
                  end
        args = {
          :ith_swissmedic      => cell(row, column(:index_therapeuticus)),
          :production_science  => science,
          :vaccine             => vaccine,
          :registration_date   => reg_date,
          :expiration_date     => expiration,
          :renewal_flag        => false,
          :renewal_flag_swissmedic => false,
          :inactive_date       => nil,
          :export_flag         => nil,
        }

Run

  • jobs/import_swissmedic_only

Result

ODDB::SwissmedicPlugin - Report 31.05.2011
Created Packages: 385
Updated Packages: 18238
Deleted Packages: 78 (0 Replaced)
Deleted Sequences: 216
Deactivated Registrations: 473
Updated new Export-Registrations: 7181
Updated existing Export-Registrations: 423
Updated new Export-Sequences: 10730
Updated existing Export-Sequences: 597
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.

Run

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

Result

Note

  • failed
  • The result is the same as before

Next

  • Trace update_registration

Experiment

  • delete the registrations that we want to update from Packungen-latest.xls
  • (for example, here, the registrations number 00274 and 00277 are deleted from Packungen-latest.xls)

Run

  • jobs/import_swissmedic_only

Result

ODDB::SwissmedicPlugin - Report 31.05.2011
Created Packages: 4
Updated Packages: 0
Deleted Packages: 0 (0 Replaced)
Deleted Sequences: 0
Deactivated Registrations: 0
Updated new Export-Registrations: 2
Updated existing Export-Registrations: 7602
Updated new Export-Sequences: 2
Updated existing Export-Sequences: 11325
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.
  • heilmittelcode.txt
masa@masa ~/work $ diff heilmittelcode.dat heilmittelcode.dat.org 
1,2c1,2
< 00274, Blutprodukte, true
< 00277, Blutprodukte, true
---
> 00274, Blutprodukte, nil
> 00277, Blutprodukte, nil

Next

  • Final check in local
  • Delete all the records from Packungen-latest.xls
  • Run jobs/import_swissmedic_only

Commit

view · edit · sidebar · attach · print · history
Page last modified on May 31, 2011, at 04:35 PM