The opencodecounts R package provides easy access to yearly summaries of clinical code usage in England. The package makes NHS England’s published datasets available in R and an interactive online tool, covering SNOMED CT codes in primary care and ICD-10/OPCS-4 codes in secondary care.
You can launch the interactive Shiny app by clicking on Launch Shiny app. For work in R, all available functions are documented in the R Reference section.
Installation
You can install the opencodecounts package in R with:
# install.packages("pak")
pak::pak("bennettoxford/opencodecounts")Available datasets
The table below lists every dataset in the opencodecounts R package, with links to download the tidy data as Parquet files. GP data covers 2011-08-01 to 2025-07-31, and HES data covers 2012-04-01 to 2025-03-31. Read the vignette for more on each dataset: Available datasets in opencodecounts.
| Function | Description | Tidy data |
|---|---|---|
get_gp_snomed() |
GP records, SNOMED CT (v0.1.0) | Download |
get_hesapc_icd10() |
HES Admitted Patient Care, ICD-10 diagnoses (v0.1.0) | Download |
get_hesapc_icd10_breakdowns() |
HES Admitted Patient Care, ICD-10 diagnoses, with breakdowns (v0.1.0) | Download |
get_hesapc_opcs4() |
HES Admitted Patient Care, OPCS-4 procedures (v0.1.0) | Download |
get_hesapc_opcs4_breakdowns() |
HES Admitted Patient Care, OPCS-4 procedures, with breakdowns (v0.1.0) | Download |
For developers
See DEVELOPERS.md.
Licence
R package
The opencodecounts package is licensed under the MIT License.
Code usage datasets
All code usage datasets are Copyright NHS England and licensed under the Open Government Licence v3.0. Contains public sector information licensed under the Open Government Licence v3.0.