Created
September 13, 2019 00:20
-
-
Save erfelipe/c1dd2380e175f921589fc73714652e41 to your computer and use it in GitHub Desktop.
snomed com #owlready2 [exemplo owlready]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# python3.7 -m venv venv | |
# source venv/bin/activate | |
print("##### inicio #####") | |
import tratamento | |
from owlready2 import * | |
from owlready2.pymedtermino2 import * | |
from owlready2.pymedtermino2.umls import import_umls | |
default_world.set_backend(filename = "db-snomed.sqlite3") | |
PYM = get_ontology("http://PYM/").load() | |
SNOMEDCT_US = PYM["SNOMEDCT_US"] | |
#concept = SNOMEDCT_US[22298006] | |
#print("CUI") | |
#print(SNOMEDCT_US[9661000] >> CUI) | |
#print("ICD10") | |
#print(SNOMEDCT_US[9661000] >> ICD10) | |
""" print("label: ") | |
x = concept.label | |
y = tratamento.lista_sem_duplicidade2(x) | |
print(y) """ | |
#print("sinonimo: " ) | |
#x = concept.synonyms | |
#print("label first: ") | |
#print(concept.label.first()) | |
#print("terminologia: ") | |
#print(concept.terminology) | |
#print("parents: ") | |
#print(concept.parents) | |
""" print("children: ") | |
x = concept.children | |
y = tratamento.lista_sem_duplicidade2(x) | |
print(y) """ | |
#y = tratamento.lista_sem_duplicidade2(x) | |
#print(y) | |
#print("search - muito amplo pois é pesquisa relativa") | |
#print(SNOMEDCT_US.search("Body structure*")) | |
#print("iteracao") | |
#print(SNOMEDCT_US.children) | |
for concept in SNOMEDCT_US.descendant_concepts(): | |
print(concept.label) | |
""" print("pesquisa pelo termo") | |
pesq_id = SNOMEDCT_US.search('Myocardial infarction') | |
print(pesq_id) | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment