view · edit · sidebar · attach · print · history

Index>

20150601-search-order-ventolin

Summary

  • oddb.org: Fix search order for ventolin

Commits

Index

Keep in Mind for work to do
  • Fix dojo error http://www.sitepen.com/blog/2012/10/31/debugging-dojo-common-error-messages/#forgot-dom-ready
  • I removed on May-27 tests for ix_registrationss, fix_sequences, fix_compositions, fix_packages from test/test_plugin/swissmedic.rb,as he could not find any references for them in the src code. Did I erroneously remove stuff when cleaning up the swissmedic import earlier?
  • The whole test for older/newer Packages must be adapted to xlsx. One must compare the rows (e.g. by creating csv files) and do the same stuff in xlsx!
  • creat gem: task: input=file with ean-codes, standard output show ean-codes + atc-code. Source is Swissmedic Packungen.xlsx or XML.
  • Import via data/medreg_companies.yaml
  • Fix problem with radioactivatum 99m-technetio when parsing Wirkstoffe
  • Fix galenic_forms when parsing swissmedic.xlsx
  • Cleanup generic_type. Replace it everywhere by sl_generic_type and adapt code accordingly.

oddb.org: Fix search order for ventolin

When logged in as desitin the search order of ventolin is not correct. Is not correct because

  • the original must be at the first place
  • Ventolin is alphabetically before Ventolin 1

Result of http://ch.oddb.org/de/gcc/search/zone/drugs/search_query/Ventolin/search_type/st_oddb?#best_result is

The first columsn for searching by Ventolin on evidentia.ch return

Salbutamol (R03AC02) 12 Präparate     
Ventolin 1 mg/ml  Infusionskonzentrat 5mg / 5ml 5 1 
Ventolin 1 mg/ml  Infusionskonzentrat 5mg / 5ml 5 1 
Ventolin 0.5 mg/ml  Injektionslösung  0.5 mg/ml 5 1 
Ventolin 5 mg/ml  Lösung  5 mg/ml 20 ml
Salamol Autohaler Dosier-Aerosol  0.1 mg  200 Inhalation(en)
Salbu Orion Easyhaler ug Inhalationspulver  100 µg  
Salbu Orion Easyhaler ug Inhalationspulver  200 µg  
Ventolin  Dosier-Aerosol  0.1 mg  0.1 mg  
Ventolin 1,25 mg/2,5 ml Lösung  1.25 mg 60 Einzeldosen  
Ventolin  Sirup 2mg / 5ml 150 ml  1.78 
Ventolin Diskus Multidosen-Pulverinhalator  200 µg  60 Einzeldosen
Ventolin 0.5 mg/ml  Injektionslösung  0.5 mg/ml 5 1 Ampulle(n) ą 1 ml

Zeno wants the to sort by

  1. Original (SL)
  2. Generikum (SL)
  3. Nicht klassifiziert (SL)
  4. Bei Refdata nicht gelistet.

befor sorting by the galenic form

Improved the debugging output. Now I see in the oddbd-console output, that some Ventolin products are not classified as originals and thereof are shown after Salamol Autohaler.

