示例#1
0
def findDisease(cui, lang):
    look_umls = UMLSLookup()
    meaning_umls = look_umls.lookup_code_meaning(cui,
                                                 lat=lang,
                                                 preferred=False)

    if meaning_umls:
        return str(meaning_umls[0])
    else:
        #disease = str(all_csv.loc[all_csv['Disease'] == cui]["Disease_UMLS"].unique()[0].encode('utf8'))
        print("Using fallback CSV for: " + cui)
        return cui
示例#2
0
def findSymptom(cui, lang):
    look_umls = UMLSLookup()
    meaning_umls = look_umls.lookup_code_meaning(cui,
                                                 lat=lang,
                                                 preferred=False)

    if meaning_umls:
        return str(meaning_umls[0])

    else:
        print("Using fallback CSV for: " + cui)
        return cui
示例#3
0
def findFeatures(cui, lang):
    symptom_strings = []
    look_umls = UMLSLookup()

    for s_cui in getRelatedSymptomsForDisease(cui):
        meaning_umls = look_umls.lookup_code_meaning(s_cui,
                                                     lat=lang,
                                                     preferred=False)
        if meaning_umls:
            symptom_strings.append(meaning_umls[0])
        else:
            symptom_strings.append(
                all_csv.loc[all_csv['Disease'] == cui]["Symptom"].unique()[0])
    return symptom_strings
def getDetails(cui):
    look_umls = UMLSLookup()
    return look_umls.lookup_code_description(cui)
import csv

from tqdm import tqdm

import requests
import json

import pickle

import concept_mapper_utils as cm
import umls_utils as uu

try:
    from umls.umls import UMLSLookup
    umls_lu = UMLSLookup()
    log.debug('Local py-umls look-up system loaded')
except ImportError:
    umls_lu = None
    log.debug('Local py-umls look-up system not available')

########################################################################
##
########################################################################


def add_variant_term(auth_client, concepts, cui, variant, head=None):
    log.debug('Adding variant term {} ~ {}'.format(cui, variant))
    ## Make sure we have a CUI entry to hang this variant on
    concepts = flesh_out_concept(auth_client, concepts, cui, head=head)
    if (cui not in concepts):