Skip to content

fix(medcat): Derive UMLS name status from TS, STT and ISPREF instead of ISPREF alone - #682

Merged
mart-r merged 1 commit into
CogStack:mainfrom
chenyangsu:fix/umls-name-status
Nov 27, 2026
Merged

mart-r merged 1 commit into
CogStack:mainfrom
chenyangsu:fix/umls-name-status

Conversation

@chenyangsu

Copy link
Copy Markdown
Contributor

UMLS.to_concept_df() renames MRCONSO's ISPREF column to name_status, so each name's status is Y or N. CDBMaker turns Y into A and keeps N, which MedCAT reads as "must disambiguate". Synonyms whose atom has ISPREF = N then always need disambiguation, and no name gets P, so preferred_name stays empty.

This branch marks the concept's preferred name (TS = 'P', STT = 'PF', ISPREF = 'Y', the selection in NLM's UMLS query diagrams) as P and every other name as A, as preprocess_snomed does for SNOMED. v1 has the same mapping; happy to fix it there too.

Testing: new tests/model_creation/test_preprocess_umls.py with four synthetic MRCONSO rows; both tests fail on main. ruff check medcat --preview and mypy pass.

@mart-r mart-r left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for another good fix!

@mart-r
mart-r merged commit 3c2e217 into CogStack:main Nov 27, 2026
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants