コード例 #1
0
ファイル: helper.py プロジェクト: urstrulykkr/slac-backend
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
ファイル: helper.py プロジェクト: urstrulykkr/slac-backend
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
ファイル: helper.py プロジェクト: urstrulykkr/slac-backend
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
コード例 #4
0
def getDetails(cui):
    look_umls = UMLSLookup()
    return look_umls.lookup_code_description(cui)
コード例 #5
0
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):