<s> from umls . models import MRCONSO <EOL> def get_cui ( vocab , code_val ) : <EOL> """<STR_LIT>""" <EOL> cuis = MRCONSO . objects . filter ( SAB = vocab , CODE = code_val ) <EOL> cui = None <EOL> if len ( cuis ) > <NUM_LIT:0> : <EOL> cui = cuis [ <NUM_LIT:0> ] . CUI <EOL> return cui <EOL> def get_code ( vocab , cui ) : <EOL> """<STR_LIT>""" <EOL> codes = MRCONSO . objects . filter ( CUI = cui , SAB = vocab ) <EOL> code = None <EOL> if len ( codes ) > <NUM_LIT:0> : <EOL> code = codes [ <NUM_LIT:0> ] . CODE <EOL> return code </s>
