view · edit · sidebar · attach · print · history

20130924-import-fi-not-in-packages

<< | Index | >>


Summary

  • Import FI even when it is not yet in Packungen.xls

Commits

Index


Import FI even when it is not yet in Packungen.xls

FI, which are not yet in Packungen.xls vorkommen must be imported from ths Swissmedic AIPS XML (E.g. Xeljanz). The meta-data like Swissmedic-Nr, ATC-Code and name should be taken form the AIPS.xml.

In Ai latest.xml we find for Xeljanz

  <medicalInformation type="fi" version="1" lang="de" safetyRelevant="false">
    <title>Xeljanz</title>
    <authHolder>Pfizer AG</authHolder>
    <atcCode>L04AA29 Immunosuppresseur s&amp;eacute;lectif</atcCode>
    <substances>Tofacitinibum</substances>
    <authNrs>62630</authNrs>

Verified that xeljanz is not yet in packungen_latest.xls. Running jobs/jobs/update_textinfo_swissmedicinfo 62630 to see how we behave at the moment. As expected if fails and we see

2013-09-24 08:29:36 +0200: parse_and_update: calls parse_patinfo dist /var/www/oddb.org/data/html/patinfo/de/Xeljanz_swissmedicinfo.html iksnrs_from_xml ["62630"] Xeljanz_swissmedicinfo.html, name Xeljanz de title Xeljanz
2013-09-24 08:29:36 +0200: update_patinfo Xeljanz iksnrs_from_xml ["62630"] empty false
2013-09-24 08:29:36 +0200: No reg found for "62630"

Will introduce a new @iksnrs_meta_info in src/plugin/text_info.rb to track the AIPS-xml.

Adding a test case to test/test_plugin/text_info_swissmedicinfo.rb. Found out that minitest does not handle correctly flexmock.should.once if they fail. The compatibility layer works fine. Therefore rechanged text_info_swissmedicinfo.rb to use the compatibility layer.

Added code to create a new registration


