view · edit · sidebar · attach · print · history

Index>

20170925-swissmedic-import

Summary

  • Import swissmedic must remove all packages of not listed registrations and update correctly fields like expiration_date
  • Expired drugs should not be shown when search is limited to active registrations, eg mephadolor
  • Keep in Mind

Commits

Index

Import swissmedic must remove all packages of not listed registrations and update correctly fields like expiration_date

We remarked the following two deficiencies:

  1. I shows int the mail 8282 Deactivated Registrations, but there are packages laying around which should not longer exits
  2. The field expiration_date is not correctly updated

Additionally to the current swissmed-diff we

  • must iterate over all packages in swissmedic-packages to see whether all fields are correct
  • iterate over all packages in the database and either mark all packages from registrations no longer in swissmedic-pacakges as inactive or delete them.

Looking via bin/admin at some examples and for packages which are inactive but not expired using

ch.oddb> packages.find_all{|x| x.inactive_date}.size
-> 6072
ch.oddb> packages.find_all{|x| x.inactive_date}.first.iksnr
-> 54930
ch.oddb> packages.find_all{|x| x.inactive_date}.first.name_base
-> Insulin CP Pharma Hypurin Porcine Isophane Vial
ch.oddb> packages.find_all{|x| x.inactive_date}.first.inactive_date
-> 2015-12-11
ch.oddb> packages.find_all{|x| x.inactive_date}.last.iksnr
-> 65035
ch.oddb> packages.find_all{|x| x.inactive_date}.last.name_base
-> Rizatrip-Mepha oro 10 mg
ch.oddb> packages.find_all{|x| x.inactive_date}.last.inactive_date
-> 2015-11-03

Fixed the display problem with Apply search filter to results, too

We want to compare on the command line Packungen-2016.01.09.xlsx Packungen-2017.09.07.xlsx using swissmedic-diff, using swissmedic-diff Packungen-2016.01.09.xlsx Packungen-2017.09.07.xlsx 2>&1 | tee swissmedic-diff.log This fails

/home/niklaus/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/swissmedic-diff-0.2.2/lib/swissmedic-diff.rb:334:in `get_column_indices': undefined method `filepath' for #<RubyXL::WorkbookRoot:0x00559ed96994c0> (NoMethodError)
        from /home/niklaus/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/swissmedic-diff-0.2.2/lib/swissmedic-diff.rb:228:in `_known_data'
        from /home/niklaus/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/swissmedic-diff-0.2.2/lib/swissmedic-diff.rb:223:in `known_data'
        from /home/niklaus/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/swissmedic-diff-0.2.2/lib/swissmedic-diff.rb:141:in `diff'
        from /home/niklaus/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/swissmedic-diff-0.2.2/bin/swissmedic-diff:46:in `<top (required)>'
        from /home/niklaus/.rbenv/versions/2.4.0/bin/swissmedic-diff:22:in `load'
        from /home/niklaus/.rbenv/versions/2.4.0/bin/swissmedic-diff:22:in `<main>'

This error does not occur when one runs bundle exec swissmedic-diff Packungen-2016.01.09.xlsx Packungen-2017.09.07.xlsx. Looks like with bundler we get other gems included, as rubyXML is in both cases 3.1.1

The 57787 mephadolor does not show up in swissmedic-diff.log. Why?

In the unit test of swissmedic-diff there is no test which checks whether a change in the column "Gültigkeits-datum *" leads to an output. Changing one element in the unit tests and adding a check for the expiration_date.

Trying to determine since when the swissmedic-diff no longer handles the expiration_date correctyl I found

git diff cdcf232900871ab3a89487414826629b2f3e3db2..872059eb647bcb7e057b1657e01d66896130b32b test
<..>
       assert_equal <<-EOS.strip, @diff.to_s
-+ 10999: Osanit, hom<F6>opathische K<FC>gelchen
-+ 57699: Pyrazinamide Labatec, comprim<E9>s
-- 10368: Alcacyl, Tabletten
-> 09232: Weleda Schnupfencr<E8>me, anthroposophisches Heilmittel; Namens<E4>nderung (Weleda Schnupfencr<E8>me, anthroposophisches Heilmittel)
-> 25144: Panadol, Filmtabletten; Packungs-Nummer (031 -> 048)
-> 57678: Amlodipin-besyl-Mepha 5, Tabletten; Zulassungsinhaber (Vifor SA), Index Therapeuticus (07.10.5.), ATC-Code (D11AF), Ablaufdatum der Zulassung (10.05.2017), Abgabekategorie (A)
++ 00275: Cardio-Pulmo-Rénal Sérocytol, suppositoire
++ 61416: Otriduo Schnupfen, Nasentropfen
+- 00274: Cardio-Pulmo-Rénal Sérocytol, suppositoire
+> 00277: Coeur-Vaisseaux Sérocytol, suppositoire; Namensänderung (Coeur-Vaisseaux Sérocytol, suppositoire)
+> 61338: Cefuroxim Fresenius i.v. 750 mg, Pulver zur Herstellung einer i.v. Lösung; Zulassungsinhaber (Fresenius Kabi (Schweiz) AG), ATC-Code (J01DC02)
+> 61367: Hypericum-Mepha 250, Lactab; Packungs-Nummer (005 -> 006)
       EOS

Looking at https://github.com/ngiger/swissmedic-diff/commit/5ef3962a96dfabb26e96c559aa941f69f2c68b90 I found that there.

Fixed with commits

Released swissmedic-diff gem 0.2.3. Running swissmedic-diff Packungen-2016.01.09.xlsx Packungen-2017.09.07.xlsx 2>&1 | tee swissmedic-diff-2.log Seems to work as we have

grep 57787 swissmedic-diff*.log 
swissmedic-diff-2.log:> 57787: Mephadolor 500 Neo, Filmtabletten; Ablaufdatum der Zulassung (11.10.2021)
grep -c Ablaufdatum swissmedic-diff-2.log 
1779

Means that we have 1779 changed Ablaufdatum between January 2016 and September 2017 and probably all of them were not updated.

Improving the :check option to verify that all expired_dates are set correctly. Code begins to work. Adding changed expiration_dates to the generated mail.

Pushed commits

Expired drugs should not be shown when search is limited to active registrations, eg mephadolor

It is clear, that the packages should be greyed out, as ch.oddb.org thinks they are expired. There is however also an error in the database, because bin/admin show the expirationdate as

ch.oddb> registration('57787').name_base
-> Mephadolor 500 Neo
ch.oddb> registration('57787').packages.collect{|x| x.expiration_date}
-> [2016-10-11, 2016-10-11, 2016-10-11]

whereas in Packungen.xlsx it is 11.10.2021.

view · edit · sidebar · attach · print · history
Page last modified on September 25, 2017, at 04:51 PM