view · edit · sidebar · attach · print · history

2014 | Niklaus.20141216-fix-address-correction >>

20141217-fix-address-correction

Summary

  • Fix suggest address correction for pharmacies
  • improve medreg gem
  • Rewrite import_medreg_doctors to use the yaml file from medreg

Commits

Index

Keep in Mind for work to do in 2015
  • 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!
  • medreg gem should skip adress lines consisting of a single '.'. e.g. medregom displays for 7601000264015 and address
  • medreg gem should generate csv files, too. If more than 1 address/experiences, etc per doctor, then generate additional lines
  • search for registration holder like mepha should work. bin/admin works for search_companies('Mepha')
  • info registration holder like mepha should should include fields like ydim-i. Mepha (No) and Novartis Ophthalmics AG (Yes, but fields are empty)
  • creat gem: task: input=file with ean-codes, standard output show ean-codes + atc-code. Source is Swissmedic Packungen.xlsx or XML.
  • Display 10 recalls not only those from this month
  • Import via data/medreg_companies.yaml

---

Rewrite import_medreg_doctors to use the yaml file from medreg

Okay. This was easy and the unit-tests is much simpler than before too. Imported the first 10 doctors. The real import (once DB was loaded) took less than 2 seconds. When running it a second time, no record was change (Corrected: When running a second time no yaml file was read). Fine. But I must document this behaviour and distinguish between updated and unchanged doctors. This proved to be impossible without additional work, eg. an address is compared using its OID which is always different. Also comparing the specialities/capabilites is difficult as the are arrays. Therefore I decided it was not worth effort. Now an email contains a resumen like

Doctors update from /var/www/oddb.org/data/medreg_doctors.yaml

Number of doctors in database: 35014
Number of doctors in import:   10
New doctors:                   0
Updated doctors:               10
Unchanged doctors:             0

Also found out, that the yaml files produced by the old import were in curious encoding where the Umlauts were not properly UTF-8 encoded. YAML files produced by the medreg gem were all correctly UTF-8 encoded.

Pushed commit Import via data/medreg_doctors.yaml

improve medreg gem

The following problems should be corrected:

  • clearer status message to see, where we are
  • after an interrupted import, the next one should pick up all already used imported stuff
  • Adress lines consisting of a single '.' should be skipped, e.g. medregom displays for 7601000264015 and address
A.
.
6929 Gravesano
Telefon: 091 760 00 75
Fax: 091 760 00 76

Updated import of doctors to pick up at the last state. Adapted unit tests. Same for companies. Pushed commit Fixed unit-tests. Pick-up from last import

Creating helper script to merge all yaml files. Pushed commits

It was easy to merge my different yaml outputs to a single input file with 32868 entries (File is 20 MB). Now looking for a way to import the generated yaml file into the oddb.org database by modifing the medreg importer.

Fix suggest address correction for pharmacies

Corrected yesterday most error. Now I still have to fix the link http://oddb-ci2.dyndns.org/de/gcc/address_suggestion/pharmacy/7601001380028/oid/32401536, which looks okay, but get the error

error in SBSM::Session#http_headers: /de/gcc/address_suggestion/pharmacy/7601001380028/oid/32401536
NoMethodError
undefined method `active_address' for #<ODDB::State::Drugs::Init:0x00000008be4f30>
/var/www/oddb.org/src/view/admin/address_suggestion.rb:129:in `address'
/usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:68:in `create'
/usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:286:in `compose_component'
/usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:211:in `block in compose'
/usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.6/lib/htmlgrid/composite.rb:205:in `each'

Here we come because the concerned address_suggestion does not contain a address_pointer. Comparing it in bin/admin with a good one

ch.oddb> address_suggestion(32401536).name
-> Apotheke Moor
ch.oddb> address_suggestion(32401536).time
-> 2014-12-16 22:32:26 +0100
ch.oddb> address_suggestion(32401536).address_pointer.class
-> NilClass
ch.oddb> address_suggestion(32401536).parent.oid
-> 32375338
ch.oddb> address_suggestion(32401536).parent.class
-> ODDB::Company

# here a good one
ch.oddb> address_suggestions.first[1].address_pointer
-> :!doctor,4869!address,0.

Now I am asking myself how to correct this situation. Adding correct pointers for all pharamcies and their addresses via a bin/admin script? Or patching them when creating an address suggestion? Neither one. Decided to improve searching for parent in src/state/admin/address_suggestion.rb

Completed watir tests for address_suggestions and made them pass. OID are fix coded. Pushed commit Fix address_suggestion for pharmacies. Add watir test

view · edit · sidebar · attach · print · history
Page last modified on September 02, 2015, at 11:26 AM