view · edit · sidebar · attach · print · history

20130409-update-swissregd-debug-oddb2-csv

<< | Index | >>


Summary

  • Update swissregd
  • Debug oddb2.csv creation (export)

Commits

Index


Update swissregd

swissreg server is still error.
I could not confirm code-changes.

Maybe Configuration of Apache and Tomcat.

Plugin: ODDB::SwissregPlugin
Error: RuntimeError
Message: could not connect to www.swissreg.ch: #<Net::HTTPInternalServerError:0x00000002eeecb8>
Backtrace:
(druby://localhost:10007) /var/ch.oddb.org/src/util/http.rb:86:in `post'
(druby://localhost:10007) /var/ch.oddb.org/ext/swissreg/src/session.rb:115:in `post'
(druby://localhost:10007) /var/ch.oddb.org/ext/swissreg/src/session.rb:106:in `get_result_list'
(druby://localhost:10007) /var/ch.oddb.org/ext/swissreg/src/swissreg.rb:10:in `search'
...

These value is not handled correctly by redirects on swissreg.ch.

  • javax view states
  • cookie
commits

Check request headers.

via net/http
"POST https://www.swissreg.ch/srclient/faces/jsp/trademark/sr1.jsp HTTP/1.1\r\n

Host: www.swissreg.ch\r\n
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20100101 Firefox/16.0\r\n
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1\r\n
Accept-Language: de-ch,en-us;q=0.7,en;q=0.3\r\n
Accept-Charset: UTF-8\r\n
Keep-Alive: 300\r\n
Connection: keep-alive\r\n
Cookie: JSESSIONID=90DF4CE295F976F7430016905CDC25B3.tomcat01\r\n
Content-Type: application/x-www-form-urlencoded\r\n
Content-Length: 441\r\n\r\n"

<- "autoScroll=0%2C0&id_swissreg%3AmainContent%3Aid_txf_tm_no=&id_swissreg%3AmainContent%3Aid_txf_app_no=&id_swissreg%3AmainContent%3Aid_txf_tm_text=Albumin*&id_swissreg%3AmainContent%3Aid_txf_applicant=&id_swissreg%3AmainContent%3Asub_fieldset%3Aid_submit=suchen&id_swissreg_SUBMIT=1&id_swissreg%3A_idcl=&id_swissreg%3A_link_hidden_=&javax.faces.ViewState=rO0ABXVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAAN0AAExcHQADi9qc3Avc3RhcnQuanNw"
via browser
Accept	text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding	gzip, deflate
Accept-Language	en-US,en;q=0.5
Connection	keep-alive
Cookie	JSESSIONID=BD12C08F38C2FBF3B171EF1D97C49677.tomcat01
Host	www.swissreg.ch
Referer	https://www.swissreg.ch/srclient/faces/jsp/trademark/sr1.jsp
User-Agent	Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20100101 Firefox/16.0

autoScroll=0%2C0&id_swissreg%3AmainContent%3Aid_txf_tm_no=&id_swissreg%3AmainContent%3Aid_txf_app_no=&id_swissreg%3AmainContent%3Aid_txf_tm_text=Albumin*&id_swissreg%3AmainContent%3Aid_txf_applicant=&id_swissreg%3AmainContent%3Asub_fieldset%3Aid_submit=suchen&id_swissreg_SUBMIT=1&id_swissreg%3A_idcl=&id_swissreg%3A_link_hidden_=&javax.faces.ViewState=rO0ABXVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAAN0AAIyM3B0ABYvanNwL3RyYWRlbWFyay9zcjEuanNw

Debug oddb2.csv

oddb2.csv has wrong records, because current oddb2.csv hat broken connections on 04.01.

Currently, FI/PI data in database are already fine. (descriptions)
Then I export oddb2.csv via Job.

  • Galenic Form
src/util/updater.rb
    def export_oddb2_csv(date = @@today)
      subj = 'oddb2.csv'
      wrap_update(CsvExportPlugin, subj) {
        plug = CsvExportPlugin.new(@app)
        plug.export_drugs_extended
        log = Log.new(date)
        log.update_values(log_info(plug))
        log.notify(subj)
      }   
    end

keys.

src/plugin/csv_export.rb
    def export_drugs_extended
      @options = { :compression => 'zip' }
      recipients.concat self.class::ODDB_RECIPIENTS_EXTENDED
      _export_drugs 'oddb2', [ :rectype, :iksnr, :ikscd, :ikskey, :barcode,
        :bsv_dossier, :pharmacode, :name_base, :galenic_form_de, :galenic_form_fr,
        :most_precise_dose, :size, :numerical_size_extended, :price_exfactory,
        :price_public, :company_name, :ikscat, :sl_entry, :introduction_date,
        :limitation, :limitation_points, :limitation_text, :lppv,
        :registration_date, :expiration_date, :inactive_date, :export_flag,
        :casrn, :generic_type, :has_generic, :deductible, :out_of_trade,
        :c_type, :route_of_administration, :galenic_group_de,
        :galenic_group_fr ]
    end
model = @app.atc_classes.values.sort_by { |atc| atc.code }

Confirm via bin/admin

ch.oddb> res = []; atc_classes.values.map {|atc| res.concat(atc.active_packages) }; res[6000].galenic_forms.first.description('de')
-> Retard-Kapseln
ch.oddb> res = []; atc_classes.values.map {|atc| res.concat(atc.active_packages) }; res[6000].galenic_forms.first.description('fr')
-> Capsules retard
view · edit · sidebar · attach · print · history
Page last modified on April 09, 2013, at 11:42 PM