view · edit · sidebar · attach · print · history

Index>

20150610-oddb2xml-with-vcr

Summary

  • Use vcr with oddb2xml
  • Fix oddb2xml --calc when Packungen.xlsx does not contain a name for a product

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.
  • Get updated ATC-codes from EPha for oddb.org, too.
  • Display new fields (LABEL, MORE_INFO, CORRESP) for compositions in oddb.org.
  • Use refdatabase for oddb.org, too.

Fix oddb2xml --calc when Packungen.xlsx does not contain a name for a product

Fixed with commit Avoid error when Packungen.xlsx does not contain a name for a product

Use vcr with oddb2xml

Using VCR gem. This seems to be a lot easier way to run tests based on a real input Summarized my useage of VCR in the README.md

  • we use the gem VCR to record real HTTP responses.
    • Removing the directory fixtures and running bundle exec rspec spec/downloader_spec.rb gets the actual content from the different servers
    • To minimize the downloaded size we use several before_record hooks to select the desired content, eg. only the 5 items from EPha.

Working on SwissmedicInfo where I have to unzip the encoded to get AIPS*.xml, then delete most, etc. Then I must repack it again.

Done limiting size for

  • Epha (CSV)
  • SwissIndex (Pharma & NonPharma) (xml)
  • BagXML (Zipped xml)
  • ZurRose (txt)
  • SwissmedicInfo (xml) Here I have a problem, that after deleting many rows I cannot open the generated xlsx file with libreoffice.
  • Medreg (Person)
  • Medreg (Betriebe)

As reading the unzipped AipsDownload.xml takes over 15 minutes using rexml, we read the xml from the spec/data/.

Not necessary (small files)

  • BMUpdate
  • Lppv
  • Migel

Discovered gem timecop which makes it easy to freeze the time. This returns always the same time.

But this did not my resolve my problem. Discovered that it is best to insert/eject the cassette using before/after(:each), as ejecting the cassette actually writes the content to the file.

Pushed my local vcr branch. See Using vcr to mock http-access

Having still 5 failing unit-tests, which will be fixed next week.

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