view · edit · sidebar · attach · print · history

Index>

20141021-import-doctor-data

Summary

  • import import medical doctors from BAG

Commits

Index

Keep in Mind
  • 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!

---

import import medical doctors from BAG

Continuing work from last week. Yesterday. Must add watir as gem to oddb.org to use it. Added watir-rspec to groups development and test to write shorter lines in the specs.

Even when I usually prefer working with css/xpath to find elements we do not have a good structure in the medregom page. Therefore I will use a text pattern matching analysis of the whole page, which will probably a lot faster, too.

And there are problems, e.g. 7601000186874 a Marca Luca 6925 Gentilino Tessin CH Ärztin/Arzt Ja Nein cannot be found via http://www.medregom.admin.ch/de/Suche using a search via PLZ or GLN.

Must find out what a doc_id is and where it comes from. Using bin/admin

ch.oddb> doctors.size
-> 34663
ch.oddb> doctors.first
-> [9740, #<ODBA::Stub:84239500#431213 @odba_class=ODDB::Doctor @odba_container=99367360#393389>]
ch.oddb> doctors.first[1]
-> #<ODDB::Doctor:0x007f9ec5ea24f8>
ch.oddb> doctors.first[1].origin_id
-> 19781                                                                                                                                                                                   
ch.oddb> doctors.first[1].origin_db
-> ch

Must be an old id from the import using src/plugin/doctor. It is not the same as https://www.medreg.admin.ch/MedReg/Summary.aspx?IdPerson=39168 which has an origin_id 19781. Therefore adding in oddbapp.rb an new function doctor_by_gln.

My unit-test now parses 9 doctors in 52 seconds (skips saving the addressses).

Adding jobs/import_medreg_doctors with the possibility to specify one or more GLNs to import.

Zeno had the excellent idea to save each imported doctor in a CSV file. But I think I will write a yaml file as I have quite a few variants in my data (addresses, etc). This looks already quite good. File has UTF-8 encoding and looks good for me on my local vile system, even if does not correctly displays non ASCII characters in the attachement. See Attach:doctors_2014_10_21_yaml_2.txt But the addresses of Dr. Zwingli are wrong as there are many of the same canton! Fixed this program and uploaded new yaml result to attachment.

Adding unit tests for get_latest (from url https://www.medregbm.admin.ch/Publikation/CreateExcelListMedizinalPersons).

Now the import_regmed_doctors should run, but I get an error X11 connection rejected because of wrong authentication. when starting the chrome browser. Trying with firefox. If this does not work, I will debug this error tomorrow. But at least I already get mails when an error occurs. My X-connection is not valid for the apache user the import is running under. Must probably install xvfb or similar to fix this problem.

Pushed commit Scraping unit test for medreg doctors works. Added jobs/import_medreg

view · edit · sidebar · attach · print · history
Page last modified on October 21, 2014, at 05:35 PM