Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

86940j1fm: fixed for old de-ID CDBs at GSTT #182

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion webapp/api/api/solr_utils.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect

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