Examples are:
In both cases no "Drucken" is displayed right to the titlename.
Similar results on oddb-ci2. A wrong PI is displayed. Find lines like
2016-03-04 14:29:41 +0100: /var/www/oddb.org/src/plugin/text_info.rb:286:in `store_patinfo_for_all_packages': store_patinfo update for reg.iksnr 58145 lang de existing oid 34450980 []
2016-03-04 14:32:26 +0100: /var/www/oddb.org/src/plugin/text_info.rb:1208:in `parse_textinfo': parse_textinfo 1208: must create textinfo for pi de 65236 of ["65235", "65236"]
2016-03-04 14:32:26 +0100: /var/www/oddb.org/src/plugin/text_info.rb:317:in `update_patinfo_lang': update_patinfo_lang #<struct Struct::SwissmedicMetaInfo iksnr="65236", authNrs=["65235", "65236"], atcCode=nil, title="Trulicity®", authHolder="Eli Lilly (Suisse) SA", substances="Dulaglutid", type="pi", lang="de", informationUpdate="10.2014", refdata=nil, xml_file="/var/www/oddb.org/data/details/65235_pi_de_Trulicity__problem.xml", same_content_as_xml_file=true> ["de"]
Another problem is that Ebixa Tropflösung
IKNSR 55829 was deleted again instead of creating it.
But first I reload the database to get the same data as thinpower.
After a discussion with Zeno we decided that we will first open the Packungen.xlsx and double check whether we really need to import the FI/PI or whether the package is outdated. (But we must still be able to add newly created FI/PI!). This will probably require some refactoring for the unit tests where we did not use the Packungen.xlsx at all. Reading the Packungen-latest.xlsx takes about 1 minute and a half.
While adapting the source code I remark that the jobs/check_swissmedicno_fi_pi was not run for a long time and that its code is broken, as it had no propert unit test. Fixing this.
When running import_daily I added a binding.pry whenever I did not find a package in Packungen.xlsx. It broke with a very curious error as => #<struct Struct::IKS_Package iksnr="00666", seqnr="01", ikscd="001", name_base="Octanate 250 IE, Trockensubstanz">
for IKSNR 00666 no package 004 was read, only a 0001. But 002 and 003 were present. Why? My Packungen-latests.xlsx is the same as data/xls/Packungen-2016.02.16.xlsx, but the newest is data/xls/Packungen-2016.03.05.xlsx.
Now it reports (correctly) the following missing packages:
There are over 90 of these kind (including 6 occurrences of Ebixa 55828). Therefore I think I must first have a look at why the import_swissmedic did not fix this problem! Resetting Packungen-latest.xlsx to state of february and running jobs/import_swissmedic_only.
Looking at the code of plugin/swissmedic.rb I do not find any place, where we do a safety check, that all packages occurring in Packungen.xlsx really exist. Therefore missing somehow an addition will never be fixed. I think it should be easy (and quite fast) to add such a check.
Added a new line in the report "Re-Created missing Packages". First idea using update_package did not work. Must use update_registration. But this does not work correctly neither. Must reload database. Break after first recreate for debugging. Also Ebixa is the only one, where we have a mismatch of the sequence.iksnr. Updating unit test for this situation takes time, too.
Changing some comparision from string to integer via to_i fixed deactivating way too many packages.