<< | Index | >>
z.B. (fachinfo.yaml)
article_codes: - :article_ean13: "7680274430289" :article_size: 40 g - :article_ean13: "7680274430449" :article_size: 100 g ...
after ran ext/export/bin/exportd, I tried
$ ruby jobs/export_patinfo_yaml
got error.
jobs/export_patinfo_yaml:14:in `block in <module:Util>': undefined method `export_patinfo_yaml' for #<ODDB::Exporter:0x9909ea4> (NoMethodError) from /var/www/oddb.org/src/util/job.rb:18:in `call' from /var/www/oddb.org/src/util/job.rb:18:in `run' from jobs/export_patinfo_yaml:13:in `<module:Util>' from jobs/export_patinfo_yaml:12:in `<module:ODDB>' from jobs/export_patinfo_yaml:11:in `<main>'
There is not export_patinfo_yaml for job.
added in src/util/exporter.rb
... def export_patinfo_yaml exporter = YamlExporter.new(@app) safe_export 'patinfo.yaml' do exporter.export_patinfos end end ...
Attach:Added-export_patinfo_yaml-method-for-job-exporter.patch-20120309.txt
via binadmin
ch.oddb> Exporter.new(self).export_patinfo_yaml
Error: DRb::DRbConnError Message: connection closed
Extracted Sample file (see buttom) Attach:patinfo.yaml-20120309.txt
exportd ouput (what is this errror... suspend)
$ bin/exportd ... loading testenvironment disabling UPDATER ... loading testenvironment2 ODBA::Stub was unable to replace #28427454 from ODDB::Patinfo:#23699560
tried fachinfo.yaml
got warnnig mail.
Message: YamlExporter#export_fachinfs method is still running, but I found some missing Fachinfo document data. This may cause an error in export ebooks process of ebps. There is no 'fr' description of Fachinformation of the following Swissmedic Registration (Company, Product, Numbers): [" 1. ProReo Pharma AG, Methotrexat Proreo 10 mg / 1 ml, 51078\n", " 2. Iromedica AG, Maku Mucolyticum, 58502\n"]
This is a very heavy job.
I downloaded fachinfo.yaml.gz from production server.
article_codes in RegistrationObserver
class.
tested to get barcode(EAN code),pharmacode and etc. via sequence
ch.oddb> registration('31706').sequences.values.first.packages.values.first.barcode -> 7680317060176 ch.oddb> registration('31706').sequences.values.first.packages.values.first.pharmacode -> 223332 ch.oddb> registration('31706').sequences.values.first.packages.values.first.size -> 50 Tablette(n) ch.oddb> registration('31706').sequences.values.first.packages.values.first.dose -> 10 mg
ch.oddb> registration('31706').sequences.values.first.each_package.first.dose
updated following files, then ran Exporter job.
exported patinfo.yaml:
... article_codes: - :article_ean13: "7680473110128" :article_pcode: "2678798" :article_size: 30 Tablette(n) :article_dose: 5 mg - :article_ean13: "7680473110203" :article_pcode: "2678806" :article_size: 100 Tablette(n) :article_dose: 5 mg ...
Attach:Added-article_codes-in-exported-patinfo_yaml.patch-20120309.txt
Fachinfo has check method for blank description
Added(updated) checker method like fachinfo's one.
This method send warnig notification.
get iksnr via Sequence
ch.oddb> patinfos.first.last.sequences.first.registration.iksnr -> 42675
In only a few case, Patinfo doesn't have any sequences, company_name, description.
If I access this object, error caused.
backed to above error.
ODBA::Stub was unable to replace #28427454 from ODDB::Patinfo:#23699560
via bin/admin (strange data)
ch.oddb> ODBA.cache.fetch('23699560') -> undefined method `empty?' for nil:NilClass ch.oddb> ODBA.cache.fetch('28427454') -> Unknown odba_id 28427454
ch.oddb> ODBA.cache.fetch('11578635') -> ODDB::Patinfo ch.oddb> ODBA.cache.fetch('11578635').company_name -> ch.oddb> ODBA.cache.fetch('11578635').name_base ->
Maybe, 'ODBA::Stub was unable to replace: error also comes from store(editing) via browser.
ch.oddb> patinfos.values.first.descriptions['fr'] = nil
->
ch.oddb> patinfos.values.first.descriptions['fr']
->
ch.oddb> patinfos.values.first.descriptions.class
-> ODDB::SimpleLanguage::Descriptions
ch.oddb> patinfos.values.first.class
-> ODDB::Patinfo
ch.oddb> patinfos.values.first.odba_store
-> ODDB::Patinfo
ch.oddb> patinfos.values.first.odba_id
-> 2242
# exit / reboot oddbd
ch.oddb> ODBA.cache.fetch('2242').class
-> ODDB::Patinfo
ch.oddb> ODBA.cache.fetch('2242').descriptions['de'].class
-> ODDB::PatinfoDocument
ch.oddb> ODBA.cache.fetch('2242').descriptions['fr'].class
-> NilClass
Skipped this unexpected data, I could got waring e-mail.