id   1: 7680443970240 expired? fal out_of_trade fal priorize fals 1 (:or/nil) 'Ventolin 1 mg/ml' gal_name ["Infusionskonzentrat"] name "Ventolin"
id   2: 7680443970226 expired? fal out_of_trade fal priorize fals 1 (:or/nil) 'Ventolin 1 mg/ml' gal_name ["Infusionskonzentrat"] name "Ventolin"
id   3: 7680443970233 expired? fal out_of_trade fal priorize fals 1 (:or/nil) 'Ventolin 0.5 mg/ml' gal_name ["Injektionslösung"] name "Ventolin"
id   4: 7680373970242 expired? fal out_of_trade fal priorize fals 1 (:un/:or) 'Ventolin 5 mg/ml' gal_name ["Lösung"] name "Ventolin"
id   5: 7680550920022 expired? fal out_of_trade fal priorize fals 3 (:un/nil) 'Salamol Autohaler' gal_name ["Dosier-Aerosol"] name "Salamol Autohaler"
id   6: 7680543200193 expired? fal out_of_trade fal priorize fals 3 (:un/nil) 'Ventolin' gal_name ["Dosier-Aerosol"] name "Ventolin"
id   7: 7680373970327 expired? fal out_of_trade fal priorize fals 3 (:un/nil) 'Ventolin 1,25 mg/2,5 ml' gal_name ["Lösung"] name "Ventolin"
id   8: 7680538980178 expired? fal out_of_trade fal priorize fals 3 (:un/nil) 'Ventolin Diskus' gal_name ["Multidosen-Pulverinhalator"] name "Ventolin Diskus"
id   9: 7680372620131 expired? fal out_of_trade fal priorize fals 3 (:un/nil) 'Ventolin' gal_name ["Sirup"] name "Ventolin"
id  10: 7680531900500 expired? fal out_of_trade fal priorize fals 3 (:un/nil) 'Salbu Orion Easyhaler' gal_name ["ug Inhalationspulver"] name "Salbu Orion Easyhaler"
id  11: 7680531900517 expired? fal out_of_trade fal priorize fals 3 (:un/nil) 'Salbu Orion Easyhaler' gal_name ["ug Inhalationspulver"] name "Salbu Orion Easyhaler"
id  12: 7680443970134 expired? fal out_of_trade tru priorize fals 4 (:or/nil) 'Ventolin 0.5 mg/ml' gal_name ["Injektionslösung"] name "Ventolin"

