Downloads clinical codes file from ClinicalCodes.org

Description

Either specify the full path or the article id and codelist name If an article_id is supplied but no codelist_name, all codelists are downloaded and saved as a list

Usage

1
get_ClinicalCodes(url = NULL, article_id = NULL, codelist_name = NULL)

Arguments

url

character representing the url of a codelist download on www.clinicalcodes.org

article_id

integer representiong the id of a www.ClinicalCodes.org article

codelist_name

character representing a codelist name associated with an article on www.ClinicalCodes.org

Value

a dataframe of clinical codes or a list of dataframes of clinical codes

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
# Get codelist from url:
angina_codes <- get_ClinicalCodes(
url = "https://clinicalcodes.rss.mhs.man.ac.uk/medcodes/article/6/codelist/angina/download/")
head(angina_codes)
# get codelist by id and name
depression_codes <- get_ClinicalCodes(article_id = 6, codelist_name = "depression")
head(depression_codes)
# Get all code lists for an article
codelists <- get_ClinicalCodes(article_id = 2)
sapply(codelists, nrow)

## End(Not run)