Skip to content

Commit

Permalink
Merge pull request #182 from CogStack/solr-upload-for-old-cdbs
Browse files Browse the repository at this point in the history
86940j1fm: fixed for old de-ID CDBs at GSTT
  • Loading branch information
tomolopolis authored Mar 6, 2024
2 parents 71a8e48 + 2c7af09 commit 30f4b26
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion webapp/api/api/solr_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,14 @@ def _upload_payload(update_url, data, collection, commit=False):


def _concept_dct(cui: str, cdb: CDB):
synonyms = list(cdb.addl_info.get('cui2original_names', {}).get(cui, set()))
concept_dct = {
'cui': str(cui),
'pretty_name': cdb.get_name(cui),
'name': re.sub(r'\([\w+\s]+\)', '', cdb.get_name(cui)).strip(),
'type_ids': list(cdb.cui2type_ids[cui]),
'desc': cdb.addl_info.get('cui2description', {}).get(cui, ''),
'synonyms': list(cdb.addl_info.get('cui2original_names', {}).get(cui, set())),
'synonyms': synonyms if len(synonyms) > 0 else [cdb.get_name(cui)]
}
return concept_dct

Expand Down

0 comments on commit 30f4b26

Please sign in to comment.