view · edit · sidebar · attach · print · history

Index>

20150908-visual-changes-for-evidentia

Summary

  • Cleanup display for compositions
  • changes needed for evidentia
  • Add a hash for each top-lelel XML-element when running oddb2xml -e

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.

Add a hash for each top-lelel XML-element when running oddb2xml -e

A client requested a hash tag for each article, which should only change when the content of the corresponding article has changed.

But first I must make the unit tests pass again, which is broken since I tried to adapt to then new column layout of Packungen.xlsx.

I see the following requirements.

  • Calculate a SHA256|512 value of the text output of each element (without the SHA attribute)
  • The SHA-value must be verifiable when reading the XML. Maybe we should provide an option like --verify-sha filename
  • Should we create an SHA value for the content of the whole file? No. Zeno is not interested in.
  • Should we sign the content of the whole file with a given key? (See https://github.com/ebeigarts/signer) No. Zeno is not interested in.

Looks like it might be quite simple (except that it needs to reload the big XML-files a second time).

    def HashBuilder.add_hash(string)
      doc = Nokogiri::XML.parse(string)
      doc.root.elements.each do |node|
        next if node.name.eql?('RESULT')
        node.attributes['SHA256'] = Digest::SHA256.hexdigest node.text
      end
    end

will produce an file like

?xml version="1.0" encoding="utf-8"?>
<CODE xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://wiki.oddb.org/wiki.php?pagename=Swissmedic.Datendeklaration" CREATION_DATETIME="2015-09-08T15:05:31+0200" PROD_DATE="2015-09-08T15:05:31+0200" VALID_DATE="2015-09-08T15:05:31+0200">
  <CD DT="" SHA256="f9eac2c19c5d2187cabab3a602bf0d1d6fa9a601158c2ce10929166ad81a9b72">
    <CDTYP>0</CDTYP>
    <CDVAL>first</CDVAL>
    <DSCRSD>first_text</DSCRSD>
    <DEL>false</DEL>
  </CD>
  <RESULT>
    <OK_ERROR>OK</OK_ERROR>
    <NBR_RECORD>1</NBR_RECORD>
    <ERROR_CODE/>
    <MESSAGE/>
  </RESULT>
</CODE>

How long does this take for big files? Testing with a 100 MB bit document took about 17 seconds. I thinks this is a reasonable price to pay and the solution is quite clean.

Having problem to regenerate a correct VCR cassette. Debugging downloader_spec.rb.

Cleanup display for compositions

Must remove empty rows when fields like corresp, excipiens, labels are not present.

Introducing a method reorganze_components. Remarked that using @compositions or composition has a very different effect, as HTMLGrid::Composite contains a method components which return @components ||= self::class::COMPONENTS.dup. Therefore I must use @compositions = new_hash to really change the grid layout.

Fixed the problem with commit Fix layout for compositions.

Now the layout looks fine for me

changes needed for evidentia

I am looking at the following needs of evidentia. (eg. when looking on oddb-ci2 at Keppra)

The following changes are still pending

Attach:Evidentia_Change_Requests.pdf

  1. Display "Fach-info" (two lines) as header above the FI
  2. Display upto 3 Wirkstoffe by name (at the moment only 1), when more display "<nr>Wirkstoffe"
  3. Remove completely rows (Receipt, PI, Comarketing, et al) shown as empty columns

A trademark with 3 active agents is Dipeptiven. A trademark with 4 active agent is Vitalipid. Fixed point 1 with commit Add fachinfo header for evidentia

Fixed point 2 with commit Display 3 substances in resultlist for evidentia. Fixed most unit-tests in resultlist

To ease debugging some unit tests I have committed Display @substance_name if neither substance nor dose is given

As a result of my reworking the components show for evidentia yesterday. I find no longer any empty columns.

view · edit · sidebar · attach · print · history
Page last modified on September 08, 2015, at 04:52 PM