HHS/uts-rest-api

Dear author, how could use UMLS API?

jasonsu123 opened this issue · 1 comments

Dear author,
My name is Jason.

If I want to use python to collect the CUI & synonyms information of input term list.
I find below 2 sample programs may meet my demands
But I still have some problems with their execution.

1. search-terms.py
the executed query is
python search-terms.py -k APIKEY -v VERSION -s STRING
It feedback error "search-terms.py: error: unrecognized arguments: depression"
when I input the string contains multiple texts, e.g. "mental depression"
How could I input the string contained spaces?

The UMLS Metathesaurus includes both RxNorm and SNOMED CT, plus many other terms, so the UMLS Metathesaurus will probably be the most useful.

The used database of search-terms.py is Metathesaurus ?

2. retrieve-cui-or-code.py
the executed query is python retrieve-cui-or-code.py -k APIKEY -v VERSION -i IDENTIFIER -s SOURCE

I am not understand which SOURCE could be typed in the query. If I want to use UMLS Metathesaurus, what the string should I use?

By the way, I could use the program without -s SOURCE e.g.
python retrieve-cui-or-code.py -k APIkey -v 2017AB -i C0018787
What is the default source of CUI?

Thank you
Best regards;

Apologies for the delayed response.

Put search strings with spaces in quotes, for example:

python search-terms.py -k apikey -s 'mental depression'

search-terms.py searches the UMLS Metathesaurus via its REST API, documented here: https://documentation.uts.nlm.nih.gov/rest/search/index.html

If you are retrieving a UMLS CUI with retrieve-cui-or-code.py, do not use the 'source' parameter. Use the 'source' parameter if you want to look up a code for a particular UMLS vocabulary. For example:

python retrieve-cui-or-code.py -k apikey -i 233604007 -s SNOMEDCT_US

You can find a full list of UMLS source vocabularies in the abbreviation column here:

https://www.nlm.nih.gov/research/umls/sourcereleasedocs/index.html