Index>
20151125-oddb2xml-check-fields
Summary
- Unit tests must check for all fields mentioned in the XSD files
- Finish back trackingfor for fachinfo in oddb.org
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.
- Use refdatabase for oddb.org, too.
- Check whether we should revert the part which touche src/plugin/text_info.rb of commit 17af82ba4d76a5838683411b260de265531f9e74. We should improve test/stub/oddbapp.rb to work similar for update/pointer as the real oddbapp. In this case we would have a good Stub for plugins. May we need a different stub when working with plugins (which create/modify/destroy ODDB-Objects), when in most other cases a very simple stub is sufficient.
- When a logged in admin user changes an atc_code of a product, the corresponding atc_class must update its sequences, too.
- Order of entering search type and value should not matter. Both should show long URL with search
Unit tests must check for all fields mentioned in the XSD files
To avoid error like yesterday, I must verify that all fields mentioned in the XSD files are really checked via Unit-Tests.
I want to add a datastructure to be able to iterate over all fields and values, eg. both true and false should be present. Will start with oddb_calc.xsd, as it is the simpler case with only one xml file and not many fields. This proved to be quite simple as demonstrated with this snippet
fields = { 'ARTICLES/ARTICLE/COMPOSITIONS/COMPOSITION/SUBSTANCES/SUBSTANCE/UNIT' => 'mg' }.each do |field, value|
it "should have correct entries for field #{field}" do
nokogiri = Nokogiri::XML(File.read(@oddb_calc_xml))
expect( nokogiri.search(field, nil, { :value => value}).first.text).to eql value
end
end
Adding a similar test for checking attributes. Done for oddb_calc.xml with commit Checking all elements from XSD in oddb_calc.xml
While adding the tests for oddb_article, I remarked that I don't see any NINCD with value '20' (20 => (LPPV) Limitation) in the produced oddb_article.xml. Pushed commits Bumped version to 2.2.8 and Improved spec tests against all XSD elements
Looking into how to fix the NINCD 20 problem. First had to Refactored extractor_spec to use common_before/after. This was stupid error: used an integer instead of string to lookup whether there is a lppv item or not. Fixed with commit Fixed NINCD for LPPV items.
Pushed commits Prepared for release 2.2.8 and Ensure creating workdir before chdir. Should fix errors on Travis-CI
* Finish back trackingfor fachinfo in oddb.org
Removing debug puts from my mondays patch. Running watir tests. The new backtracking elements for the changelogs don't have the expected css-class 'th-pointersteps', therefore my watir tests fail. Will think about it in the next days, but pushed commit -m [https://github.com/ngiger/oddb.org/commit/9dd69d3a38371f9590dbc99a9a397c8b607d6ccc|Fix backtracking for fachinfo]], which should be okay for oddb.org.