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.
--verify-sha filename
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.
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
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
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.