Output fails (not always and gives

OKAY FOR
2013-09-24 14:56:58 +0200: create_registration #<struct Struct::SwissmedicMetaInfo iksnr="63029", atcCode="S01AA27", title="Aprokam®", authHolder="THEA Pharma SA", substances="Cefuroxim">
2013-09-24 14:56:58 +0200: create_registration created reg #<ODDB::Registration:0x00000041c79228 @iksnr="63029", @sequences={}>
2013-09-24 14:56:59 +0200: create_registration create_company THEA Pharma SA
2013-09-24 14:56:59 +0200: create_registration company THEA Pharma SA
2013-09-24 14:57:00 +0200: create_registration create_atc_class S01AA27
2013-09-24 14:57:00 +0200: create_registration atc created 
2013-09-24 14:57:00 +0200: create_registration created sequence 01 with atc 
2013-09-24 14:57:00 +0200: create_registration 63029 #<ODDB::Registration:0x00000041c79228 @odba_id=30350898, @iksnr="63029", @company=THEA Pharma SA, @sequences={}>
2013-09-24 14:57:00 +0200: Check 1 atcCode 
2013-09-24 14:57:00 +0200: Check 2 registration substance_names []
2013-09-24 14:57:00 +0200: Check 3 registration company THEA Pharma SA
2013-09-24 14:57:00 +0200: Check 4 registration iksnr 63029
2013-09-24 14:57:00 +0200: Check 5 registration name_base 

Fails with
2013-09-24 14:57:00 +0200: create_registration #<struct Struct::SwissmedicMetaInfo iksnr="63030", atcCode="R06AX27", title="Desloratadin Spirig HC® ", authHolder="Spirig HealthCare AG", substances="Desloratadin">
2013-09-24 14:57:00 +0200: create_registration created reg #<ODDB::Registration:0x00000043bcfd48 @iksnr="63030", @sequences={}>
2013-09-24 14:57:00 +0200: create_registration company Spirig HealthCare AG
2013-09-24 14:57:02 +0200: create_registration existing atc 
2013-09-24 14:57:02 +0200: create_registration 63030 #<ODDB::Registration:0x00000043bcfd48 @odba_id=30350900, @iksnr="63030", @company=#<ODBA::Stub:552368160#27652860 @odba_class= @odba_container=56637300#3>, @sequences={"01"=>#<ODBA::Stub:51920680#16248 @odba_class= @odba_container=29378820#17>}>
2013-09-24 14:57:02 +0200: Check 1 atcCode Desloratadin

Decided after discussion with Zeno to create an artifical sequence '00'. Normally sequences start with '01', therefore we will have to see whether the sequence '00' will automatically be deletede when the new numbers appear in Packungen.xls. If not they are easily visible and can be removed when running the import, or via a seperate batch file.

Running my new import looks better. I was able to create an registration, but I have an error when creating the sequence, e.g.

2013-09-24 17:19:45 +0200: import_swissmedicinfo_by_iksnrs ["62630"] target both
2013-09-24 17:20:34 +0200: create_registration set company 'Spirig HealthCare AG'
NoMethodError: undefined method `atc_classes' for #<Array:0x0000004371e650> when updating index 'atc_index_company' with a ODDB::Company
["/usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing'", "/var/www/oddb.org/src/model/company.rb:49:in `block in atc_classes'", "/var/www/oddb.org/src/model/company.rb:48:in `each'", "/var/www/oddb.org/src/model/company.rb:48:in `inject'"]
[...]

2013-09-24 17:20:38 +0200: create_registration created atc R06AX27
Could not create: :!00., reason: :!00. -> undefined Method OddbPrevalence::sequence(00)
2013-09-24 17:20:38 +0200: create_registration 63030 :!create,:!registration,63030..
2013-09-24 17:20:38 +0200: Check 1 atcCode Desloratadin
2013-09-24 17:20:38 +0200: Check 3 registration company Spirig HealthCare AG
2013-09-24 17:20:38 +0200: Check 4 registration iksnr 63030
2013-09-24 17:20:38 +0200: Check 5 registration name_base 

Fixed this problem. Now I have one (at the end?)

2013-09-24 17:41:56 +0200: import_swissmedicinfo_by_iksnrs ["62630"] target both
2013-09-24 17:42:49 +0200: create_registration set company 'Stallergenes AG'
2013-09-24 17:42:52 +0200: create_registration created atc V01AA
2013-09-24 17:43:29 +0200: create_registration 69870 :!create,:!registration,69870..
2013-09-24 17:43:29 +0200: Check 1 atcCode Allergen-Extrakte
2013-09-24 17:43:29 +0200: Check 3 registration company Stallergenes AG
2013-09-24 17:43:29 +0200: Check 4 registration iksnr 69870
2013-09-24 17:43:29 +0200: Check 5 registration name_base STALORAL Pollen, Lösung zur sublingualen Anwendung
2013-09-24 17:43:29 +0200: create_registration set company 'Farmaceutica Teofarma Suisse SA'
2013-09-24 17:43:31 +0200: create_registration created atc D07CC02
2013-09-24 17:43:32 +0200: create_registration 29300 :!create,:!registration,29300..
2013-09-24 17:43:32 +0200: Check 1 atcCode Fluocinolonacetonid und Antibiotika
2013-09-24 17:43:32 +0200: Check 3 registration company FARMACEUTICA TEOFARMA SUISSE SA
2013-09-24 17:43:32 +0200: Check 4 registration iksnr 29300
2013-09-24 17:43:32 +0200: Check 5 registration name_base Synalar®-N
2013-09-24 17:43:32 +0200: create_registration set company 'Helvepharm AG'
2013-09-24 17:43:38 +0200: create_registration created atc C03CA04
2013-09-24 17:43:40 +0200: create_registration 57487 :!create,:!registration,57487..
2013-09-24 17:43:40 +0200: Check 1 atcCode Torasemid
2013-09-24 17:43:40 +0200: Check 3 registration company Helvepharm AG
2013-09-24 17:43:40 +0200: Check 4 registration iksnr 57487
2013-09-24 17:43:40 +0200: Check 5 registration name_base Torasemid Helvepharm
2013-09-24 17:43:40 +0200: create_registration set company 'Pfizer AG'
2013-09-24 17:43:46 +0200: create_registration created atc L04AA29
2013-09-24 17:43:47 +0200: create_registration 62630 :!create,:!registration,62630..
2013-09-24 17:43:47 +0200: Check 1 atcCode not found
2013-09-24 17:43:47 +0200: Check 3 registration company Pfizer AG
2013-09-24 17:43:47 +0200: Check 4 registration iksnr 62630
2013-09-24 17:43:47 +0200: Check 5 registration name_base Xeljanz
2013-09-24 17:43:47 +0200: create_registration created company Bausch &#038; Lomb Swiss AG
2013-09-24 17:43:48 +0200: create_registration created atc S01BC11
2013-09-24 17:43:49 +0200: create_registration 62786 :!create,:!registration,62786..
2013-09-24 17:43:49 +0200: Check 1 atcCode Bromfenac
2013-09-24 17:43:49 +0200: Check 3 registration company Bausch &#038; Lomb Swiss AG
2013-09-24 17:43:49 +0200: Check 4 registration iksnr 62786
2013-09-24 17:43:49 +0200: Check 5 registration name_base Yellox
2013-09-24 17:43:49 +0200: create_registration set company 'Spirig HealthCare AG'
NoMethodError: undefined method `atc_classes' for #<Array:0x0000004530c510> when updating index 'atc_index_company' with a ODDB::Company
["/usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing'", "/var/www/oddb.org/src/model/company.rb:49:in `block in atc_classes'", "/var/www/oddb.org/src/model/company.rb:48:in `each'", "/var/www/oddb.org/src/model/company.rb:48:in `inject'"]
[...]

Received error mail msg with

Plugin: ODDB::TextInfoPlugin
Error: TypeError
Message: can't dup NilClass
Backtrace:
/var/www/oddb.org/src/util/oddbapp.rb:1007:in `dup'
/var/www/oddb.org/src/util/oddbapp.rb:1007:in `search_by_substance'
/var/www/oddb.org/src/util/oddbapp.rb:1279:in `unique_atc_class'
/var/www/oddb.org/src/plugin/text_info.rb:605:in `create_registration'
/var/www/oddb.org/src/plugin/text_info.rb:634:in `block in add_all_iksnr'
/var/www/oddb.org/src/plugin/text_info.rb:630:in `each'
/var/www/oddb.org/src/plugin/text_info.rb:630:in `add_all_iksnr'
/var/www/oddb.org/src/plugin/text_info.rb:668:in `block in get_pis_and_fis'
/usr/local/lib64/ruby/gems/1.9.1/gems/nokogiri-1.6.0/lib/nokogiri/xml/node_set.rb:237:in `block in each'
/usr/local/lib64/ruby/gems/1.9.1/gems/nokogiri-1.6.0/lib/nokogiri/xml/node_set.rb:236:in `upto'
/usr/local/lib64/ruby/gems/1.9.1/gems/nokogiri-1.6.0/lib/nokogiri/xml/node_set.rb:236:in `each'
/var/www/oddb.org/src/plugin/text_info.rb:649:in `get_pis_and_fis'
/var/www/oddb.org/src/plugin/text_info.rb:1169:in `swissmedicinfo_xml'
/var/www/oddb.org/src/plugin/text_info.rb:1344:in `import_swissmedicinfo_by_iksnrs'
/var/www/oddb.org/src/plugin/text_info.rb:1390:in `import_swissmedicinfo'
<..>

Will continue tomorrow.

view · edit · sidebar · attach · print · history
Page last modified on September 24, 2013, at 05:46 PM