Looking at a similar example, the search for "Loperamid". The third product Iomodiu (which points to http://evidentia.oddb.org/de/evidentia/compare/ean13/7680431390104) is (according to an email not a generic and should be listed later). The debug output shows

id   1: 7680403630177 expired? fal out_of_trade fal priorize fals 1 (:or/:or) 'Imodium' gal_name ["Kapseln"] name "Imodium"
id   2: 7680403630252 expired? fal out_of_trade fal priorize fals 1 (:or/:or) 'Imodium' gal_name ["Kapseln"] name "Imodium"
id   3: 7680431390104 expired? fal out_of_trade fal priorize fals 1 (:or/nil) 'Imodium' gal_name ["Sirup"] name "Imodium"
id   4: 7680529650127 expired? fal out_of_trade fal priorize fals 2 (:ge/:ge) 'Loperamid-Mepha 2' gal_name ["Filmtabletten"] name "Loperamid-Mepha 2"
id   5: 7680529650202 expired? fal out_of_trade fal priorize fals 2 (:ge/:ge) 'Loperamid-Mepha 2' gal_name ["Filmtabletten"] name "Loperamid-Mepha 2"
id   6: 7680560490027 expired? fal out_of_trade fal priorize fals 2 (:ge/:ge) 'Loperamid Helvepharm 2mg' gal_name ["Kapseln"] name "Loperamid Helvepharm"
id   7: 7680560490041 expired? fal out_of_trade fal priorize fals 2 (:ge/:ge) 'Loperamid Helvepharm 2mg' gal_name ["Kapseln"] name "Loperamid Helvepharm"
id   8: 7680612950011 expired? fal out_of_trade fal priorize fals 2 (:ge/:ge) 'Loperamid Sandoz' gal_name ["Kapseln"] name "Loperamid Sandoz"
id   9: 7680612950028 expired? fal out_of_trade fal priorize fals 2 (:ge/:ge) 'Loperamid Sandoz' gal_name ["Kapseln"] name "Loperamid Sandoz"
id  10: 7680536860281 expired? fal out_of_trade fal priorize fals 2 (:ge/:ge) 'Loperamid Streuli' gal_name ["Kapseln"] name "Loperamid Streuli"
id  11: 7680536860366 expired? fal out_of_trade fal priorize fals 2 (:ge/:ge) 'Loperamid Streuli' gal_name ["Kapseln"] name "Loperamid Streuli"
id  12: 7680536860441 expired? fal out_of_trade fal priorize fals 2 (:ge/nil) 'Loperamid Streuli' gal_name ["Kapseln"] name "Loperamid Streuli"
id  13: 7680630360014 expired? fal out_of_trade fal priorize fals 3 (nil/nil) 'Amavita Loperamid 2 mg' gal_name ["Kapseln"] name "Amavita Loperamid"
id  14: 7680654200013 expired? fal out_of_trade nil priorize fals 3 (nil/nil) 'Coop Vitality Loperamid 2 mg' gal_name ["Kapseln"] name "Coop Vitality Loperamid"
id  15: 7680510420340 expired? fal out_of_trade fal priorize fals 3 (nil/nil) 'Lopimed' gal_name ["Kapseln"] name "Lopimed"
id  16: 7680510420425 expired? fal out_of_trade fal priorize fals 3 (nil/nil) 'Lopimed' gal_name ["Kapseln"] name "Lopimed"
id  17: 7680529750186 expired? fal out_of_trade fal priorize fals 3 (:un/nil) 'Imodium lingual' gal_name ["Schmelztabletten"] name "Imodium lingual"
id  18: 7680580590011 expired? fal out_of_trade fal priorize fals 3 (nil/nil) 'Imodium lingual Durchfall akut' gal_name ["Schmelztabletten"] name "Imodium lingual Durchfall akut"
id  19: 7680613660049 expired? fal out_of_trade fal priorize fals 3 (nil/nil) 'Imodium' gal_name ["Softkapseln"] name "Imodium"
id  20: 7680613660025 expired? fal out_of_trade tru priorize fals 4 (nil/nil) 'Imodium' gal_name ["Softkapseln"] name "Imodium"
id  21: 7680613660056 expired? fal out_of_trade tru priorize fals 4 (nil/nil) 'Imodium' gal_name ["Softkapseln"] name "Imodium"

Here the problem is, that in the ODDB.org database EAN13 7680431390104 is listed as an original. bin/admin reports

ch.oddb> registration('43139').sequence('01').package('010').sl_generic_type
-> 
ch.oddb> registration('43139').sequence('01').package('010').sl_generic_type.class
-> NilClass
ch.oddb> registration('43139').sequence('01').package('010').generic_type
-> original

Now analysing the problem why this is not displayed as being generic. Reason is that when displaying whether a drug is generic or not src/view/drugs/package.rb looks only at the field sl_generic_type, whereas we often have also a method generic_type for a registration, which return the generic_type for the given company. We must rethink/rework the whole stuff about generic_type as nowadays we often have companies which produce generics and original drugs at the same time. This method (in src/model/registration.rb) is also marke with the comment def generic_type # This is old value. Pleas use Package#sl_generic_type

In src/plugin/bsv_xml.rb we find the following code snippet

        when 'OrgGenCode'
          gtype = GENERIC_TYPES[@text]
          unless (registration = @app.registration(@iksnr) and registration.keep_generic_type)
            @reg_data.store(:generic_type, (gtype || :unknown))
          end
          @pac_data.store :sl_generic_type, gtype

Now I want to find all registrations which have flag keep_generic_type. Found 3 entries via bin/admin

ch.oddb> $res= registrations.find_all{ |k,v| v.iksnr if v.keep_generic_type}
-> Array
ch.oddb> $res.size
-> 3
ch.oddb> $res[0]
-> ["54268", #<ODBA::Stub:55268540#27773 @odba_class= @odba_container=67494680#22>]
ch.oddb> $res[1]
-> ["54467", #<ODBA::Stub:57079520#25886 @odba_class= @odba_container=67494680#22>]
ch.oddb> $res[2]
-> ["55431", #<ODBA::Stub:58418140#24305 @odba_class= @odba_container=67494680#22>]
ch.oddb> 

Names are [Orfiril long 150 mg, Diazepam Desitin 5 mg, Orfiril long 500 mg]

Use only sl_generic_type in src/util/resultsort.rb to make result consistent with visual information.

Pushed commit

Fixed some unit test with commit Set TZ to UTC while running test

view · edit · sidebar · attach · print · history
Page last modified on June 01, 2015, at 10:22 PM