view · edit · sidebar · attach · print · history

20110406-update-renewal_flag-testcases-test_view-fipi_offer-substance

<< | Index | >>


  1. Update testcases
  2. Update renewal_flag

Goal/Estimate/Evaluation
  • Testcases / 81% / 80.41%
Milestones
  • Update testcases
    1. src/view/user/fipi_offer_input.rb (coverage: 100%) 8:30
    2. src/view/user/fipi_offer_confirm.rb (coverage: 100%) 9:10
    3. src/view/substances/substance.rb (coverage: 100%) 10:00
    4. src/view/admin/entity.rb (coverage: 60.91%)
Summary
Commits

Memo: Parallel Processing

pid1 = fork {
  # sub process 1
  3.times do
   p "W"
   200000000.times {}
  end
}
pid2 = fork do
  # sub process 2
  3.times do
    p "Q"
    100000000.times {}
  end
end

th1 = Process.detach(pid1)
th2 = Process.detach(pid2)
p th1.value
p th2.value

More simple one

10.times { |i|
  pid = fork {
    exec "sleep #{i}; echo #{i}"
  }
}
p Process.waitall

system2

def system2 str
  Process.wait2 fork {exec str}
end
system2 "sleep 1;echo 'A'"
system2 "sleep 2;echo 'B'"
system2 "sleep 3;echo 'C'"
p "END"

Note

  • We can use Ctl-C to stop all the processes

Update renewal_flag

Note

  • We need the renewal_flag packages updated only by update_swissmedic (not manually)

Updated

    registration_data :comarketing_with, :complementary_type, :expiration_date,
      :expired?, :export_flag, :fachinfo_active?, :generic_type,
      :inactive_date, :pdf_fachinfos, :registration_date, :revision_date,
      :patent, :patent_protected?, :vaccine, :parallel_import, :minifi,
      :source, :index_therapeuticus, :ith_swissmedic, :has_fachinfo?, :production_science, :renewal_flag,
      :renewal_flag_swissmedic
    attr_accessor :registration_date, :export_flag, :company,
      :revision_date, :indication, :expiration_date, :inactive_date,
      :manual_inactive_date, :deactivate_fachinfo, :activate_fachinfo,
      :market_date, :fachinfo, :source, :ikscat, :renewal_flag, #:pdf_fachinfos,
      :renewal_flag_swissmedic,@
    #renewal_flag = pack.renewal_flag
    renewal_flag = pack.renewal_flag_swissmedic
    if renewal_flag
      @counts['renewal_flag'] += 1
    end
    boolean(renewal_flag)
end

Restart

  • oddb.org/bin/oddbd
  • oddb.org/ext/export/bin/exportd

Run

masa@masa ~/ywesee/oddb.org $ bin/admin 
ch.oddb> Updater.new(self).update_swissmedic
-> Hash
ch.oddb> exit
-> Goodbye
masa@masa ~/ywesee/oddb.org $ bin/admin 
ch.oddb> Updater.new(self).export_oddb_csv
-> mhatakeyama@ywesee.com
ch.oddb> 

Note

  • Updater.new(self).update_swissmedic takes about 10 mins
  • Updater.new(self).export_oddb_csv takes about 3 mins

Result

 ODDB::SwissmedicPlugin - Report 06.04.2011
 Created Packages: 384
 Updated Packages: 18133
 Deleted Packages: 89 (0 Replaced)
 Deleted Sequences: 209
 Deactivated Registrations: 471
 Updated new Export-Registrations: 0
 Updated existing Export-Registrations: 433
 Updated new Export-Sequences: 0
 Updated existing Export-Sequences: 614
 Total Sequences without ATC-Class: 12
 anthroposophy                      292
 bsv_dossiers                      3309
 complementary                      281
 deductible_g                      8623
 deductible_o                        49
 duplicates                           0
 expiration_date                  21858
 export_registrations               668
 galenic_forms                      326
 generics                          4665
 has_generic                          0
 homeopathy                         806
 inactive_date                     4926
 limitation_both                    142
 limitation_points                  142
 limitation_texts                  1323
 limitations                       1323
 lppv                               600
 missing_size                        28
 originals                         2134
 out_of_trade                      3723
 phytotherapy                      1341
 price_exfactory                   9848
 price_public                     12374
 registration_date                23491
 renewal_flag                         0
 routes_of_administration             0
 sl_entries                        8672

Check renewal_flag from bin/admin

masa@masa ~/ywesee/oddb.org $ bin/admin
ch.oddb> ODDB::Package.find_by_pharmacode(1059082)
-> #<ODDB::Package:0x7fd1844f48b0>
ch.oddb> ODDB::Package.find_by_pharmacode(1059082).name
-> Sirdalud 2 mg, Tabletten
ch.oddb> ODDB::Package.find_by_pharmacode(1059082).renewal_flag
-> true
ch.oddb> ODDB::Package.find_by_pharmacode(1059082).renewal_flag_swissmedic
-> 

Note

  • It seems that the value (true/false) is not saved in the 'renewal_flag_swissmedic' variable by update_swissmedic method

Next

  • Delete old date records from Packungen.xls and save it as Packungen-latest.xls

Commit

view · edit · sidebar · attach · print · history
Page last modified on April 07, 2011, at 02:32 PM