Pymedtermino2 ICD10 import behaving strangely

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Pymedtermino2 ICD10 import behaving strangely

jritch33
Hi Jiba,

Working on a project to test out pymedtermino2. I'm trying to load ICD10 in English.

I downloaded the umls-2023AA-metathesaurus-full.zip from the UMLS website, set the backend for the quadstore and parsed the data into the quadstore.



Then I wrote a parse function to recursively read the ICD10 terminology from owlready and write it into an OWL file.

Seems some of the class relationships aren't populating quite right?



I went into the sqlite file and it seems that some of the resources are missing subclass relationships. For example, C00.0 I would expect to have a subclassOf relationship with C00. But the s, p, o combo seems to be missing. In the version of the quadstore that was created on my machine, the subclassOf relationship's storid is 9 and it never related the C00.0 (storid 7043) with C00 (storid 2424).



This particular relationship I can't find seems to also be missing for many classes across many ICD10 chapters.

I've attached the sqlite file that the import_uml function created and a txt file with some of the resources and obj I observed in the sqlite file in case that is helpful. Let me know what else I can provide that might be helpful here.

Hopefully I'm just doing something silly.

Many thanks!
Jordon

test_onto.zip
codes.txt



Reply | Threaded
Open this post in threaded view
|

Re: Pymedtermino2 ICD10 import behaving strangely

Jiba
Administrator
Hi Ritchie,

I imported ICD10 from UMLS 2023AA as follows:

from owlready2 import *
from owlready2.pymedtermino2 import *
from owlready2.pymedtermino2.umls import *

QUADSTORE = "/tmp/pym.sqlite3"
default_world.set_backend(filename = QUADSTORE)

import_umls("/home/jiba/telechargements/base_med/umls/umls-2023AA-full.zip", terminologies = ["ICD10"], langs = ["en"])
default_world.save()


Then, I used it as follows:

from owlready2 import *
from owlready2.pymedtermino2 import *
from owlready2.pymedtermino2.umls import *

QUADSTORE = "/tmp/pym.sqlite3"
default_world.set_backend(filename = QUADSTORE)

from owlready2.pymedtermino2.model import *

PYM = get_ontology("http://PYM/").load()
ICD = ICD10 = PYM["ICD10"]

t = ICD10["C00.0"]

print(t)
# => ICD10["C00.0"] # Malignant neoplasm of external upper lip

print(t.is_a)
# => [ICD10["C00"] # Malignant neoplasm of lip
#    ]


But I cannot reproduce your problem: C00 is indeed defined as a parent of C00.0.

How did you imported ICD10? Which version of Owlready are you using?

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Pymedtermino2 ICD10 import behaving strangely

jritch33
Hi Jiba,

Thank you for your efforts to reproduce and troubleshoot this for me. After your response I started from scratch in a brand new env and this time was successful.

Not sure exactly what the issue was but I think it's safe to say I must have had an issue in my previous env that caused the behavior. I'll keep investigating and if I figure out exactly what happened I will update this thread.

For now it is working; thanks Jiba!

Jordon