def _get(self, source_vocab, code_val, target_vocab): cui = get_cui(source_vocab, code_val) terms = MRCONSO.objects.filter(CUI=cui, SAB=target_vocab) rterms = [] for term in terms: rterms.append({ 'target_vocab': term.SAB, 'code': term.CODE, 'name': term.STR, }) return rterms
def _get(self, vocab, code_val, rel_type): source_cui = get_cui(vocab, code_val) rels_list = [] if source_cui: rels = MRREL.objects.filter(CUI1=source_cui, RELA=rel_type) for rel in rels: rels_list.append({ 'umls_cui': rel.CUI2, 'code': get_code(rel.SAB, rel.CUI2), 'rel': rel.REL, 'rela': rel.RELA }) return rels_list