view · edit · sidebar · attach · print · history

20120622-import-drugbank-ca-id-fix-atc-data

<< | Index | >>


Summary

  • checked about ddds(Dose) of Atcclass.
    • updated Dose of Atcclass as Array(Ignored keys of Hash).
  • create importer job for link to Drugbank.ca.

Commits

Finaly, Updater jobs are

via bin/admin
ch.oddb> Updater.new(self).update_atc_dosing_link
ch.oddb> Updater.new(self).update_atc_drugbank_link
separate jobs
$ ruby jobs/update_atc_dosing_link
$ ruby jobs/update_atc_drugbank_link

Index


debug ATC data

There are strange hash key in oddb.yaml.

in oddb.yaml
        ddds:   
          O: !oddb.org,2003/ODDB::AtcClass::DDD 
            administration_route: O
            dose: !oddb.org,2003/ODDB::Drugs::Dose 
              not_normalized: 
              val: 10 
              unit: mg
              scale:  
            note:   
          Omicrocryst.substance: !oddb.org,2003/ODDB::AtcClass::DDD 
            administration_route: O
            dose: !oddb.org,2003/ODDB::Drugs::Dose 
              not_normalized: 
              val: 7  
              unit: mg
              scale:  
            note: microcryst.substance
via bin/admin
ch.oddb> registration('35265').sequences.values.first.atc_class.ddds.keys
-> ["O", "Omicrocryst.substance"]
in src/model/atcclass.rb
    def create_ddd(roa)
      ddds[roa] = DDD.new(roa)  
    end

ddd chapter needs note section.

Package class use string '0' key.

in src/model/package.rb
    def ddd 
      if (atc = atc_class) and atc.respond_to?(:has_ddd?) and atc.has_ddd?
        atc.ddds['O']
      end 
    end

It seems that this keys are expected values and its are needed.

ch.oddb> keys = []; registrations.values.each {|r| r.sequences.values.each {|s| keys << s.atc_class.ddds.keys } }; p keys.flatten.uniq.length
-> 90

I generated all key list.

P
P*
O
R
PRefers to lysine acetylsalisylate
ORefers to propyphenazone
N
Ohydrochloride, (pro-phylactic daily dose)
Ohydrochloride, (prop-hylactic daily dose)
V
O0.5 mg Fluoride
PFe3+
N*
OFe2+
ORefers to ergotamine
Ochloride
Oteoclate
Rchloride
Rteoclate
SL
TD
oral aerosol
ORefers to phenazone
SL*
TDgel
Obase
Pbase
OErythromycin ethylsuccinate tablets
Pdepot
*
lamella
ointment
Pdepot long duration
Pdepot short duration
TDpatch refer to amount delivered per 24 hours
VVaginal ring refers to amount delivered per 24 hours
VVaginal ring refers to amount delivered per 24 hours *
Oexpressed as folinic acid
Pexpressed as folinic acid
OFe3+
Inhal.solution
Ptherapeutic dose
Oprophylactic dose
Inhal.powder
Inhal.aerosol
ORefers to phenylpropanolamine
Omicrocryst.substance
Oexpressed as pyri-methamine
OCa2+
SLBase
SLBase *
ORefers to levodopa
ORefers to pseudoephedrine
O40 mg fluoride
Inhal
Inhal*
Chewing gum
Omicronised
Pcourse dose
O*
ORefers to amoxicillin
PRefers to amoxicillin
VSingle dose treatment
PRefers to imipenem
depot implant
Panti Xa
Pdepot inj
Pper injection
PRefers to piperacillin
ORefers to diclofenac
OIndependent of strength
Instill.sol.
intravesical
urethral
OSe
TDdelivered dose
TDdelivered dose *
Ohydrochloride
s.c. implant
Inhal.solution *
Pexpressed as fosaprepitant
Pexpressed as fosaprepitant *
ORefers to alendronic acid
TD patch
TD patch*
Pdepot. Expressed as paliperidone
Oexpressed as lanthanum
SLRefers to buprenorphine
OThe DDD refers to oxycodone, valid for combinations with naloxone, only.
ORefers to cinnarizine

Finaly, I updated to handle ddds(Dose) of ATCClass not as Hash, But also as just Array in oddb.yaml.

commit
result
ddds:   
        - !oddb.org,2003/ODDB::AtcClass::DDD 
          administration_route: Inhal.powder
          dose: !oddb.org,2003/ODDB::Drugs::Dose 
            not_normalized: 
            val: 18 
            unit: mcg
            scale:  
          note:   
        - !oddb.org,2003/ODDB::AtcClass::DDD 
          administration_route: Inhal.solution
          dose: !oddb.org,2003/ODDB::Drugs::Dose 
            not_normalized: 
            val: 5  
            unit: mcg
            scale:  
          note:  

Create-durgbank-ca-link-importer

Total 5913 atc classes needs id of drugbank.ca.

atc classes without parent category
ch.oddb> atc_classes.values.select {|atc| !atc.description.empty? }.length
-> 7347
target atc classes for drugbank.ca
ch.oddb> atc_classes.values.select {|atc| !atc.description.empty? and atc.code.length > 6 }.length
-> 5913

I created updater job.

ch.oddb> Updater.new(self).update_atc_drug_bank_link
-> ["yasaka@ywesee.com"]

And improved method name of dosing_de updater, too.
Now We have 2 updater for links(drugbank.ca and dosing.de) by ATC code.

ch.oddb> Updater.new(self).update_atc_dosing_de_link
-> ["yasaka@ywesee.com"]
commits

Renamed drug_bank and dosig_de

commit
Renamed drug_bank and dosing_de

* drug_bank to drugbank
* dosing_de to dosing

Update Registration#export_flag in oddb.yaml

Registration Model has nil value as export_flag.

in src/model/registration.rb
check_accessor_list = {
...
  :export_flag => ["FalseClass","NilClass","TrueClass"]
...

I updated empty(nil) export_flag as false in oddd.yaml.

$ grep -w export_flag data/downloads/oddb.yaml | sort | uniq
  export_flag: false
  export_flag: true
commit
view · edit · sidebar · attach · print · history
Page last modified on June 22, 2012, at 04:23 PM