---
The task for the new gem gtin2atc is the following. Read in a file lines which start with a valid GTIN (aka EAN13)code.
Then search for the corresponding ATC code.
Source files for the link between GTIN and ATC are:
When a GTIN is found in swissmedic and refdata, do some validity checks. Usually the longer (more specific) ATC-code will win.
Committed Skeleton exists. Running specs fails
Creating a watir test for this behaviour. Corrected address_correction watir test, too with commit Added watir test for home_2_link. Fixed address correction test
Now checking why the companylist does not work. Validator had missing entry for "pharmacylist". More problems, as we want to display only the registration_holders and not other companies (like pharmacies).
Now displaying pharmacies works, too. But I don't know why the companylist shows only 7 (or in ch.oddb.org) 19 items. There is a listed? argument, which purpose I don't grasp, yet. bin/admin shows
ch.oddb> $x= 0; registration_holders.each{ |k,v| $x += 1 if v.listed? }; $x -> 7 ch.oddb> $y= 0; companies.each{ |k,v| $y += 1 if v.listed? }; $y -> 19
If I log in as admin, then much more companies are shown. If I follow the link "Aktuelle Einträge" I get redirected to http://oddb-ci2.dyndns.org/de/gcc/listed_companies/ where I see only the 7 listed companies. Shouldn't the logic be reversed? I must get Zenos opinion. Yes. When not logged in as admin user we should see all registration holders.
In src/model/company.rb we see that the method listed? returns @cl_status.
Pushed my corrections and improved watir tests with Fixed listing companies and pharmacies
Waiting for watir tests to finish before pulling them on thinpower.
When running spec/searchbar_spec.rb I did see the following output on oddbd (and failures in the watir tests)
error in SBSM::Session#process: /de/gcc NoMethodError undefined method `description' for nil:NilClass /var/www/oddb.org/src/state/drugs/fachinfo_search.rb:83:in `block in match_term' /var/www/oddb.org/src/state/drugs/fachinfo_search.rb:82:in `each' /var/www/oddb.org/src/state/drugs/fachinfo_search.rb:82:in `match_term' /var/www/oddb.org/src/state/drugs/fachinfo_search.rb:59:in `search' /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.5/lib/sbsm/state.rb:203:in `_trigger'
Fixed with commit Fix nil access when searching for fachinfo and regenerated FI with jobs/update_textinfo_swissmedicinfo --target=fi --reparse 63166
. Oddbd now display Missing fachinfo for ean13 7680631660014 in pac #<ODDB::Package:0x007f15358791b8>
when the fachinfo is no longer present.
Now the search works better, but we still have a problem at spec/searchbar_spec.rb:90 where we search for analysis.