Must fix a local error where looking at some patinfo created a nil access. Running import_daily again.
Why some files don't get created? Analysing
2016-02-22 19:10:41 +0100: /var/www/oddb.org/src/plugin/text_info.rb:1140:in `parse_fachinfo': parse_fachinfo 1140: no html_name for fachinfo for #<struct Struct::SwissmedicMetaInfo iksnr="14770", authNrs=["14769", "14770", "19932", "56512"], atcCode=nil, title="KétalgineŽ", authHolder=nil, substances=nil, type="fi", lang="fr", informationUpdate=nil, refdata=nil, xml_file="/var/www/oddb.org/data/details/14770_fi_fr.xml"> grep -c Kétalgine data/details/* | grep -v :0 data/details/14769_fi_fr.xml:1 data/details/14770_pi_fr.xml:1
Added some more debugging output. Verified that not all FI get reparsed (but many are, because we now use the file size as indicator whether it was changed). Restarted import_daily.
Wondering why I don't find an entry for IKSNR 65856 in Packungen.XLSX where in swissmedicinfo.ch we can find DIBASE 10'000.
Now I successfully detect the new/updated FI/PI, but I don't get the correct file to parse. Okay. I found the culprit. Must get the first authNr from the metainfo, not the current one. No I must sort them to consistent. E.g. found <authnrs>50710, 54157, 53591, 50709</authnrs>
The new text from swissmedicinfo.ch do not appear immediately in the AipsDownload. Therefore must create a similar XML-file in this case.
Somehow also no Changelog information gets added. Why? Was only considered if using reparse and not with newest. Similar problem for creating new registrations.
When running with the -e option we have 13878 (8513 uniq ones from 002771 to 659731)occurences of oddb_article.xml and 15698 (9810 uniq ones from 002771 up to 660521) in oddb_product.xml.
Creating a uniq constraint for the XSD was easy. Just added at the end of the definition of <xs:element name="PRODUCT">
<xs:unique name="unique-prodno"> <xs:selector xpath="ns1:PRD"/> <xs:field xpath="ns1:PRODNO"/> </xs:unique>
And now a call to xslvalidate throws an error like
xsdvalidate oddb2xml.xsd oddb_product.xml | head oddb_product.xml NOT valid. /opt/src/oddb2xml/oddb_product.xml:32251:3: error: cvc-identity-constraint.4.1: Duplicate key '2781' for unique constraint 'unique-prodno@http://wiki.oddb.org/wiki.php?pagename=Swissmedic.Datendeklaration' /opt/src/oddb2xml/oddb_product.xml:32264:3: error: cvc-identity-constraint.4.1: Duplicate key '2791' for unique constraint 'unique-prodno@http://wiki.oddb.org/wiki.php?pagename=Swissmedic.Datendeklaration' /opt/src/oddb2xml/oddb_product.xml:32303:3: error: cvc-identity-constraint.4.1: Duplicate key '2941' for unique constraint 'unique-prodno@http://wiki.oddb.org/wiki.php?pagename=Swissmedic.Datendeklaration' /opt/src/oddb2xml/oddb_product.xml:32329:3: error: cvc-identity-constraint.4.1: Duplicate key '3131' for unique constraint 'unique-prodno@http://wiki.oddb.org/wiki.php?pagename=Swissmedic.Datendeklaration' /opt/src/oddb2xml/oddb_product.xml:32381:3: error: cvc-identity-constraint.4.1: Duplicate key '3381' for unique constraint 'unique-prodno@http://wiki.oddb.org/wiki.php?pagename=Swissmedic.Datendeklaration' /opt/src/oddb2xml/oddb_product.xml:32626:3: error: cvc-identity-constraint.4.1: Duplicate key '6271' for unique constraint 'unique-prodno@http://wiki.oddb.org/wiki.php?pagename=Swissmedic.Datendeklaration' /opt/src/oddb2xml/oddb_product.xml:32646:3: error: cvc-identity-constraint.4.1: Duplicate key '6281' for unique constraint 'unique-prodno@http://wiki.oddb.org/wiki.php?pagename=Swissmedic.Datendeklaration' /opt/src/oddb2xml/oddb_product.xml:32693:3: error: cvc-identity-constraint.4.1: Duplicate key '6411' for unique constraint 'unique-prodno@http://wiki.oddb.org/wiki.php?pagename=Swissmedic.Datendeklaration' /opt/src/oddb2xml/oddb_product.xml:32738:3: error: cvc-identity-constraint.4.1: Duplicate key '6701' for unique constraint 'unique-prodno@http://wiki.oddb.org/wiki.php?pagename=Swissmedic.Datendeklaration'