Skip to contents

Get codelist from OpenCodelists

Usage

get_codelist(codelist_slug)

Arguments

codelist_slug

String, specifying the slug of the codelist. The naming convention of the codelist slug follows this structure: a <codelist-id> is followed by / and a <version-id>. Note that the version ID is a sequence of 8 characters. Some codelists may also have a version tag in the form of a date (YYYY-MM-DD) or a version number (e.g., v1.2) that can be used in place of the version ID.

Examples

# Get the 'cpeptide_cod' codelist from OpenCodelists.org
cpeptide_cod <- get_codelist("nhsd-primary-care-domain-refsets/cpeptide_cod/20200812/")

# Return all codes
cpeptide_cod$code
#> [1] "1106701000000107" "1106721000000103" "271227006"        "401124003"       
#> [5] "88705004"         "999351000000102" 

# Return 'coding_system' of codelist
cpeptide_cod@coding_system
#> [1] "snomedct"

# Return 'full_slug' of codelist
cpeptide_cod@full_slug
#> [1] "nhsd-primary-care-domain-refsets/cpeptide_cod/20200812"