ARCH-commons / i2p-transform

i2b2 to PCORnet Common Data Model Transformation - requires i2b2 PCORnet ontology
Other
3 stars 16 forks source link

Griffin's ICD9 duplicates problem #43

Closed matthewjoss closed 7 years ago

matthewjoss commented 7 years ago

The ICD10 ontology intentionally includes ICD9 c_basecodes so that users can query an ICD10 code and also get the equivalent ICD9 code. However, in my pmndiagnosis table, every ICD9 code is now listed twice. One record had it as DX_TYPE='09' (from the regular ICD9 ontology), and a second record has DX_TYPE='10' (from the ICD10 ontology). Is it supposed to be like that, or should the ICD9 codes in the ICD10 ontology not be used when importing into the pmndiagnosis table?

jklann commented 7 years ago

For #1...

-- Skip ICD-9 V codes in 10 ontology, ICD-9 E codes in 10 ontology, ICD-10 numeric codes in 10 ontology
-- Note: makes the assumption that ICD-9 Ecodes are not ICD-10 Ecodes; same with ICD-9 V codes. On inspection seems to be true.
select * from pcornet_diag_30 diag where (diag.c_fullname not like '\PCORI\DIAGNOSIS\10\%' or
  ( not ( diag.pcori_basecode like '[V]%' and diag.c_fullname not like '\PCORI\DIAGNOSIS\10\([V]%\([V]%\([V]%' )
  and not ( diag.pcori_basecode like '[E]%' and diag.c_fullname not like '\PCORI\DIAGNOSIS\10\([E]%\([E]%\([E]%' ) 
  and not (diag.c_fullname like '\PCORI\DIAGNOSIS\10\' and diag.pcori_basecode like '[0-9]%') )) 

This mess of code excludes ICD-9 codes in the ICD-10 tree. @matthewjoss , please replace the where clause on line 1187 (where diag.c_fullname like '\PCORI\DIAGNOSIS\%') with this code and test. And then figure out how to do it in Oracle. :)

matthewjoss commented 7 years ago

I did this a couple of weeks ago and pushed the updated transform to Github